fluentui-design 0.1.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.
- package/CHANGELOG.md +50 -0
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/bin.d.ts +18 -0
- package/dist/bin.js +71 -0
- package/dist/bin.js.map +1 -0
- package/dist/skill/install-skill.d.ts +256 -0
- package/dist/skill/install-skill.js +546 -0
- package/dist/skill/install-skill.js.map +1 -0
- package/package.json +90 -0
- package/skills/fluentui-design/SKILL.md +184 -0
- package/skills/fluentui-design/references/checklists/accessibility-review.md +51 -0
- package/skills/fluentui-design/references/checklists/design-before-code.md +53 -0
- package/skills/fluentui-design/references/checklists/visual-review.md +45 -0
- package/skills/fluentui-design/references/foundation/accessibility.md +70 -0
- package/skills/fluentui-design/references/foundation/composition-and-state.md +92 -0
- package/skills/fluentui-design/references/foundation/responsive-and-localization.md +63 -0
- package/skills/fluentui-design/references/foundation/styling-and-tokens.md +71 -0
- package/skills/fluentui-design/references/index.md +42 -0
- package/skills/fluentui-design/references/maintenance/refresh-and-repin.md +68 -0
- package/skills/fluentui-design/references/patterns/PAT-001-application-shell.md +77 -0
- package/skills/fluentui-design/references/patterns/PAT-002-list-page.md +85 -0
- package/skills/fluentui-design/references/patterns/PAT-003-record-detail.md +74 -0
- package/skills/fluentui-design/references/patterns/PAT-004-form-page.md +78 -0
- package/skills/fluentui-design/references/patterns/PAT-005-contextual-edit.md +75 -0
- package/skills/fluentui-design/references/patterns/PAT-006-settings-page.md +78 -0
- package/skills/fluentui-design/references/patterns/PAT-007-multi-step-task.md +79 -0
- package/skills/fluentui-design/references/patterns/PAT-008-dashboard.md +78 -0
- package/skills/fluentui-design/references/rules/index.md +97 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Refresh and Re-Pin
|
|
2
|
+
|
|
3
|
+
The bundled rules and patterns are pinned to one reviewed baseline. When the
|
|
4
|
+
baseline moves, refresh deliberately instead of editing output by hand.
|
|
5
|
+
|
|
6
|
+
## When to refresh
|
|
7
|
+
|
|
8
|
+
- The project installs a `@fluentui/react-components` version other than the
|
|
9
|
+
baseline named in the entry point.
|
|
10
|
+
- A rule is disputed in review and needs stronger or newer evidence.
|
|
11
|
+
- A new source, such as a design guide or an accessibility standard, is added to
|
|
12
|
+
the reviewed collection.
|
|
13
|
+
|
|
14
|
+
## The procedure
|
|
15
|
+
|
|
16
|
+
1. **Refresh the sources.** Add or update the reviewed sources and their
|
|
17
|
+
coverage, then validate the evidence pipeline:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm run validate:sources
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Re-pin the API facts.** Regenerate the verified allowlist from the sibling
|
|
24
|
+
API-fact source:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
npm run extract-facts
|
|
28
|
+
npm run check:facts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
3. **Regenerate the indexes and the mirror.**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
npm run generate
|
|
35
|
+
npm run generate:check
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4. **Confirm the package.** Validate the rules, the actionability lint, and the
|
|
39
|
+
references:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
npm run validate:rules
|
|
43
|
+
npm run lint:rules
|
|
44
|
+
npm run check:refs
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
5. **Run the full gate** before publishing the change:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
npm run verify
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Rules for the refresh
|
|
54
|
+
|
|
55
|
+
- Never hand-edit a generated file. The generated marker says so, and the drift
|
|
56
|
+
gate detects any edit. Delete a stale generated file by regenerating, not by
|
|
57
|
+
deleting it by hand.
|
|
58
|
+
- Confirm a new export exists before a rule or pattern names it. An unverified
|
|
59
|
+
name is the most common cause of a failing reference gate.
|
|
60
|
+
- Update the baseline table in the entry point and the pinned commit together,
|
|
61
|
+
so a reader never sees a mismatch.
|
|
62
|
+
- Record why a rule changed; do not silently adjust a rule to match a newer
|
|
63
|
+
library.
|
|
64
|
+
|
|
65
|
+
## Related references
|
|
66
|
+
|
|
67
|
+
- [Reference index](../index.md) for the decision routes.
|
|
68
|
+
- [Rule index](../rules/index.md) for the rules grouped by area.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-001
|
|
3
|
+
title: Application shell
|
|
4
|
+
decisions: [command-scope, navigation-model]
|
|
5
|
+
rules: [RULE-001, RULE-002, RULE-003]
|
|
6
|
+
components: [FluentProvider, Nav, NavItem, NavCategory, NavCategoryItem, NavSubItem, NavDrawer, Breadcrumb, BreadcrumbItem, BreadcrumbButton, BreadcrumbDivider, Toolbar, ToolbarButton, Text, Title1]
|
|
7
|
+
derived: [application-owned app shell composition, application-owned route binding]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Application shell
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Move between the primary areas of the application and always know where they are, while the
|
|
15
|
+
current page keeps its own heading and commands.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it for any app with more than one destination. Do not add a shell to a single-screen tool, and
|
|
20
|
+
do not force a shell when the app is embedded inside a host that already owns navigation.
|
|
21
|
+
|
|
22
|
+
## Region order
|
|
23
|
+
|
|
24
|
+
1. Banner with product identity and global actions.
|
|
25
|
+
2. Primary navigation (Nav).
|
|
26
|
+
3. Breadcrumb for the current path.
|
|
27
|
+
4. Page heading and page commands.
|
|
28
|
+
5. Main content region.
|
|
29
|
+
|
|
30
|
+
## Component mapping
|
|
31
|
+
|
|
32
|
+
Verified exports supply the navigation and command primitives: FluentProvider, Nav and its item
|
|
33
|
+
parts, Breadcrumb, Toolbar, and text roles. The shell itself, the route binding, and the layout
|
|
34
|
+
grid are application-owned compositions, so they are never presented as v9 exports.
|
|
35
|
+
|
|
36
|
+
## Interaction flow
|
|
37
|
+
|
|
38
|
+
The router resolves a route, the shell marks the matching Nav item, the Breadcrumb renders the
|
|
39
|
+
path segments, and the routed view renders inside the main region. Clicking a navigation item asks
|
|
40
|
+
the application router to navigate; the component does not change the route on its own.
|
|
41
|
+
|
|
42
|
+
## State ownership
|
|
43
|
+
|
|
44
|
+
The application owns the route, the expanded navigation categories, and the narrow-width drawer
|
|
45
|
+
state. Nav selection is derived from the route rather than stored separately.
|
|
46
|
+
|
|
47
|
+
## Responsive behavior
|
|
48
|
+
|
|
49
|
+
At the project's narrow breakpoint the navigation column moves into a NavDrawer triggered from the
|
|
50
|
+
banner. The breakpoint is a project convention and must state what it changes at that width.
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
|
|
54
|
+
The shell provides the banner, navigation, and main landmarks. Exactly one main landmark exists,
|
|
55
|
+
the current destination is marked as current, and a skip link lets keyboard users reach the main
|
|
56
|
+
region directly.
|
|
57
|
+
|
|
58
|
+
## Edge cases
|
|
59
|
+
|
|
60
|
+
Loading a route shows a skeleton in the main region while the shell stays usable. An unauthorized
|
|
61
|
+
route renders an explanatory state in the main region without hiding the fact that navigation
|
|
62
|
+
exists. A deep link with unknown segments shows a not-found state inside the shell.
|
|
63
|
+
|
|
64
|
+
## Rules applied
|
|
65
|
+
|
|
66
|
+
RULE-001, RULE-002, RULE-003
|
|
67
|
+
|
|
68
|
+
## Derived decisions
|
|
69
|
+
|
|
70
|
+
The shell composition, the route binding, and the responsive collapse are application decisions.
|
|
71
|
+
Routing, authorization, and data fetching are not owned by Fluent and are named here as
|
|
72
|
+
application responsibilities.
|
|
73
|
+
|
|
74
|
+
## Tests
|
|
75
|
+
|
|
76
|
+
Fixture shell rendering test, landmark structure test, active-route marking test, and a narrow-width
|
|
77
|
+
drawer test.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-002
|
|
3
|
+
title: Searchable and filterable list page
|
|
4
|
+
decisions: [data-surface, data-processing-location, selection-scope, row-activation, data-resilience, virtualization]
|
|
5
|
+
rules: [RULE-010, RULE-011, RULE-012, RULE-016]
|
|
6
|
+
components: [DataGrid, DataGridBody, DataGridRow, DataGridCell, DataGridHeader, DataGridHeaderCell, DataGridSelectionCell, createTableColumn, Table, TableHeader, TableRow, TableCell, TableBody, TableCellLayout, Input, Button, MenuButton, Menu, MenuTrigger, MenuPopover, MenuList, MenuItem, Spinner, Skeleton, SkeletonItem, MessageBar, MessageBarBody, Checkbox, Field]
|
|
7
|
+
derived: [application-owned FilterBar composition, application-owned query and pagination state]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Searchable and filterable list page
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Find a set of records, narrow them down, act on one or on many, and understand what the current
|
|
15
|
+
result set contains.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it when the user works with a collection of similar records. Use a simple Table when the data is
|
|
20
|
+
static and needs no filtering, selection, or sorting. Do not use a grid when the task is really a
|
|
21
|
+
narrative detail view.
|
|
22
|
+
|
|
23
|
+
## Region order
|
|
24
|
+
|
|
25
|
+
1. Page heading and one primary action.
|
|
26
|
+
2. Filter and search controls.
|
|
27
|
+
3. Result count and, when server-paged, a pager.
|
|
28
|
+
4. The grid or table.
|
|
29
|
+
5. Bulk-action bar, shown only while rows are selected.
|
|
30
|
+
|
|
31
|
+
## Component mapping
|
|
32
|
+
|
|
33
|
+
DataGrid and its parts provide the controlled, keyboard-navigable surface; Table and its parts
|
|
34
|
+
provide native table semantics for simpler cases. Input, Menu, Button, Checkbox, Spinner, Skeleton,
|
|
35
|
+
and MessageBar are verified exports. The FilterBar, the query state, and the pager are
|
|
36
|
+
application-owned compositions.
|
|
37
|
+
|
|
38
|
+
## Interaction flow
|
|
39
|
+
|
|
40
|
+
Typing in search or changing a filter updates application query state. In server mode this issues a
|
|
41
|
+
request and shows a pending state in the grid region. Clicking a row opens the record when the row
|
|
42
|
+
is the activation target; when a cell contains its own action control, that control handles its own
|
|
43
|
+
click and does not also activate the row. Selecting rows reveals the bulk-action bar.
|
|
44
|
+
|
|
45
|
+
## State ownership
|
|
46
|
+
|
|
47
|
+
The application owns the query, page, sort, filter, and selected ids. Whether operations run locally
|
|
48
|
+
or on the server is explicit in application state, not inferred by the grid.
|
|
49
|
+
|
|
50
|
+
## Responsive behavior
|
|
51
|
+
|
|
52
|
+
Below the project's narrow breakpoint, low-priority columns are hidden behind a detail view and
|
|
53
|
+
filters collapse into a single control that opens a panel. The grid keeps vertical scrolling; it
|
|
54
|
+
never requires two-dimensional scrolling to read a value. Virtualize the grid only after measuring a
|
|
55
|
+
performance need, because virtualization keeps only the visible rows in the DOM and can break
|
|
56
|
+
in-page search and predictable focus movement.
|
|
57
|
+
|
|
58
|
+
## Accessibility
|
|
59
|
+
|
|
60
|
+
The grid uses one tab stop with arrow-key navigation inside it. Sort state is announced, selection
|
|
61
|
+
changes are announced, and an async result update is announced through a polite status region. The
|
|
62
|
+
select-all control states whether it selects the current page or all matching results.
|
|
63
|
+
|
|
64
|
+
## Edge cases
|
|
65
|
+
|
|
66
|
+
Loading shows Skeletons in the grid region. No data, no search matches, and a failed load each show a
|
|
67
|
+
distinct message; the failed state offers a retry action. A server-paged sort re-queries instead of
|
|
68
|
+
sorting only the loaded page. A selection that spans pages keeps its ids when the page changes. When
|
|
69
|
+
virtualization is enabled, keep a stable row key, expose the row's position and total count to
|
|
70
|
+
assistive technology, and ensure focus is not lost when the visible window moves.
|
|
71
|
+
|
|
72
|
+
## Rules applied
|
|
73
|
+
|
|
74
|
+
RULE-010, RULE-011, RULE-012, RULE-016
|
|
75
|
+
|
|
76
|
+
## Derived decisions
|
|
77
|
+
|
|
78
|
+
The FilterBar composition, the explicit local-versus-server choice, and the activation-versus-
|
|
79
|
+
selection split are application decisions. Data fetching, sorting, filtering, and pagination are
|
|
80
|
+
application responsibilities; the grid only renders and reports interaction.
|
|
81
|
+
|
|
82
|
+
## Tests
|
|
83
|
+
|
|
84
|
+
Fixture list rendering test, keyboard grid navigation test, sort-issues-request test, selection-scope
|
|
85
|
+
test, and the four-state (loading, empty, search-empty, error) test.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-003
|
|
3
|
+
title: Record detail page
|
|
4
|
+
decisions: [permission-state]
|
|
5
|
+
rules: [RULE-003, RULE-029]
|
|
6
|
+
components: [Card, CardHeader, CardFooter, TabList, Tab, Text, Title1, Subtitle1, Divider, Badge, MessageBar, MessageBarBody, Button, Link]
|
|
7
|
+
derived: [application-owned PageHeader composition, application-owned related-records loader]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Record detail page
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Understand one record at a glance, read its details, and reach the actions and related information
|
|
15
|
+
that belong to it.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it for a single addressable record with related data. Do not use it when the user needs to
|
|
20
|
+
compare many records, which is the list page's job.
|
|
21
|
+
|
|
22
|
+
## Region order
|
|
23
|
+
|
|
24
|
+
1. Page heading naming the record, with status and one primary action.
|
|
25
|
+
2. Summary cards for the most important facts.
|
|
26
|
+
3. Peer views (overview, related, history) as tabs.
|
|
27
|
+
4. Destructive or secondary actions, separated from the primary action.
|
|
28
|
+
|
|
29
|
+
## Component mapping
|
|
30
|
+
|
|
31
|
+
Card and its parts, TabList and Tab, Badge, Divider, Button, Link, and text roles are verified
|
|
32
|
+
exports. The PageHeader grouping and the related-records loader are application-owned compositions.
|
|
33
|
+
Routing, authorization, and fetching are application responsibilities.
|
|
34
|
+
|
|
35
|
+
## Interaction flow
|
|
36
|
+
|
|
37
|
+
The route identifies the record; the application loads it and renders the heading. Switching a tab
|
|
38
|
+
changes only the tab region. A read-only viewer sees the same structure with action controls omitted
|
|
39
|
+
and a visible explanation of the restricted state, rather than an empty page.
|
|
40
|
+
|
|
41
|
+
## State ownership
|
|
42
|
+
|
|
43
|
+
The application owns the loaded record, the selected tab, and the permission result. Card and tab
|
|
44
|
+
components hold only presentational state such as hover or the selected tab index.
|
|
45
|
+
|
|
46
|
+
## Responsive behavior
|
|
47
|
+
|
|
48
|
+
Summary cards stack to one column below the project's narrow breakpoint. Tabs overflow into a menu
|
|
49
|
+
rather than scrolling out of reach. Related tables inside a tab follow the list page rules.
|
|
50
|
+
|
|
51
|
+
## Accessibility
|
|
52
|
+
|
|
53
|
+
The record name is the single top-level heading. Tabs follow the tablist keyboard model with the
|
|
54
|
+
selected tab associated with its panel. A restricted or read-only state is announced and explained
|
|
55
|
+
in text, and the current status is not conveyed by color alone.
|
|
56
|
+
|
|
57
|
+
## Edge cases
|
|
58
|
+
|
|
59
|
+
A missing record renders a not-found state with a path back to the list. A record the user may not
|
|
60
|
+
view shows a permission explanation without revealing whether hidden fields exist. A partially
|
|
61
|
+
failed related-data load shows an inline error in that tab only.
|
|
62
|
+
|
|
63
|
+
## Rules applied
|
|
64
|
+
|
|
65
|
+
RULE-003, RULE-029
|
|
66
|
+
|
|
67
|
+
## Derived decisions
|
|
68
|
+
|
|
69
|
+
The PageHeader composition and the choice of tabs for peer views are application decisions.
|
|
70
|
+
Authorization and related-data fetching are named here as application responsibilities.
|
|
71
|
+
|
|
72
|
+
## Tests
|
|
73
|
+
|
|
74
|
+
Fixture detail rendering test, tab keyboard test, read-only-state test, and a missing-record test.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-004
|
|
3
|
+
title: Create and edit form page
|
|
4
|
+
decisions: [form-layout, field-annotation, submit-feedback]
|
|
5
|
+
rules: [RULE-005, RULE-006, RULE-007, RULE-029, RULE-030]
|
|
6
|
+
components: [Field, Input, Textarea, Select, Combobox, Dropdown, Option, Checkbox, Radio, RadioGroup, Switch, Slider, Label, Button, MessageBar, MessageBarBody, Spinner]
|
|
7
|
+
derived: [application-owned FormSection grouping, application-owned validation schema]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Create and edit form page
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Enter or change a set of related values, understand any problems with them, and submit the result
|
|
15
|
+
with confidence.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it when the task is to create or edit a defined object with several fields. Do not use a full
|
|
20
|
+
page for editing one or two fields in the context of a list; use the contextual-edit pattern.
|
|
21
|
+
|
|
22
|
+
## Region order
|
|
23
|
+
|
|
24
|
+
1. Page heading naming the object, with one primary submit action.
|
|
25
|
+
2. Grouped field sections, each introduced by a heading.
|
|
26
|
+
3. Submission feedback near the action.
|
|
27
|
+
4. Cancel, kept visually secondary.
|
|
28
|
+
|
|
29
|
+
## Component mapping
|
|
30
|
+
|
|
31
|
+
Field, Input, Textarea, Select, Combobox, Dropdown, Option, Checkbox, Radio, RadioGroup, Switch,
|
|
32
|
+
Slider, Label, Button, MessageBar, and Spinner are verified exports. The FormSection grouping and
|
|
33
|
+
the validation schema are application-owned. Validation, persistence, and authorization are
|
|
34
|
+
application responsibilities.
|
|
35
|
+
|
|
36
|
+
## Interaction flow
|
|
37
|
+
|
|
38
|
+
The user moves through fields in one reading order. A field reports its error after blur or on
|
|
39
|
+
submit, never before it has been touched. On submit the action becomes disabled and shows a pending
|
|
40
|
+
state. Success navigates to the saved record; failure keeps the entered values and shows an error
|
|
41
|
+
summary near the action plus field-level messages.
|
|
42
|
+
|
|
43
|
+
## State ownership
|
|
44
|
+
|
|
45
|
+
The application owns the draft value, touched and dirty state, the validation result, and the
|
|
46
|
+
submission status. Field components render the value and message they are given.
|
|
47
|
+
|
|
48
|
+
## Responsive behavior
|
|
49
|
+
|
|
50
|
+
The form is single-column by default and survives narrow widths without changing reading order.
|
|
51
|
+
Short related pairs may share a row above the project's narrow breakpoint only.
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
|
|
55
|
+
Every control has a programmatic label and, where needed, help text tied to the control. The error
|
|
56
|
+
summary is announced on submit, and focus moves to the summary or the first invalid field. The
|
|
57
|
+
pending submit action keeps an accessible name.
|
|
58
|
+
|
|
59
|
+
## Edge cases
|
|
60
|
+
|
|
61
|
+
Server-side validation errors map onto their fields and are also summarized. A duplicate submission
|
|
62
|
+
is prevented while a request is pending. Leaving the page with unsaved changes triggers a
|
|
63
|
+
confirmation. A field whose value arrives after load shows a pending state rather than an empty
|
|
64
|
+
value.
|
|
65
|
+
|
|
66
|
+
## Rules applied
|
|
67
|
+
|
|
68
|
+
RULE-005, RULE-006, RULE-007, RULE-029, RULE-030
|
|
69
|
+
|
|
70
|
+
## Derived decisions
|
|
71
|
+
|
|
72
|
+
The FormSection grouping, the single-column default, and the blur-first validation timing are
|
|
73
|
+
application decisions. Server-side validation is mandatory; client-side validation is advisory only.
|
|
74
|
+
|
|
75
|
+
## Tests
|
|
76
|
+
|
|
77
|
+
Fixture form rendering test, no-early-error test, duplicate-submit test, server-error mapping test,
|
|
78
|
+
and an unsaved-change guard test.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-005
|
|
3
|
+
title: Short contextual edit in a drawer or focused dialog
|
|
4
|
+
decisions: [edit-surface, modal-behavior]
|
|
5
|
+
rules: [RULE-008, RULE-009, RULE-029]
|
|
6
|
+
components: [Drawer, DrawerBody, DrawerHeader, DrawerHeaderTitle, DrawerFooter, Dialog, DialogTrigger, DialogSurface, DialogBody, DialogTitle, DialogContent, DialogActions, Button, Field, Input]
|
|
7
|
+
derived: [application-owned edit-surface selector, application-owned dirty-state guard]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Short contextual edit in a drawer or focused dialog
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Change a small amount of information without leaving the page they are working on.
|
|
15
|
+
|
|
16
|
+
## When to use / when not
|
|
17
|
+
|
|
18
|
+
Use a dialog for a short, bounded decision or a two-field edit that benefits from full attention.
|
|
19
|
+
Use a drawer for a slightly larger contextual edit that should keep the underlying list or record
|
|
20
|
+
visible. Do not use either for a long multi-section form; that belongs on the form page.
|
|
21
|
+
|
|
22
|
+
## Region order
|
|
23
|
+
|
|
24
|
+
1. Surface title naming the object being edited.
|
|
25
|
+
2. Editable fields.
|
|
26
|
+
3. Primary save action and a secondary cancel action.
|
|
27
|
+
4. Confirmation when the surface closes with unsaved changes.
|
|
28
|
+
|
|
29
|
+
## Component mapping
|
|
30
|
+
|
|
31
|
+
Drawer and its parts, Dialog and its parts, Button, Field, and Input are verified exports. The rule
|
|
32
|
+
that selects between drawer and dialog, the dirty-state guard, and the save call are application-
|
|
33
|
+
owned. Fetching the edited record and persisting the change are application responsibilities.
|
|
34
|
+
|
|
35
|
+
## Interaction flow
|
|
36
|
+
|
|
37
|
+
A trigger control opens the surface with the current values. The user edits fields; the primary
|
|
38
|
+
action saves and closes on success. Attempting to dismiss with unsaved changes opens a confirmation
|
|
39
|
+
with Keep editing and Discard. On close, focus returns to the control that opened the surface.
|
|
40
|
+
|
|
41
|
+
## State ownership
|
|
42
|
+
|
|
43
|
+
The application owns open state, the draft value, dirty state, and the pending save. The surface
|
|
44
|
+
owns only local presentation such as open animation.
|
|
45
|
+
|
|
46
|
+
## Responsive behavior
|
|
47
|
+
|
|
48
|
+
At the project's narrow breakpoint a drawer may occupy the full width and a dialog fits the viewport
|
|
49
|
+
with scrolling content. Neither may push its action buttons out of reach.
|
|
50
|
+
|
|
51
|
+
## Accessibility
|
|
52
|
+
|
|
53
|
+
Each surface has a title, traps focus while open, and returns focus to its trigger on close. The
|
|
54
|
+
confirmation is itself a dialog with a title. Escape closes the surface only when the dismissal will
|
|
55
|
+
not silently lose work.
|
|
56
|
+
|
|
57
|
+
## Edge cases
|
|
58
|
+
|
|
59
|
+
A save failure keeps the surface open, preserves the draft, and shows the error inside the surface.
|
|
60
|
+
A record deleted in another session is reported on save rather than overwriting. A very small
|
|
61
|
+
viewport keeps the primary action reachable and the content scrollable.
|
|
62
|
+
|
|
63
|
+
## Rules applied
|
|
64
|
+
|
|
65
|
+
RULE-008, RULE-009, RULE-029
|
|
66
|
+
|
|
67
|
+
## Derived decisions
|
|
68
|
+
|
|
69
|
+
The drawer-versus-dialog choice and the dirty-state guard are application decisions. Persistence and
|
|
70
|
+
fetching are application responsibilities. Server-side validation is mandatory; client-side
|
|
71
|
+
validation is advisory only.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
Fixture drawer open/close test, return-focus test, dirty-guard test, and a save-failure test.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-006
|
|
3
|
+
title: Settings page with optional advanced sections
|
|
4
|
+
decisions: [progressive-disclosure, navigation-model]
|
|
5
|
+
rules: [RULE-013, RULE-014]
|
|
6
|
+
components: [Accordion, AccordionItem, AccordionHeader, AccordionPanel, Switch, RadioGroup, Radio, Select, Dropdown, Option, Button, Field, TabList, Tab]
|
|
7
|
+
derived: [application-owned settings model, application-owned persistence adapter]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Settings page with optional advanced sections
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Review and change configuration for a product or a record, where most values are simple and a few
|
|
15
|
+
are advanced.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it when settings fall into a few peer groups with occasional advanced options. Do not hide
|
|
20
|
+
required values inside collapsed sections, and do not use this pattern for an ordered setup task,
|
|
21
|
+
which is the multi-step pattern.
|
|
22
|
+
|
|
23
|
+
## Region order
|
|
24
|
+
|
|
25
|
+
1. Page heading naming the scope of the settings.
|
|
26
|
+
2. Either peer tabs or a single scrolling page of sections.
|
|
27
|
+
3. Simple settings first.
|
|
28
|
+
4. Advanced sections, collapsed by default.
|
|
29
|
+
5. Save or apply action.
|
|
30
|
+
|
|
31
|
+
## Component mapping
|
|
32
|
+
|
|
33
|
+
Accordion and its parts, Switch, RadioGroup and Radio, Select, Dropdown, Option, TabList, Tab, Button,
|
|
34
|
+
and Field are verified exports. The settings model and the persistence adapter are application-owned.
|
|
35
|
+
Loading and saving settings are application responsibilities.
|
|
36
|
+
|
|
37
|
+
## Interaction flow
|
|
38
|
+
|
|
39
|
+
The user changes a value and either saves explicitly or receives an immediate effect, depending on
|
|
40
|
+
the setting. Advanced sections expand on demand. A validation error inside a collapsed section
|
|
41
|
+
expands that section and moves focus to the field so the error is never hidden.
|
|
42
|
+
|
|
43
|
+
## State ownership
|
|
44
|
+
|
|
45
|
+
The application owns the settings model, which values are dirty, and whether a save is pending. The
|
|
46
|
+
accordion owns only which sections are expanded.
|
|
47
|
+
|
|
48
|
+
## Responsive behavior
|
|
49
|
+
|
|
50
|
+
Advanced sections behave the same at every width. Where tabs are used, overflow tabs move into a menu
|
|
51
|
+
at narrow widths rather than scrolling away.
|
|
52
|
+
|
|
53
|
+
## Accessibility
|
|
54
|
+
|
|
55
|
+
Accordion headers expose their expanded state and are operable by keyboard. Dependent values are
|
|
56
|
+
grouped so their relationship is announced. No required setting is reachable only through a
|
|
57
|
+
collapsed region.
|
|
58
|
+
|
|
59
|
+
## Edge cases
|
|
60
|
+
|
|
61
|
+
A settings load failure shows an error with retry rather than rendering empty controls. A save
|
|
62
|
+
failure keeps the edited values and reports the problem. A permission-restricted section is shown
|
|
63
|
+
with an explanation rather than silently omitted.
|
|
64
|
+
|
|
65
|
+
## Rules applied
|
|
66
|
+
|
|
67
|
+
RULE-013, RULE-014
|
|
68
|
+
|
|
69
|
+
## Derived decisions
|
|
70
|
+
|
|
71
|
+
Whether a setting applies immediately or on save, and how advanced sections are grouped, are
|
|
72
|
+
application decisions. Persistence is an application responsibility. Server-side validation is
|
|
73
|
+
mandatory; client-side validation is advisory only.
|
|
74
|
+
|
|
75
|
+
## Tests
|
|
76
|
+
|
|
77
|
+
Fixture settings rendering test, collapsed-validation-error test, and a tabs-or-sections keyboard
|
|
78
|
+
test.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: PAT-007
|
|
3
|
+
title: Multi-step task with review and preserved state
|
|
4
|
+
decisions: [save-model, submit-feedback]
|
|
5
|
+
rules: [RULE-029, RULE-030]
|
|
6
|
+
components: [Button, Field, Input, Textarea, Dialog, DialogTrigger, DialogSurface, DialogBody, DialogTitle, DialogContent, DialogActions, MessageBar, MessageBarBody, Spinner, Divider]
|
|
7
|
+
derived: [application-owned step machine, application-owned draft persistence]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Multi-step task with review and preserved state
|
|
11
|
+
|
|
12
|
+
## User task
|
|
13
|
+
|
|
14
|
+
Complete a task that spans several steps, be able to go back, and submit the whole result once at
|
|
15
|
+
the end.
|
|
16
|
+
|
|
17
|
+
## When to use / when not
|
|
18
|
+
|
|
19
|
+
Use it when a task is genuinely ordered and too large for one screen, such as onboarding or a
|
|
20
|
+
guided setup. Do not split a short form into steps, and do not use this pattern when the steps are
|
|
21
|
+
independent, which the settings pattern covers.
|
|
22
|
+
|
|
23
|
+
## Region order
|
|
24
|
+
|
|
25
|
+
1. Step indicator showing position and total.
|
|
26
|
+
2. Current step heading and fields.
|
|
27
|
+
3. Back and Continue actions, with the primary action last.
|
|
28
|
+
4. A review step summarizing all entered values.
|
|
29
|
+
5. Final submit action.
|
|
30
|
+
|
|
31
|
+
## Component mapping
|
|
32
|
+
|
|
33
|
+
Button, Field, Input, Textarea, Dialog and its parts, MessageBar, MessageBarBody, Spinner, and
|
|
34
|
+
Divider are verified exports. The step machine, the draft persistence, and the review summary are
|
|
35
|
+
application-owned. Persistence and the final submit are application responsibilities.
|
|
36
|
+
|
|
37
|
+
## Interaction flow
|
|
38
|
+
|
|
39
|
+
Moving forward validates only the current step. Moving back preserves entered values without
|
|
40
|
+
revalidating. The review step lets the user jump back to a step by name. Final submit disables its
|
|
41
|
+
action, shows a pending state, and prevents a duplicate submission.
|
|
42
|
+
|
|
43
|
+
## State ownership
|
|
44
|
+
|
|
45
|
+
The application owns the step index, the accumulated draft, per-step validation, and the final
|
|
46
|
+
submission status. The draft must survive back navigation and, where the product requires it, a
|
|
47
|
+
reload.
|
|
48
|
+
|
|
49
|
+
## Responsive behavior
|
|
50
|
+
|
|
51
|
+
The step indicator becomes compact at narrow widths but still shows position and total. Actions wrap
|
|
52
|
+
to a stable row rather than scrolling off screen.
|
|
53
|
+
|
|
54
|
+
## Accessibility
|
|
55
|
+
|
|
56
|
+
The current step is announced when it changes and focus moves to the step heading. The step
|
|
57
|
+
indicator is not the only way to learn position; the heading states it in text. Submit progress is
|
|
58
|
+
announced without moving focus.
|
|
59
|
+
|
|
60
|
+
## Edge cases
|
|
61
|
+
|
|
62
|
+
Leaving the task with unsaved progress triggers a confirmation. A failed step validation keeps the
|
|
63
|
+
user on that step with field messages. A submit failure keeps all steps intact and offers retry.
|
|
64
|
+
Refreshing mid-task restores the draft when persistence is enabled.
|
|
65
|
+
|
|
66
|
+
## Rules applied
|
|
67
|
+
|
|
68
|
+
RULE-029, RULE-030
|
|
69
|
+
|
|
70
|
+
## Derived decisions
|
|
71
|
+
|
|
72
|
+
The step machine, the choice to validate per step, and the decision to persist a draft are
|
|
73
|
+
application decisions. Persistence and authorization are application responsibilities. Server-side
|
|
74
|
+
validation is mandatory; client-side validation is advisory only.
|
|
75
|
+
|
|
76
|
+
## Tests
|
|
77
|
+
|
|
78
|
+
Fixture step navigation test, back-preserves-values test, duplicate-submit test, and a review-jump
|
|
79
|
+
test.
|