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.
Files changed (29) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +21 -0
  3. package/README.md +129 -0
  4. package/dist/bin.d.ts +18 -0
  5. package/dist/bin.js +71 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/skill/install-skill.d.ts +256 -0
  8. package/dist/skill/install-skill.js +546 -0
  9. package/dist/skill/install-skill.js.map +1 -0
  10. package/package.json +90 -0
  11. package/skills/fluentui-design/SKILL.md +184 -0
  12. package/skills/fluentui-design/references/checklists/accessibility-review.md +51 -0
  13. package/skills/fluentui-design/references/checklists/design-before-code.md +53 -0
  14. package/skills/fluentui-design/references/checklists/visual-review.md +45 -0
  15. package/skills/fluentui-design/references/foundation/accessibility.md +70 -0
  16. package/skills/fluentui-design/references/foundation/composition-and-state.md +92 -0
  17. package/skills/fluentui-design/references/foundation/responsive-and-localization.md +63 -0
  18. package/skills/fluentui-design/references/foundation/styling-and-tokens.md +71 -0
  19. package/skills/fluentui-design/references/index.md +42 -0
  20. package/skills/fluentui-design/references/maintenance/refresh-and-repin.md +68 -0
  21. package/skills/fluentui-design/references/patterns/PAT-001-application-shell.md +77 -0
  22. package/skills/fluentui-design/references/patterns/PAT-002-list-page.md +85 -0
  23. package/skills/fluentui-design/references/patterns/PAT-003-record-detail.md +74 -0
  24. package/skills/fluentui-design/references/patterns/PAT-004-form-page.md +78 -0
  25. package/skills/fluentui-design/references/patterns/PAT-005-contextual-edit.md +75 -0
  26. package/skills/fluentui-design/references/patterns/PAT-006-settings-page.md +78 -0
  27. package/skills/fluentui-design/references/patterns/PAT-007-multi-step-task.md +79 -0
  28. package/skills/fluentui-design/references/patterns/PAT-008-dashboard.md +78 -0
  29. package/skills/fluentui-design/references/rules/index.md +97 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ id: PAT-008
3
+ title: Dashboard whose content reflects actual tasks and data
4
+ decisions: [feedback-channel, data-resilience, permission-state]
5
+ rules: [RULE-003, RULE-015, RULE-016]
6
+ components: [Card, CardHeader, CardFooter, Text, Title1, Subtitle1, MessageBar, MessageBarBody, Spinner, Skeleton, SkeletonItem, Badge, Button, ProgressBar]
7
+ derived: [application-owned dashboard composition, application-owned data aggregation]
8
+ ---
9
+
10
+ # Dashboard whose content reflects actual tasks and data
11
+
12
+ ## User task
13
+
14
+ See the state of the things they care about and decide what to do next.
15
+
16
+ ## When to use / when not
17
+
18
+ Use it when several small summaries help the user choose a next action. Do not use a dashboard as
19
+ decoration; every tile must reflect real data and lead somewhere or state a status. Do not use it
20
+ when the user only needs one focused task.
21
+
22
+ ## Region order
23
+
24
+ 1. Page heading naming the scope, such as the current team or workspace.
25
+ 2. A durable status message when something needs attention.
26
+ 3. Summary tiles, ordered by importance.
27
+ 4. A recent-activity or task list.
28
+ 5. A persistent link to the full list behind each tile.
29
+
30
+ ## Component mapping
31
+
32
+ Card and its parts, Badge, ProgressBar, Button, MessageBar, MessageBarBody, Spinner, Skeleton,
33
+ SkeletonItem, and text roles are verified exports. The dashboard composition, the tile ordering, and
34
+ the data aggregation are application-owned. Fetching and authorization are application
35
+ responsibilities.
36
+
37
+ ## Interaction flow
38
+
39
+ Each tile loads its own data and shows a skeleton until it settles. A tile that fails shows an inline
40
+ error with retry and does not blank the whole dashboard. Selecting a tile navigates to the relevant
41
+ filtered list. A transient confirmation uses a toast; a condition the user must re-read uses a
42
+ MessageBar that persists.
43
+
44
+ ## State ownership
45
+
46
+ The application owns each tile's data, loading, and error state, plus the permission scope of the
47
+ page. Tiles hold no shared state with one another so one failure stays local.
48
+
49
+ ## Responsive behavior
50
+
51
+ Tiles stack to one column below the project's narrow breakpoint. Tile content keeps its explanation
52
+ and action; it never truncates a status into an unlabeled badge.
53
+
54
+ ## Accessibility
55
+
56
+ Each tile has a heading so it appears in the document outline. Status conveyed by color is paired with
57
+ text. Loading and error states are announced, and the dashboard provides a logical heading order from
58
+ the page heading down to tile headings.
59
+
60
+ ## Edge cases
61
+
62
+ A permission-restricted dashboard shows an explanatory state instead of empty tiles. A tile with no
63
+ data shows a distinct empty state, not a zero value that looks like real data. A slow tile does not
64
+ block the others, and a stale tile shows when it was last updated.
65
+
66
+ ## Rules applied
67
+
68
+ RULE-003, RULE-015, RULE-016
69
+
70
+ ## Derived decisions
71
+
72
+ The tile set, the importance ordering, and per-tile loading are application decisions. Data fetching
73
+ and authorization are application responsibilities.
74
+
75
+ ## Tests
76
+
77
+ Fixture dashboard rendering test, per-tile loading and error tests, heading-order test, and a
78
+ permission-state test.
@@ -0,0 +1,97 @@
1
+ <!-- GENERATED FILE — DO NOT EDIT; source: rules/rules.json -->
2
+
3
+ # Rule Index
4
+
5
+ Rules grouped by decision area. Each rule is operational: it states what to do,
6
+ when it applies, and where its evidence comes from. Full provenance lives in
7
+ `rules/rules.json`.
8
+
9
+ ## app-shell
10
+
11
+ | Rule | Strength | Instruction |
12
+ | --- | --- | --- |
13
+ | RULE-001 | should | Compose the whole application inside a FluentProvider and build the shell navigation yourself from Nav, Toolbar, and layout primitives, because v9 exports no shell component. |
14
+ | RULE-002 | should | Render the primary destinations with Nav and its item parts, and render the current position with Breadcrumb, because routing itself stays application-owned. |
15
+
16
+ ## page-chrome
17
+
18
+ | Rule | Strength | Instruction |
19
+ | --- | --- | --- |
20
+ | RULE-003 | must | Place a single top-level heading that names the screen's task at the start of the content region, and use lower heading levels only for structure beneath it. |
21
+ | RULE-004 | should | Reserve one visually primary action for the screen and place additional page commands in a Toolbar, moving overflow actions into a menu. |
22
+
23
+ ## composition
24
+
25
+ | Rule | Strength | Instruction |
26
+ | --- | --- | --- |
27
+ | RULE-026 | must | Wrap the application in a single FluentProvider that sets the theme and text direction, and let nested providers be exceptions rather than the rule. |
28
+ | RULE-027 | must | Own routing, data fetching, authorization, and persistence in application code, and use Fluent components only for presentation and local interaction state. |
29
+ | RULE-028 | should | Style Fluent components with makeStyles and compose their public slots, rather than depending on internal class names or undocumented DOM structure. |
30
+
31
+ ## task-flows
32
+
33
+ | Rule | Strength | Instruction |
34
+ | --- | --- | --- |
35
+ | RULE-029 | must | Track dirty state and confirm before discarding unsaved changes when the user closes, navigates away from, or switches context in the editor. |
36
+ | RULE-030 | must | Disable the submit action while a request is pending, show progress in place, and re-enable the action when the request settles. |
37
+
38
+ ## forms
39
+
40
+ | Rule | Strength | Instruction |
41
+ | --- | --- | --- |
42
+ | RULE-005 | must | Wrap each control in a Field that provides a visible label, and place help or error text through the Field's message slot rather than beside it. |
43
+ | RULE-006 | should | Show a field error after the user leaves the field or submits the form, and never before the user has entered a value, so the form does not scold an untouched field. |
44
+ | RULE-007 | should | Lay fields out in one column by default and group related fields under a shared heading, because a single reading path is easier to follow and to complete. |
45
+
46
+ ## data-grid
47
+
48
+ | Rule | Strength | Instruction |
49
+ | --- | --- | --- |
50
+ | RULE-010 | should | Use DataGrid when the layout must be controlled by column definitions and keyboard grid behavior is required, and use Table when a native table structure is the goal. |
51
+ | RULE-011 | should | Decide explicitly whether each collection operation runs on loaded rows or on the server, and pass the resulting state into the grid so the component does not imply a data source it does not have. |
52
+ | RULE-012 | must | Make the selection scope explicit to the user, and when a bulk action can apply to all matching results rather than only the loaded page, offer that choice deliberately. |
53
+
54
+ ## overlays
55
+
56
+ | Rule | Strength | Instruction |
57
+ | --- | --- | --- |
58
+ | RULE-008 | should | Place a short, self-contained decision in a Dialog with a title and explicit action buttons, so the interaction stays bounded and easy to dismiss. |
59
+ | RULE-009 | should | Use a Drawer for a contextual edit that keeps the underlying context visible, and confirm before discarding unsaved changes when the drawer closes. |
60
+
61
+ ## disclosure
62
+
63
+ | Rule | Strength | Instruction |
64
+ | --- | --- | --- |
65
+ | RULE-013 | must | Keep fields that the task requires visible or clearly summarized, and reserve collapsed sections for genuinely optional or advanced content. |
66
+ | RULE-014 | should | Use TabList to switch between peer views of the same record, and keep sequential task steps out of tabs so users are not misled about order. |
67
+
68
+ ## feedback
69
+
70
+ | Rule | Strength | Instruction |
71
+ | --- | --- | --- |
72
+ | RULE-015 | should | Place conditions the user must be able to read later in a MessageBar, and place short-lived confirmations in a Toast, because the two differ in persistence and urgency. |
73
+ | RULE-016 | must | Provide a distinct state for loading, for genuinely empty data, for an empty search result, and for a failed load, so the user can tell the difference and knows what to do next. |
74
+
75
+ ## responsive
76
+
77
+ | Rule | Strength | Instruction |
78
+ | --- | --- | --- |
79
+ | RULE-023 | must | Let content reflow into a single column and scroll vertically so nothing is lost, rather than clipping or forcing two-dimensional scrolling. |
80
+ | RULE-024 | should | Express margins, padding, and alignment with logical properties and set the provider direction, so the layout mirrors without a separate stylesheet. |
81
+ | RULE-025 | should | Let long values wrap where space allows and truncate with an accessible full value where it does not, so hidden text stays available. |
82
+
83
+ ## accessibility
84
+
85
+ | Rule | Strength | Instruction |
86
+ | --- | --- | --- |
87
+ | RULE-020 | must | Preserve a visible focus indicator on every interactive element and ensure sticky or overlaying regions never cover the focused control. |
88
+ | RULE-021 | must | Give composite widgets a single tab stop and arrow-key movement within it, and ensure nested action controls are reachable without conflicting with row activation. |
89
+ | RULE-022 | must | Give every meaningful icon or color-coded control a programmatic name and an instruction where needed, and hide purely decorative icons from assistive technology. |
90
+
91
+ ## theming
92
+
93
+ | Rule | Strength | Instruction |
94
+ | --- | --- | --- |
95
+ | RULE-017 | must | Reference Fluent tokens through makeStyles instead of hard-coding colors, spacing, or font values, so a theme change flows through the whole app. |
96
+ | RULE-018 | should | Assign text a role from the Fluent type ramp and let the role determine size, weight, and line height, rather than setting font sizes per screen. |
97
+ | RULE-019 | must | Honor the user's reduced-motion preference and keep transitions short and purposeful, because motion that cannot be suppressed can cause discomfort. |