@equal-experts/kuat-react 0.13.0 → 0.13.1
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.
- package/agent-docs/AGENTS.md +10 -0
- package/agent-docs/README.md +17 -0
- package/agent-docs/bundle-manifest.json +63 -0
- package/agent-docs/components/_template.md +21 -0
- package/agent-docs/components/button-group.md +27 -0
- package/agent-docs/components/button.md +50 -0
- package/agent-docs/components/components.manifest.json +20 -0
- package/agent-docs/components/kuat-header.md +27 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/LOADING.md +166 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/accessibility.md +444 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/brand.md +99 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/README.md +28 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/formatting.md +93 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/numbers.md +69 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/punctuation.md +75 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/voice-and-tone.md +263 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/content/writing-style.md +91 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/README.md +28 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/borders.md +159 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/colours.md +173 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/design-language.md +116 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/spacing.md +130 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/design/typography.md +155 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/foundations/logo.md +151 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/content/README.md +26 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/content/blog-posts.md +33 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/content/marketing-content.md +65 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/content/seo.md +44 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/emails.md +74 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/scenarios/README.md +18 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/scenarios/marketing-pages.md +368 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/marketing/website.md +169 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/DEPRECATIONS.md +28 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/README.md +65 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/accessibility.md +402 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/component-decision-tree.md +263 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/component-registry.md +68 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/README.md +29 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/actions.md +51 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/confirmations.md +57 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/empty-states.md +43 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/errors.md +54 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/forms.md +74 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/content/product-content.md +138 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/design.md +207 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/emails.md +71 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/review-checklist.md +57 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/review-context.md +44 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/README.md +82 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/authentication.md +303 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/dashboards.md +313 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/documentation.md +333 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/scenarios/forms.md +361 -0
- package/agent-docs/external/kuat-agent-rules/kuat-docs/rules/types/web/product/technical.md +488 -0
- package/agent-docs/kuat-docs/rules/README.md +148 -0
- package/agent-docs/kuat-docs/rules/design/layouts.md +394 -0
- package/agent-docs/kuat-docs/rules/scenarios/README.md +83 -0
- package/agent-docs/kuat-docs/rules/scenarios/authentication.md +301 -0
- package/agent-docs/kuat-docs/rules/scenarios/dashboards.md +314 -0
- package/agent-docs/kuat-docs/rules/scenarios/documentation.md +333 -0
- package/agent-docs/kuat-docs/rules/scenarios/forms.md +359 -0
- package/agent-docs/kuat-docs/rules/scenarios/marketing-pages.md +367 -0
- package/agent-docs/manifest.json +9 -0
- package/agent-docs/rules/LOADING-consumer.md +27 -0
- package/dist/accordion.d.ts +2 -0
- package/dist/alert-dialog.d.ts +2 -0
- package/dist/badge.d.ts +3 -0
- package/dist/button-group.d.ts +2 -0
- package/dist/button.d.ts +3 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/checkbox.d.ts +3 -0
- package/dist/components/ui/accordion/accordion.d.ts +7 -0
- package/dist/components/ui/accordion/index.d.ts +1 -0
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog/index.d.ts +1 -0
- package/dist/components/ui/badge/badge.d.ts +16 -0
- package/dist/components/ui/badge/index.d.ts +2 -0
- package/dist/components/ui/breadcrumb/Breadcrumb.d.ts +29 -0
- package/dist/components/ui/breadcrumb/breadcrumb-primitives.d.ts +19 -0
- package/dist/components/ui/breadcrumb/index.d.ts +4 -0
- package/dist/components/ui/button/button.d.ts +27 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button-group/button-group.d.ts +23 -0
- package/dist/components/ui/button-group/index.d.ts +2 -0
- package/dist/components/ui/carousel/carousel.d.ts +50 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/checkbox/checkbox-field.d.ts +23 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox/index.d.ts +4 -0
- package/dist/components/ui/content-card/content-card.d.ts +29 -0
- package/dist/components/ui/content-card/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/ee-logo-icon/ee-logo-icon.d.ts +11 -0
- package/dist/components/ui/ee-logo-icon/index.d.ts +2 -0
- package/dist/components/ui/field/field.d.ts +28 -0
- package/dist/components/ui/field/index.d.ts +2 -0
- package/dist/components/ui/icon-button/icon-button.d.ts +27 -0
- package/dist/components/ui/icon-button/index.d.ts +2 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/input.d.ts +20 -0
- package/dist/components/ui/kuat-carousel/index.d.ts +2 -0
- package/dist/components/ui/kuat-carousel/kuat-carousel.d.ts +16 -0
- package/dist/components/ui/kuat-header/index.d.ts +4 -0
- package/dist/components/ui/kuat-header/kuat-header.d.ts +16 -0
- package/dist/components/ui/kuat-header/kuat-header.logic.d.ts +32 -0
- package/dist/components/ui/kuat-header/kuat-header.types.d.ts +91 -0
- package/dist/components/ui/kuat-logo-lockup/index.d.ts +2 -0
- package/dist/components/ui/kuat-logo-lockup/kuat-logo-lockup.d.ts +17 -0
- package/dist/components/ui/kuat-radial-progress/index.d.ts +2 -0
- package/dist/components/ui/kuat-radial-progress/kuat-radial-progress.d.ts +16 -0
- package/dist/components/ui/radio/index.d.ts +4 -0
- package/dist/components/ui/radio/radio-field.d.ts +25 -0
- package/dist/components/ui/radio/radio.d.ts +7 -0
- package/dist/components/ui/select/constants.d.ts +19 -0
- package/dist/components/ui/select/index.d.ts +3 -0
- package/dist/components/ui/select/select.d.ts +53 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/separator.d.ts +9 -0
- package/dist/components/ui/sonner/index.d.ts +4 -0
- package/dist/components/ui/sonner/sonner-content.d.ts +15 -0
- package/dist/components/ui/sonner/sonner.d.ts +21 -0
- package/dist/components/ui/switch/index.d.ts +4 -0
- package/dist/components/ui/switch/switch-field.d.ts +23 -0
- package/dist/components/ui/switch/switch.d.ts +5 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/toggle/constants.d.ts +4 -0
- package/dist/components/ui/toggle/index.d.ts +6 -0
- package/dist/components/ui/toggle/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle/toggle.d.ts +9 -0
- package/dist/field.d.ts +3 -0
- package/dist/icon-button.d.ts +3 -0
- package/dist/index.d.ts +47 -0
- package/dist/input.d.ts +3 -0
- package/dist/kuat-carousel.d.ts +2 -0
- package/dist/kuat-radial-progress.d.ts +7 -0
- package/dist/lib/react-node-compat.d.ts +7 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/radio.d.ts +3 -0
- package/dist/select.d.ts +3 -0
- package/dist/sonner.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/style.css.d.ts +2 -0
- package/dist/switch.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/toggle-group.d.ts +3 -0
- package/dist/toggle.d.ts +3 -0
- package/package.json +4 -2
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Documentation Scenarios
|
|
2
|
+
|
|
3
|
+
Patterns for documentation sites, knowledge bases, API references, and content-heavy pages.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
### User Goals
|
|
10
|
+
|
|
11
|
+
- **Find information quickly** - Search and navigate efficiently
|
|
12
|
+
- **Understand content** - Clear, well-structured explanations
|
|
13
|
+
- **Complete tasks** - Step-by-step guidance that works
|
|
14
|
+
- **Stay oriented** - Know where they are and where to go next
|
|
15
|
+
|
|
16
|
+
### UX Principles
|
|
17
|
+
|
|
18
|
+
| Principle | Implementation |
|
|
19
|
+
|-----------|----------------|
|
|
20
|
+
| Clear structure | Logical hierarchy, consistent organisation |
|
|
21
|
+
| Scannable content | Headings, lists, code blocks |
|
|
22
|
+
| Multiple paths | Search, navigation, breadcrumbs |
|
|
23
|
+
| Progressive detail | Overview first, details on demand |
|
|
24
|
+
|
|
25
|
+
### Success Metrics
|
|
26
|
+
|
|
27
|
+
- Search effectiveness (found what they needed)
|
|
28
|
+
- Time to find information
|
|
29
|
+
- Page bounce rate
|
|
30
|
+
- Task completion rate (for tutorials)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Layout
|
|
35
|
+
|
|
36
|
+
**Base Layout:** [Sidebar Navigation](../design/layouts.md#2-sidebar-navigation-layout) + [Split Layout](../design/layouts.md#5-split-layout)
|
|
37
|
+
|
|
38
|
+
Documentation uses a three-column layout on desktop:
|
|
39
|
+
|
|
40
|
+
### Docs Landing Page
|
|
41
|
+
|
|
42
|
+
Use [Horizontal Navigation](../design/layouts.md#1-horizontal-navigation-layout):
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
┌─────────────────────────────────────┐
|
|
46
|
+
│ Header: Logo + Main Nav │
|
|
47
|
+
├─────────────────────────────────────┤
|
|
48
|
+
│ Hero: Docs title + Search │
|
|
49
|
+
├─────────────────────────────────────┤
|
|
50
|
+
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
|
|
51
|
+
│ │Cat 1│ │Cat 2│ │Cat 3│ │Cat 4│ │
|
|
52
|
+
│ └─────┘ └─────┘ └─────┘ └─────┘ │
|
|
53
|
+
├─────────────────────────────────────┤
|
|
54
|
+
│ Popular Articles │
|
|
55
|
+
├─────────────────────────────────────┤
|
|
56
|
+
│ Footer │
|
|
57
|
+
└─────────────────────────────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Docs Content Page
|
|
61
|
+
|
|
62
|
+
Use Sidebar + Split (three-column):
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
┌──────┬──────────────────────────────────┐
|
|
66
|
+
│ Nav │ Breadcrumbs [Search] │
|
|
67
|
+
│ Side ├──────────────────────────────────┤
|
|
68
|
+
│ bar │ ┌───────────┐ │
|
|
69
|
+
│ │ # Page Title │ On This │ │
|
|
70
|
+
│ │ │ Page │ │
|
|
71
|
+
│ [Doc │ Content... │ - Section │ │
|
|
72
|
+
│ tree]│ │ - Section │ │
|
|
73
|
+
│ │ ## Section │ - Section │ │
|
|
74
|
+
│ │ Content... └───────────┘ │
|
|
75
|
+
│ │ │
|
|
76
|
+
│ │ [Previous] [Next →] │
|
|
77
|
+
└──────┴──────────────────────────────────┘
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Specifications
|
|
81
|
+
|
|
82
|
+
| Element | Value |
|
|
83
|
+
|---------|-------|
|
|
84
|
+
| Left sidebar width | 240-280px |
|
|
85
|
+
| Right sidebar (TOC) | 200-240px |
|
|
86
|
+
| Content max-width | 800px (prose) |
|
|
87
|
+
| Content padding | 32-48px |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Design
|
|
92
|
+
|
|
93
|
+
### Color Tokens
|
|
94
|
+
|
|
95
|
+
| Element | Token |
|
|
96
|
+
|---------|-------|
|
|
97
|
+
| Page background | `bg-background` |
|
|
98
|
+
| Left sidebar | `bg-sidebar` (dark) or `bg-muted` (light) |
|
|
99
|
+
| Right sidebar | `bg-background` (transparent) |
|
|
100
|
+
| Code blocks | `bg-muted` |
|
|
101
|
+
| Inline code | `bg-muted` |
|
|
102
|
+
| Links | `text-primary` |
|
|
103
|
+
|
|
104
|
+
### Typography
|
|
105
|
+
|
|
106
|
+
| Element | Style |
|
|
107
|
+
|---------|-------|
|
|
108
|
+
| Page title (H1) | `text-3xl font-bold` |
|
|
109
|
+
| Section heading (H2) | `text-2xl font-semibold` |
|
|
110
|
+
| Subsection (H3) | `text-xl font-semibold` |
|
|
111
|
+
| Body text | `text-base` with `leading-7` |
|
|
112
|
+
| Code | `font-mono text-sm` |
|
|
113
|
+
| Sidebar nav | `text-sm` |
|
|
114
|
+
|
|
115
|
+
### Navigation Sidebar
|
|
116
|
+
|
|
117
|
+
| Element | Specification |
|
|
118
|
+
|---------|---------------|
|
|
119
|
+
| Background | `bg-sidebar` (dark) or `bg-muted` (light) |
|
|
120
|
+
| Active item | Left border or background highlight |
|
|
121
|
+
| Section headers | Bold, no link |
|
|
122
|
+
| Page links | Normal weight |
|
|
123
|
+
| Sub-pages | Indented, smaller text |
|
|
124
|
+
| Scroll | Independent from content |
|
|
125
|
+
|
|
126
|
+
### Table of Contents (Right)
|
|
127
|
+
|
|
128
|
+
| Element | Specification |
|
|
129
|
+
|---------|---------------|
|
|
130
|
+
| Position | Sticky, offset for header |
|
|
131
|
+
| Content | H2 and H3 headings from page |
|
|
132
|
+
| Active tracking | Highlight current section on scroll |
|
|
133
|
+
| Visibility | Hide below 1280px |
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Content
|
|
138
|
+
|
|
139
|
+
### Page Structure
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
# Page Title ← H1, one per page
|
|
143
|
+
|
|
144
|
+
Intro paragraph ← No heading, describes page purpose
|
|
145
|
+
|
|
146
|
+
## Major Section ← H2, main divisions
|
|
147
|
+
|
|
148
|
+
### Subsection ← H3, within sections
|
|
149
|
+
|
|
150
|
+
#### Detail ← H4, use sparingly
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Navigation Hierarchy
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
Getting Started ← Category (bold, not clickable)
|
|
157
|
+
Introduction ← Page link
|
|
158
|
+
Installation ← Page link (active)
|
|
159
|
+
Quick Start ← Page link
|
|
160
|
+
Components ← Category
|
|
161
|
+
Button ← Page link
|
|
162
|
+
Variants ← Sub-page (indented)
|
|
163
|
+
Examples ← Sub-page
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Breadcrumbs
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
Docs / Components / Button / Variants
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- Show full path to current page
|
|
173
|
+
- All items clickable except current
|
|
174
|
+
- Truncate middle items on mobile if needed
|
|
175
|
+
|
|
176
|
+
### Previous/Next Navigation
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
┌─────────────────────────────────────────┐
|
|
180
|
+
│ ← Previous Next → │
|
|
181
|
+
│ Installation Quick Start │
|
|
182
|
+
└─────────────────────────────────────────┘
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- Full width bar at bottom of content
|
|
186
|
+
- Based on sidebar navigation order
|
|
187
|
+
- Show page titles, not just "Previous/Next"
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Accessibility
|
|
192
|
+
|
|
193
|
+
**Base requirements:** See [accessibility/design.md](../accessibility/design.md), [accessibility/content.md](../accessibility/content.md), and [accessibility/technical.md](../accessibility/technical.md)
|
|
194
|
+
|
|
195
|
+
**Scenario-specific:**
|
|
196
|
+
|
|
197
|
+
| Requirement | Implementation |
|
|
198
|
+
|-------------|----------------|
|
|
199
|
+
| Heading hierarchy | Proper H1 → H2 → H3 sequence |
|
|
200
|
+
| Skip links | Skip to main content, skip navigation |
|
|
201
|
+
| Landmark regions | nav, main, complementary (TOC) |
|
|
202
|
+
| Search keyboard | Cmd/Ctrl+K shortcut, accessible modal |
|
|
203
|
+
| Code blocks | Scrollable with keyboard, screen reader context |
|
|
204
|
+
| Multiple nav labels | `aria-label` to distinguish left vs right sidebars |
|
|
205
|
+
|
|
206
|
+
### Code Blocks
|
|
207
|
+
|
|
208
|
+
- Ensure code blocks are keyboard scrollable
|
|
209
|
+
- Provide language context for screen readers
|
|
210
|
+
- Copy button must be keyboard accessible
|
|
211
|
+
- Don't rely on syntax highlighting alone for meaning
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Implementation
|
|
216
|
+
|
|
217
|
+
### Code Block Patterns
|
|
218
|
+
|
|
219
|
+
**Inline Code:**
|
|
220
|
+
|
|
221
|
+
- Use for: function names, file paths, short values
|
|
222
|
+
- Style: `bg-muted`, `font-mono`, `text-sm`, `rounded`
|
|
223
|
+
|
|
224
|
+
**Code Blocks:**
|
|
225
|
+
|
|
226
|
+
| Element | Specification |
|
|
227
|
+
|---------|---------------|
|
|
228
|
+
| Background | `bg-muted` or syntax theme |
|
|
229
|
+
| Border radius | 6px |
|
|
230
|
+
| Padding | 16px |
|
|
231
|
+
| Font | JetBrains Mono or system mono |
|
|
232
|
+
| Line numbers | Optional, for reference |
|
|
233
|
+
| Copy button | Top-right corner |
|
|
234
|
+
| Language label | Top-left or top-right |
|
|
235
|
+
|
|
236
|
+
**Multi-file Examples (Tabs):**
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
┌─────────────────────────────────────┐
|
|
240
|
+
│ [React] [Vue] [HTML] │
|
|
241
|
+
├─────────────────────────────────────┤
|
|
242
|
+
│ // Code for selected tab │
|
|
243
|
+
│ ... │
|
|
244
|
+
└─────────────────────────────────────┘
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
- Tabs for framework variants
|
|
248
|
+
- Preserve selection across page navigation
|
|
249
|
+
- Accessible tab panel pattern
|
|
250
|
+
|
|
251
|
+
### Search Patterns
|
|
252
|
+
|
|
253
|
+
**Search Bar:**
|
|
254
|
+
|
|
255
|
+
- Prominent on landing page (hero area)
|
|
256
|
+
- Persistent in header on content pages
|
|
257
|
+
- Keyboard shortcut indicator (⌘K or Ctrl+K)
|
|
258
|
+
|
|
259
|
+
**Search Results:**
|
|
260
|
+
|
|
261
|
+
- Show in modal/overlay
|
|
262
|
+
- Group by section/category
|
|
263
|
+
- Highlight matching text
|
|
264
|
+
- Keyboard navigation (arrows + enter)
|
|
265
|
+
- Recent searches
|
|
266
|
+
|
|
267
|
+
### Table of Contents Behavior
|
|
268
|
+
|
|
269
|
+
| Behavior | Implementation |
|
|
270
|
+
|----------|----------------|
|
|
271
|
+
| Active tracking | Highlight section in viewport |
|
|
272
|
+
| Click to scroll | Smooth scroll to section |
|
|
273
|
+
| Sticky position | Stay visible while scrolling |
|
|
274
|
+
| Hide on small screens | Below 1280px |
|
|
275
|
+
| Collapse | Optionally collapsible |
|
|
276
|
+
|
|
277
|
+
### Responsive Behavior
|
|
278
|
+
|
|
279
|
+
| Breakpoint | Left Sidebar | Content | Right Sidebar |
|
|
280
|
+
|------------|--------------|---------|---------------|
|
|
281
|
+
| Mobile | Drawer (hidden) | Full width | Hidden |
|
|
282
|
+
| Tablet | Collapsible | Full width | Hidden |
|
|
283
|
+
| Desktop | Visible (240px) | Centered (max 800px) | Visible (200px) |
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Best Practices
|
|
288
|
+
|
|
289
|
+
### Do's
|
|
290
|
+
|
|
291
|
+
1. **Use descriptive headings** - Enable scanning and navigation
|
|
292
|
+
2. **Keep pages focused** - One topic per page
|
|
293
|
+
3. **Show code examples** - Demonstrate, don't just describe
|
|
294
|
+
4. **Maintain consistency** - Same structure across all pages
|
|
295
|
+
5. **Update with product** - Keep docs in sync with code
|
|
296
|
+
6. **Provide multiple paths** - Search, nav, links, breadcrumbs
|
|
297
|
+
|
|
298
|
+
### Don'ts
|
|
299
|
+
|
|
300
|
+
1. **Don't write walls of text** - Break into sections
|
|
301
|
+
2. **Don't assume knowledge** - Define terms, link to prereqs
|
|
302
|
+
3. **Don't hide important info** - Key points should be scannable
|
|
303
|
+
4. **Don't let docs go stale** - Regular review and updates
|
|
304
|
+
5. **Don't break links** - Use redirects when restructuring
|
|
305
|
+
|
|
306
|
+
### Common Mistakes
|
|
307
|
+
|
|
308
|
+
| Mistake | Solution |
|
|
309
|
+
|---------|----------|
|
|
310
|
+
| No search | Add prominent search functionality |
|
|
311
|
+
| Deep nesting | Flatten hierarchy, max 3 levels |
|
|
312
|
+
| Missing navigation | Add prev/next, breadcrumbs |
|
|
313
|
+
| Inconsistent structure | Template for all pages |
|
|
314
|
+
| No code examples | Add runnable examples |
|
|
315
|
+
| Outdated content | Version docs, review process |
|
|
316
|
+
|
|
317
|
+
### Edge Cases
|
|
318
|
+
|
|
319
|
+
| Case | Handling |
|
|
320
|
+
|------|----------|
|
|
321
|
+
| Very long pages | Add TOC, consider splitting |
|
|
322
|
+
| Multi-version docs | Version switcher, clear indicators |
|
|
323
|
+
| API reference | Auto-generate from code, consistent format |
|
|
324
|
+
| External links | Mark with icon, open in new tab |
|
|
325
|
+
| Deprecated content | Clear warnings, link to current |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Related Documentation
|
|
330
|
+
|
|
331
|
+
- [Layout Primitives](../design/layouts.md) - Sidebar and Split layouts
|
|
332
|
+
- [Content Accessibility](../accessibility/content.md) - Structure and headings
|
|
333
|
+
- [Rules index](../README.md) - Canonical EE typography (`external/kuat-agent-rules`)
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Form Scenarios
|
|
2
|
+
|
|
3
|
+
Patterns for forms, settings pages, multi-step wizards, and data entry interfaces.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
### User Goals
|
|
10
|
+
|
|
11
|
+
- **Complete task efficiently** - Minimal friction to submission
|
|
12
|
+
- **Understand requirements** - Clear what's needed and why
|
|
13
|
+
- **Correct mistakes easily** - Fix errors without re-entering data
|
|
14
|
+
- **Save progress** - Don't lose work unexpectedly
|
|
15
|
+
|
|
16
|
+
### UX Principles
|
|
17
|
+
|
|
18
|
+
| Principle | Implementation |
|
|
19
|
+
|-----------|----------------|
|
|
20
|
+
| Minimal friction | Only ask for necessary information |
|
|
21
|
+
| Clear expectations | Explain what each field needs |
|
|
22
|
+
| Helpful feedback | Specific, actionable error messages |
|
|
23
|
+
| Progress preservation | Save work, confirm destructive actions |
|
|
24
|
+
|
|
25
|
+
### Success Metrics
|
|
26
|
+
|
|
27
|
+
- Form completion rate
|
|
28
|
+
- Time to complete
|
|
29
|
+
- Error rate and recovery
|
|
30
|
+
- Abandonment rate
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Layout
|
|
35
|
+
|
|
36
|
+
**Base Layout:** Varies by context
|
|
37
|
+
|
|
38
|
+
| Context | Recommended Layout |
|
|
39
|
+
|---------|-------------------|
|
|
40
|
+
| Public forms (contact, signup) | [Single Column](../design/layouts.md#3-single-column-layout) |
|
|
41
|
+
| App settings | [Sidebar Navigation](../design/layouts.md#2-sidebar-navigation-layout) |
|
|
42
|
+
| Multi-step wizards | Single Column or Horizontal Navigation |
|
|
43
|
+
| Inline editing | Within parent layout |
|
|
44
|
+
|
|
45
|
+
### Card-Based Form (Settings, Profile)
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
┌─────────────────────────────────────┐
|
|
49
|
+
│ Card Header: Section Title │
|
|
50
|
+
├─────────────────────────────────────┤
|
|
51
|
+
│ Form Fields │
|
|
52
|
+
│ ... │
|
|
53
|
+
├─────────────────────────────────────┤
|
|
54
|
+
│ Card Footer: [Cancel] [Save] │
|
|
55
|
+
└─────────────────────────────────────┘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Multi-Step Wizard
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
┌─────────────────────────────────────┐
|
|
62
|
+
│ Progress: ●───●───○───○ │
|
|
63
|
+
├─────────────────────────────────────┤
|
|
64
|
+
│ Step Title │
|
|
65
|
+
│ Step description │
|
|
66
|
+
├─────────────────────────────────────┤
|
|
67
|
+
│ │
|
|
68
|
+
│ Form Fields for Current Step │
|
|
69
|
+
│ │
|
|
70
|
+
├─────────────────────────────────────┤
|
|
71
|
+
│ [Back] [Next →] │
|
|
72
|
+
└─────────────────────────────────────┘
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Specifications
|
|
76
|
+
|
|
77
|
+
| Element | Value |
|
|
78
|
+
|---------|-------|
|
|
79
|
+
| Form card max-width | 600px (single-column forms) |
|
|
80
|
+
| Card padding | 24px (`p-6`) |
|
|
81
|
+
| Field spacing | 24px (`space-y-6`) |
|
|
82
|
+
| Section spacing | 32px between cards |
|
|
83
|
+
| Settings page max-width | 800px |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Design
|
|
88
|
+
|
|
89
|
+
### Color Tokens
|
|
90
|
+
|
|
91
|
+
| Element | Token |
|
|
92
|
+
|---------|-------|
|
|
93
|
+
| Card background | `bg-card` |
|
|
94
|
+
| Card border | `border` |
|
|
95
|
+
| Input background | `bg-background` |
|
|
96
|
+
| Input border | `border-input` |
|
|
97
|
+
| Input focus | `ring-ring` |
|
|
98
|
+
| Error state | `border-destructive`, `text-destructive` |
|
|
99
|
+
| Success indicator | `text-green-600` |
|
|
100
|
+
|
|
101
|
+
### Typography
|
|
102
|
+
|
|
103
|
+
| Element | Style |
|
|
104
|
+
|---------|-------|
|
|
105
|
+
| Section title | `text-lg font-semibold` |
|
|
106
|
+
| Section description | `text-sm text-muted-foreground` |
|
|
107
|
+
| Field label | `text-sm font-medium` |
|
|
108
|
+
| Input text | `text-base` |
|
|
109
|
+
| Helper text | `text-sm text-muted-foreground` |
|
|
110
|
+
| Error text | `text-sm text-destructive` |
|
|
111
|
+
| Required indicator | `text-destructive` (asterisk) |
|
|
112
|
+
|
|
113
|
+
### Spacing
|
|
114
|
+
|
|
115
|
+
| Element | Value |
|
|
116
|
+
|---------|-------|
|
|
117
|
+
| Label to input | 8px |
|
|
118
|
+
| Input to helper/error | 4px |
|
|
119
|
+
| Between fields | 24px |
|
|
120
|
+
| Button group gap | 16px |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Content
|
|
125
|
+
|
|
126
|
+
### Field Labels
|
|
127
|
+
|
|
128
|
+
| Requirement | Example |
|
|
129
|
+
|-------------|---------|
|
|
130
|
+
| Clear and specific | "Email address" not "Email" |
|
|
131
|
+
| Required indicator | "Email address *" |
|
|
132
|
+
| Optional indicator | "Phone number (optional)" |
|
|
133
|
+
|
|
134
|
+
### Helper Text
|
|
135
|
+
|
|
136
|
+
Use to:
|
|
137
|
+
- Explain format requirements
|
|
138
|
+
- Provide examples
|
|
139
|
+
- Clarify why information is needed
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Email address *
|
|
143
|
+
[ ]
|
|
144
|
+
We'll send your receipt to this address.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Error Messages
|
|
148
|
+
|
|
149
|
+
| Quality | Bad | Good |
|
|
150
|
+
|---------|-----|------|
|
|
151
|
+
| Specific | "Invalid input" | "Email must include @ symbol" |
|
|
152
|
+
| Actionable | "Error" | "Please enter a valid date (DD/MM/YYYY)" |
|
|
153
|
+
| Polite | "Wrong!" | "Please check this field" |
|
|
154
|
+
|
|
155
|
+
### Button Labels
|
|
156
|
+
|
|
157
|
+
| Action | Label |
|
|
158
|
+
|--------|-------|
|
|
159
|
+
| Submit form | "Save changes", "Submit", "Create account" |
|
|
160
|
+
| Go to next step | "Next", "Continue" |
|
|
161
|
+
| Go back | "Back", "Previous" |
|
|
162
|
+
| Cancel | "Cancel", "Discard changes" |
|
|
163
|
+
| Delete | "Delete", "Remove" |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Accessibility
|
|
168
|
+
|
|
169
|
+
**Base requirements:** See [accessibility/design.md](../accessibility/design.md), [accessibility/content.md](../accessibility/content.md), and [accessibility/technical.md](../accessibility/technical.md)
|
|
170
|
+
|
|
171
|
+
**Scenario-specific:**
|
|
172
|
+
|
|
173
|
+
| Requirement | Implementation |
|
|
174
|
+
|-------------|----------------|
|
|
175
|
+
| Labels | Every input has visible, associated `<label>` |
|
|
176
|
+
| Required fields | Marked with asterisk AND `aria-required` |
|
|
177
|
+
| Error linking | Errors linked via `aria-describedby` |
|
|
178
|
+
| Error summary | Summary at top with links to fields |
|
|
179
|
+
| Focus management | Focus first error after failed submission |
|
|
180
|
+
| No time limits | Allow unlimited time (or generous extension) |
|
|
181
|
+
|
|
182
|
+
### Form Validation Pattern
|
|
183
|
+
|
|
184
|
+
**Critical: Validate on submit, not on blur**
|
|
185
|
+
|
|
186
|
+
| Rule | Implementation |
|
|
187
|
+
|------|----------------|
|
|
188
|
+
| Validate on submit | Show all errors after form submission |
|
|
189
|
+
| Never disable submit | Users can always attempt submission |
|
|
190
|
+
| No blur validation | Don't show errors while user is typing |
|
|
191
|
+
| Error summary | Show summary above form with field links |
|
|
192
|
+
| Focus first error | Move focus to first invalid field |
|
|
193
|
+
|
|
194
|
+
### Grouping
|
|
195
|
+
|
|
196
|
+
Use `<fieldset>` and `<legend>` for:
|
|
197
|
+
- Radio button groups
|
|
198
|
+
- Checkbox groups
|
|
199
|
+
- Related fields (e.g., address components)
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Implementation
|
|
204
|
+
|
|
205
|
+
### Field Layout Patterns
|
|
206
|
+
|
|
207
|
+
**Vertical (Default):**
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Label
|
|
211
|
+
[Input field ]
|
|
212
|
+
Helper text or error
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Best for: Most forms, mobile-first
|
|
216
|
+
|
|
217
|
+
**Horizontal (Settings):**
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
Label [Input field ]
|
|
221
|
+
Description text
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Best for: Settings pages with many fields
|
|
225
|
+
|
|
226
|
+
**Grid (Related Fields):**
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
[First Name ] [Last Name ]
|
|
230
|
+
[Email ]
|
|
231
|
+
[Phone ] [Extension ]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Best for: Related fields (names, addresses)
|
|
235
|
+
|
|
236
|
+
### Button Placement
|
|
237
|
+
|
|
238
|
+
**Single Form:**
|
|
239
|
+
|
|
240
|
+
| Position | Button | Variant |
|
|
241
|
+
|----------|--------|---------|
|
|
242
|
+
| Right | Submit/Save | `variant="default"` (primary) |
|
|
243
|
+
| Left of submit | Cancel | `variant="outline"` or `ghost` |
|
|
244
|
+
| Far left or separate | Delete | `variant="destructive"` |
|
|
245
|
+
|
|
246
|
+
**Form in Modal:**
|
|
247
|
+
|
|
248
|
+
| Position | Button |
|
|
249
|
+
|----------|--------|
|
|
250
|
+
| Left | Cancel |
|
|
251
|
+
| Right | Submit |
|
|
252
|
+
|
|
253
|
+
**Multi-step Wizard:**
|
|
254
|
+
|
|
255
|
+
| Position | Button |
|
|
256
|
+
|----------|--------|
|
|
257
|
+
| Left | Back (`variant="outline"`) |
|
|
258
|
+
| Right | Next/Submit (`variant="default"`) |
|
|
259
|
+
|
|
260
|
+
### Settings Page Pattern
|
|
261
|
+
|
|
262
|
+
Multiple card sections, each independently saveable:
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
┌─ Profile Information ───────────────┐
|
|
266
|
+
│ [Fields...] │
|
|
267
|
+
│ [Save] │
|
|
268
|
+
└─────────────────────────────────────┘
|
|
269
|
+
↓ 32px gap
|
|
270
|
+
┌─ Notification Preferences ──────────┐
|
|
271
|
+
│ [Fields...] │
|
|
272
|
+
│ [Save] │
|
|
273
|
+
└─────────────────────────────────────┘
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
| Element | Specification |
|
|
277
|
+
|---------|---------------|
|
|
278
|
+
| Section gap | 32px |
|
|
279
|
+
| Section max-width | 800px |
|
|
280
|
+
| Alignment | Left-aligned (not centered) |
|
|
281
|
+
|
|
282
|
+
### Multi-Step Wizard Pattern
|
|
283
|
+
|
|
284
|
+
**Progress Indicator:**
|
|
285
|
+
|
|
286
|
+
- Show step numbers or names
|
|
287
|
+
- Highlight: completed, current, upcoming
|
|
288
|
+
- Allow clicking completed steps to go back
|
|
289
|
+
|
|
290
|
+
**Step Transitions:**
|
|
291
|
+
|
|
292
|
+
- Validate current step before "Next"
|
|
293
|
+
- Show summary on final step before submit
|
|
294
|
+
- Preserve data when going back
|
|
295
|
+
|
|
296
|
+
**State Management:**
|
|
297
|
+
|
|
298
|
+
- Save progress to prevent data loss
|
|
299
|
+
- Warn before leaving with unsaved changes
|
|
300
|
+
- Handle session timeout gracefully
|
|
301
|
+
|
|
302
|
+
### Responsive Behavior
|
|
303
|
+
|
|
304
|
+
| Breakpoint | Grid Fields | Button Layout |
|
|
305
|
+
|------------|-------------|---------------|
|
|
306
|
+
| Mobile | Stack to single column | Stack vertically |
|
|
307
|
+
| Tablet | 2 columns | Horizontal |
|
|
308
|
+
| Desktop | As designed | Horizontal |
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Best Practices
|
|
313
|
+
|
|
314
|
+
### Do's
|
|
315
|
+
|
|
316
|
+
1. **Ask only what's needed** - Every field should be justified
|
|
317
|
+
2. **Group related fields** - Logical sections aid completion
|
|
318
|
+
3. **Show progress** - Especially for long/multi-step forms
|
|
319
|
+
4. **Preserve input** - Never clear on error
|
|
320
|
+
5. **Confirm success** - Toast, redirect, or inline confirmation
|
|
321
|
+
6. **Autosave where possible** - Drafts, settings
|
|
322
|
+
|
|
323
|
+
### Don'ts
|
|
324
|
+
|
|
325
|
+
1. **Don't validate on blur** - Interrupts user flow
|
|
326
|
+
2. **Don't disable submit** - Users should always try
|
|
327
|
+
3. **Don't use placeholders as labels** - They disappear
|
|
328
|
+
4. **Don't require confirmation for simple saves** - Only for destructive actions
|
|
329
|
+
5. **Don't hide required indicators** - Make them obvious
|
|
330
|
+
|
|
331
|
+
### Common Mistakes
|
|
332
|
+
|
|
333
|
+
| Mistake | Solution |
|
|
334
|
+
|---------|----------|
|
|
335
|
+
| Disabling submit button | Keep enabled, show errors on submit |
|
|
336
|
+
| Blur validation | Validate on submit only |
|
|
337
|
+
| Placeholder-only labels | Always use visible labels |
|
|
338
|
+
| Vague errors | Specific, actionable messages |
|
|
339
|
+
| No error summary | Add summary at top with links |
|
|
340
|
+
| Clearing form on error | Preserve all user input |
|
|
341
|
+
|
|
342
|
+
### Edge Cases
|
|
343
|
+
|
|
344
|
+
| Case | Handling |
|
|
345
|
+
|------|----------|
|
|
346
|
+
| Very long forms | Break into steps or sections |
|
|
347
|
+
| Conditional fields | Show/hide smoothly, don't lose data |
|
|
348
|
+
| File uploads | Show progress, handle failures |
|
|
349
|
+
| Unsaved changes | Warn before navigation |
|
|
350
|
+
| Session timeout | Save draft, prompt re-auth |
|
|
351
|
+
| Network failure | Queue submission, retry automatically |
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Related Documentation
|
|
356
|
+
|
|
357
|
+
- [Layout Primitives](../design/layouts.md) - Layout options
|
|
358
|
+
- [Technical Accessibility](../accessibility/technical.md) - Form validation pattern
|
|
359
|
+
- [Authentication Scenario](./authentication.md) - Login/registration forms
|