@flood-md/agent 0.2.10 → 0.2.11

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 (133) hide show
  1. package/DESIGN.md +8 -5
  2. package/README.md +1 -1
  3. package/SKILL.md +11 -0
  4. package/dist/catalog.json +1875 -295
  5. package/dist/materials/component-app-shell.md +47 -0
  6. package/dist/materials/component-app-top-bar.md +36 -0
  7. package/dist/materials/component-autocomplete.md +54 -0
  8. package/dist/materials/component-bulk-action-bar.md +52 -0
  9. package/dist/materials/component-button.md +1 -0
  10. package/dist/materials/component-card.md +2 -2
  11. package/dist/materials/component-collapsible.md +1 -0
  12. package/dist/materials/component-collection-toolbar.md +68 -0
  13. package/dist/materials/component-collection-view-switcher.md +49 -0
  14. package/dist/materials/component-combobox.md +10 -0
  15. package/dist/materials/component-command-palette.md +53 -0
  16. package/dist/materials/component-copy-button.md +1 -0
  17. package/dist/materials/component-data-table.md +14 -2
  18. package/dist/materials/component-date-picker.md +1 -0
  19. package/dist/materials/component-date-range-picker.md +1 -0
  20. package/dist/materials/component-date-time-picker.md +2 -0
  21. package/dist/materials/component-date-time-range-picker.md +4 -0
  22. package/dist/materials/component-drawer.md +1 -0
  23. package/dist/materials/component-figure.md +1 -1
  24. package/dist/materials/component-filter-condition.md +53 -0
  25. package/dist/materials/component-filter-group.md +55 -0
  26. package/dist/materials/component-icon-button.md +2 -0
  27. package/dist/materials/component-menubar.md +41 -0
  28. package/dist/materials/component-multi-select.md +10 -0
  29. package/dist/materials/component-navigation-group.md +51 -0
  30. package/dist/materials/component-navigation-item.md +59 -0
  31. package/dist/materials/component-navigation-tree.md +8 -0
  32. package/dist/materials/component-overflow-actions.md +47 -0
  33. package/dist/materials/component-page-header.md +40 -0
  34. package/dist/materials/component-popover.md +2 -1
  35. package/dist/materials/component-radio-card.md +2 -2
  36. package/dist/materials/component-segmented-control.md +6 -4
  37. package/dist/materials/component-sidebar.md +64 -0
  38. package/dist/materials/component-tabs.md +2 -0
  39. package/dist/materials/component-text.md +2 -2
  40. package/dist/materials/component-toggle.md +1 -0
  41. package/dist/materials/component-toolbar.md +4 -0
  42. package/dist/materials/component-tooltip.md +1 -1
  43. package/dist/materials/guide-agent-knowledge.md +13 -6
  44. package/dist/materials/guide-agents.md +8 -1
  45. package/dist/materials/guide-foundations.md +45 -2
  46. package/dist/materials/guide-installation.md +6 -6
  47. package/dist/materials/guide-interface-content.md +1 -1
  48. package/dist/materials/guide-introduction.md +4 -2
  49. package/dist/materials/guide-layout.md +39 -10
  50. package/dist/materials/guide-motion.md +69 -0
  51. package/dist/materials/guide-skills.md +9 -0
  52. package/dist/materials/recipe-collection-views.md +648 -0
  53. package/dist/materials/recipe-command-palette.md +31 -52
  54. package/dist/materials/recipe-filter-bar.md +12 -3
  55. package/dist/materials/recipe-grouped-form.md +5 -0
  56. package/dist/materials/recipe-navigation-workspace.md +222 -0
  57. package/dist/materials/recipe-record-management.md +296 -0
  58. package/dist/materials/recipe-record-workspace.md +207 -0
  59. package/dist/materials/recipe-settings-workspace.md +232 -0
  60. package/dist/materials/token-sys.color.context.base.action-disabled.json +41 -0
  61. package/dist/materials/token-sys.color.context.base.action-hover.json +41 -0
  62. package/dist/materials/token-sys.color.context.base.action-pressed.json +41 -0
  63. package/dist/materials/token-sys.color.context.base.action-rest.json +41 -0
  64. package/dist/materials/token-sys.color.context.base.avatar-background.json +41 -0
  65. package/dist/materials/token-sys.color.context.base.border-decorative.json +41 -0
  66. package/dist/materials/token-sys.color.context.base.divider-decorative.json +41 -0
  67. package/dist/materials/token-sys.color.context.base.field-background.json +41 -0
  68. package/dist/materials/token-sys.color.context.base.field-border.json +41 -0
  69. package/dist/materials/token-sys.color.context.base.field-disabled.json +41 -0
  70. package/dist/materials/token-sys.color.context.base.field-readonly.json +41 -0
  71. package/dist/materials/token-sys.color.context.base.indicator-track.json +41 -0
  72. package/dist/materials/token-sys.color.context.base.loading-placeholder.json +41 -0
  73. package/dist/materials/token-sys.color.context.base.muted-background.json +41 -0
  74. package/dist/materials/token-sys.color.context.base.on-surface-action-disabled.json +41 -0
  75. package/dist/materials/token-sys.color.context.base.on-surface-action-hover.json +41 -0
  76. package/dist/materials/token-sys.color.context.base.on-surface-action-pressed.json +41 -0
  77. package/dist/materials/token-sys.color.context.base.on-surface-action-rest.json +41 -0
  78. package/dist/materials/token-sys.color.context.base.selection-background.json +41 -0
  79. package/dist/materials/token-sys.color.context.base.supporting-background.json +41 -0
  80. package/dist/materials/token-sys.color.context.filled.action-disabled.json +41 -0
  81. package/dist/materials/token-sys.color.context.filled.action-hover.json +41 -0
  82. package/dist/materials/token-sys.color.context.filled.action-pressed.json +41 -0
  83. package/dist/materials/token-sys.color.context.filled.action-rest.json +41 -0
  84. package/dist/materials/token-sys.color.context.filled.avatar-background.json +41 -0
  85. package/dist/materials/token-sys.color.context.filled.border-decorative.json +41 -0
  86. package/dist/materials/token-sys.color.context.filled.divider-decorative.json +41 -0
  87. package/dist/materials/token-sys.color.context.filled.field-background.json +41 -0
  88. package/dist/materials/token-sys.color.context.filled.field-border.json +41 -0
  89. package/dist/materials/token-sys.color.context.filled.field-disabled.json +41 -0
  90. package/dist/materials/token-sys.color.context.filled.field-readonly.json +41 -0
  91. package/dist/materials/token-sys.color.context.filled.indicator-track.json +41 -0
  92. package/dist/materials/token-sys.color.context.filled.loading-placeholder.json +41 -0
  93. package/dist/materials/token-sys.color.context.filled.muted-background.json +41 -0
  94. package/dist/materials/token-sys.color.context.filled.selection-background.json +41 -0
  95. package/dist/materials/token-sys.color.context.filled.supporting-background.json +41 -0
  96. package/dist/materials/token-sys.color.field.readonly.json +41 -0
  97. package/dist/materials/token-sys.color.surface.avatar.json +41 -0
  98. package/dist/materials/token-sys.color.surface.current.json +41 -0
  99. package/dist/materials/token-sys.color.surface.muted.json +41 -0
  100. package/dist/materials/token-sys.color.surface.supporting.json +41 -0
  101. package/dist/materials/token-sys.motion.distance-panel.json +36 -0
  102. package/dist/materials/token-sys.motion.distance-small.json +36 -0
  103. package/dist/materials/token-sys.motion.duration-enter.json +36 -0
  104. package/dist/materials/token-sys.motion.duration-exit.json +36 -0
  105. package/dist/materials/token-sys.motion.duration-layer.json +36 -0
  106. package/dist/materials/token-sys.motion.duration-loop.json +36 -0
  107. package/dist/materials/token-sys.motion.duration-press.json +36 -0
  108. package/dist/materials/token-sys.motion.easing-enter.json +38 -0
  109. package/dist/materials/token-sys.motion.easing-exit.json +38 -0
  110. package/knowledge.json +115 -2
  111. package/manifest.json +11 -1
  112. package/package.json +9 -3
  113. package/references/component-families.md +146 -0
  114. package/references/composition.md +4 -4
  115. package/references/customization.md +14 -0
  116. package/references/flood-composition/SKILL.md +4 -0
  117. package/references/flood-data-display/SKILL.md +117 -0
  118. package/references/flood-feedback/SKILL.md +25 -0
  119. package/references/flood-forms/SKILL.md +31 -0
  120. package/references/flood-foundations/SKILL.md +36 -0
  121. package/references/flood-hierarchy/SKILL.md +23 -7
  122. package/references/flood-interface-content/SKILL.md +26 -5
  123. package/references/flood-motion/SKILL.md +44 -0
  124. package/references/flood-navigation/SKILL.md +195 -0
  125. package/references/flood-overlays/SKILL.md +35 -0
  126. package/references/flood-records/SKILL.md +42 -2
  127. package/references/flood-spacing/SKILL.md +38 -0
  128. package/references/flood-verification/SKILL.md +20 -0
  129. package/references/interface-content-examples.md +4 -0
  130. package/references/rendered-review.md +5 -0
  131. package/references/spacing.md +30 -0
  132. package/rules.json +94 -8
  133. package/workflows.json +28 -3
package/manifest.json CHANGED
@@ -72,6 +72,11 @@
72
72
  "target": ".agents/skills/flood-ui/references/flood-spacing/SKILL.md",
73
73
  "kind": "skill"
74
74
  },
75
+ {
76
+ "source": "references/flood-motion/SKILL.md",
77
+ "target": ".agents/skills/flood-ui/references/flood-motion/SKILL.md",
78
+ "kind": "skill"
79
+ },
75
80
  {
76
81
  "source": "references/flood-foundations/SKILL.md",
77
82
  "target": ".agents/skills/flood-ui/references/flood-foundations/SKILL.md",
@@ -146,9 +151,14 @@
146
151
  "source": "references/record-decisions.md",
147
152
  "target": ".agents/skills/flood-ui/references/record-decisions.md",
148
153
  "kind": "reference"
154
+ },
155
+ {
156
+ "source": "references/component-families.md",
157
+ "target": ".agents/skills/flood-ui/references/component-families.md",
158
+ "kind": "reference"
149
159
  }
150
160
  ],
151
- "version": "0.2.10",
161
+ "version": "0.2.11",
152
162
  "installedEntry": ".agents/skills/flood-ui/SKILL.md",
153
163
  "pathBase": "source is package-relative; target is relative to the host project root"
154
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flood-md/agent",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "description": "Versioned Flood design instructions for coding agents.",
6
6
  "license": "MIT",
@@ -22,8 +22,14 @@
22
22
  "README.md"
23
23
  ],
24
24
  "exports": {
25
- "./inspect": {"types":"./lib/inspect.d.ts","import":"./lib/inspect.mjs"},
26
- ".": {"types":"./lib/index.d.ts","import":"./lib/index.mjs"},
25
+ "./inspect": {
26
+ "types": "./lib/inspect.d.ts",
27
+ "import": "./lib/inspect.mjs"
28
+ },
29
+ ".": {
30
+ "types": "./lib/index.d.ts",
31
+ "import": "./lib/index.mjs"
32
+ },
27
33
  "./dist/*": "./dist/*",
28
34
  "./DESIGN.md": "./DESIGN.md",
29
35
  "./SKILL.md": "./SKILL.md",
@@ -0,0 +1,146 @@
1
+ # Author a component that belongs to Flood
2
+
3
+ Use when adding a reusable primitive, extending its visual contract or composing
4
+ a new shared component. This applies inside Flood itself and to project-owned
5
+ composites. Keep the installed/source distinction: a consumer cannot invent a new
6
+ package export or edit an installed dependency to implement these decisions.
7
+
8
+ ## Choose the family before choosing values
9
+
10
+ Identify the component's role and compare the closest existing owners in their
11
+ rendered states. A new name is not a reason for a new visual recipe. Record the
12
+ chosen siblings and intentional differences in development notes, outside the UI.
13
+
14
+ | Relationship | What should be shared |
15
+ | --- | --- |
16
+ | Action and icon action | Button/IconButton height, text, icon scale, insets and focus treatment |
17
+ | Text/selection/number field | Field label relationship, control height and field-state semantics |
18
+ | Command collection | Toolbar/Menu owners, action sizes and keyboard ownership |
19
+ | Floating surface | Existing overlay material, layer placement, inset and focus restoration |
20
+ | Named content or record | Typography, hierarchy and metadata owners, not a new title scale |
21
+
22
+ Reuse these owners inside the new component. Extend the smallest missing owner
23
+ before adding a composite override. For example, the Toolbar that draws an
24
+ OverflowActions background owns its shape; a playground-only border-radius does
25
+ not establish that capability for other consumers.
26
+
27
+ ## Define the visual and behavioral contract together
28
+
29
+ - Use matching semantic token roles. Equal-looking values are not necessarily
30
+ interchangeable roles; a field radius and an action radius can evolve separately.
31
+ - Derive sizes from the family's controls. Label line height, explicit icon box,
32
+ interactive height and optical insets must still agree at every exposed size.
33
+ - Name variants by a meaningful role or shape. Keep appearance separate from
34
+ state: selected, read-only, disabled, invalid and focus are not interchangeable.
35
+ - Make the outer geometry deliberate. A single-row capsule action rail can use
36
+ a pill shape; a wrapping or vertical group may need rounded geometry. Do not
37
+ blindly apply a pill to a multi-row surface. Use the spacing workflow to assess
38
+ nested radii and the actual inset; independently interactive neighbours need
39
+ not share a concentric-radius formula.
40
+ - Account for padding and stroke in the space available to children. Overflow
41
+ calculations use the content box, not the outer border rectangle. Check the
42
+ threshold at which an item moves into the overflow owner.
43
+ - Keep behaviour in the component that owns it. A focusable read-only text field
44
+ still needs a visible focus indicator and selection/copy. It blocks edits and
45
+ its chooser; disabled has a different native contract. Do not erase focus to
46
+ make a state look quieter or add helper copy merely to explain that contract.
47
+
48
+ ## Compare the family in one scene
49
+
50
+ Repeated navigation/record rows share columns, not just height and font. Before
51
+ accepting a composition, compare glyph centers, label starts and trailing action
52
+ centers between header, groups, iconless/icon-bearing rows and footer. Define the
53
+ indent of descendants deliberately and reserve missing peer anatomy. Scrollbar
54
+ visibility must not silently change only the middle pane's content tracks.
55
+
56
+ NavigationItem owns shared row geometry for native Link destinations, Button
57
+ commands and disclosure. A branch without a destination uses a full-row toggle;
58
+ a destination with children has distinct sibling link and disclosure targets,
59
+ never nested controls or a link click that also toggles. The complete row owns
60
+ its current/hover surface, so selection does not end at an unrelated shorter pill
61
+ before the chevron. Budget real trailing anatomy once. NavigationTree composes
62
+ these rows and manages hierarchy rather than supplying a parallel visual recipe.
63
+
64
+ NavigationGroup owns optional label/action/separator and independent group
65
+ disclosure. Its compact presentation reveals destinations without discarding the
66
+ accepted expanded choice. Hiding a title cannot remove a needed accessible name
67
+ or make a command unreachable. Compare headed/unheaded groups and all optional
68
+ anatomy; an available slot is not a reason to populate it.
69
+
70
+ Sidebar reuses NavigationGroup and NavigationTree. Its compact branches reuse
71
+ Popover; full destinations retain Link and normal Tab behavior. Header/footer
72
+ adapt through slots, with opt-in shell separators. The actual brand, toggle,
73
+ destination and account hit areas share the full compact rail axis; a centered
74
+ wrapper around a start-aligned Menu trigger is insufficient. Expanded slots share
75
+ icon/text tracks. Its ScrollArea uses the existing edge lane for clearance. Keep
76
+ material at the sidebar owner, without another material behind each group.
77
+ Separate route identity, group/branch expansion and sidebar width; compare both
78
+ profiles beside the small owners at the same size, with long text and bounded
79
+ height. The 0.2.11 candidate's APIs require matching installed declarations.
80
+ Disclosure artwork stays subordinate to destination icons without reducing hit
81
+ areas; IconButton.iconSize separates these responsibilities. Compact hints reuse
82
+ Tooltip on the actual Link/button, preserve refs and event handlers, and disappear
83
+ when a branch flyout opens. Pane-toggle glyphs change with accepted visibility.
84
+
85
+ Material context is part of the family contract. Compare actions, fields,
86
+ choices, selection and supporting elements on the same material. A shared
87
+ semantic context should correct the family together; a descendant-only button
88
+ override leaves fields and composed controls inconsistent. Keep absolute
89
+ material colors separate from contextual control roles and verify the nearest
90
+ nested owner resets those roles. Preserve accent focus and destructive meaning.
91
+
92
+ BulkActionBar is a one-row capsule for a small set of selection commands. Keep
93
+ one to three visible commands, prefer two, and disclose the remainder through
94
+ its overflow owner. Do not wrap this floating rail into a second row or use it
95
+ as another general toolbar. The host owns selected IDs, confirmation, accepted
96
+ updates, positioning and scroll clearance.
97
+ BulkActionBar counter can be label, number or none. Visible counters reserve
98
+ their width across count changes; choose counterWidth for the expected localized
99
+ summary rather than sizing it from each current count. Hiding it removes its slot.
100
+
101
+ CollectionToolbar composes the search, Tag, Button and Popover families without
102
+ adding a surface. Use normal Tab navigation for this mixed input/action group.
103
+ Compare SearchInput and existing collection controls at the same controlSize;
104
+ preserve the end anchor, reserved reset space and contextual action colors.
105
+ Keep saved views and query execution in the host; filterContent supplies its draft.
106
+
107
+ CollectionViewSwitcher composes Select and existing action owners on a separate
108
+ saved-view row. One command uses Button; multiple commands use OverflowActions.
109
+ Use its plain container variant beside peer fields so another material/inset does
110
+ not enlarge the command group. Contained remains appropriate for standalone rails.
111
+ Use the same controlSize and keep Select and action hit areas coherent. Queries,
112
+ dirty-state policy, permissions, dialogs and persistence belong to the host.
113
+
114
+ FilterGroup composes FilterCondition and existing matching/actions. Preserve
115
+ stable row IDs and accepted controlled state. Addition/removal focus belongs to
116
+ the group after acceptance; Apply/Cancel, validation and query evaluation remain
117
+ host-owned. Do not add a nested material or empty-state narration just because
118
+ the flat group has its own component name.
119
+
120
+ Render the new control beside its nearest sibling, with the same label/content,
121
+ size, surface and root text scale. Review rest, hover, keyboard focus and the
122
+ states the component actually supports. Include long content, empty/optional
123
+ slots, narrow tracks and enlarged text. The scene is verification tooling, not a
124
+ new runtime wrapper or a mandatory product screen.
125
+
126
+ Measure what looked wrong: glyph/text centres, visible insets, nested curves,
127
+ focus bounds and overflow thresholds. Exercise resize while an action or popup
128
+ has focus. After a shared-owner correction, inspect another consumer. A green
129
+ build or token reuse alone does not establish visual kinship.
130
+
131
+ ## Keep the contract discoverable
132
+
133
+ In Flood source, update declarations, component examples, applicable guidance
134
+ and the version decision together; regenerate the existing knowledge catalog.
135
+ In a host, document the project-owned composite and its actual dependencies.
136
+ Do not add unsupported props to examples or a parallel handwritten API index.
137
+ Report executed behavioural/visual checks separately from guidance that was
138
+ merely read. Record deliberate family exceptions instead of making an isolated
139
+ fix the next component's accidental default.
140
+
141
+ Track actual consumers and interactions for a proposed atom. Demonstrate a shared
142
+ responsibility in different compositions before promoting a recipe helper into
143
+ the package. Do not insert an owner merely to increase its usage count: one
144
+ command can remain Button while a constrained command collection uses
145
+ OverflowActions. Reuse is judged by correct roles and reachable behaviour, not
146
+ the length of an import list.
@@ -138,9 +138,9 @@ Link defaults to text; opt-in solid/subtle/outline/ghost and
138
138
  Button sizes share the button recipe without changing native anchor semantics.
139
139
  Use href/target for navigation, Button for actions; never nest the two or add
140
140
  role=button. Link has no disabled/loading contract. Available in 0.2.3.
141
- Tabs switches linked content panels (not modes or radio values) on a shared
142
- contained surface. Avoid a second enclosing card inside the panel; selected fill
143
- joins the panel without an additional underline. Arrows activate by default,
141
+ Tabs switches linked content panels. Use the default contained variant for a
142
+ shared surface where the selected fill joins the panel. Use variant="line" for
143
+ page-level sections whose content sits on the page canvas. Arrows activate by default,
144
144
  or focus only with activationMode=manual; Enter/Space commit. One tab
145
145
  stop, RTL/orientation aware, disabled skip. Panels stay mounted/hidden and retain
146
146
  native form constraints. Controlled/missing/disabled selected values derive first
@@ -278,4 +278,4 @@ Section headingLevel controls native h2–h6 semantics. Its independent headingS
278
278
  uses the existing Heading roles (section/page/large/display), defaulting to section.
279
279
  Keep document hierarchy meaningful when changing visual emphasis.
280
280
 
281
- For a command palette, compose Dialog and CommandList. The host owns commands, permissions, query reset and shortcuts; keep Escape available to the dialog. Avoid a duplicate modal or command-search engine. The project recipe lives in docs/recipes/command-palette.md in the source repository.
281
+ Use CommandPalette for modal navigation and command search. The host owns commands, permissions, controlled query reset and shortcuts. Keep CommandList for inline search. The project recipe lives in docs/recipes/command-palette.md in the source repository.
@@ -18,6 +18,20 @@ Keep reference values separate from semantic roles. Component recipes consume
18
18
  roles, and screen composition consumes components. An accent/material experiment
19
19
  must be scoped; it must not silently alter ordinary fields, text or focus.
20
20
 
21
+ Filled material owners establish contextual neutral recipes for their children.
22
+ Customize context-filled/base roles for a shared change; a direct consumer-role
23
+ override on the owning material can refine that one scope. Verify canvas and
24
+ elevated recipes together when increasing boundary contrast. Do not override
25
+ surface.canvas to soften nested controls: it also supplies contrasting content
26
+ and document/media wells. Use surface.current and the contextual supporting or
27
+ readonly roles for those jobs. Explicit data-flood-surface attributes change
28
+ context only, not the rendered material or overlay behavior.
29
+
30
+ For a tinted theme, map the floating surface, translucent floating surface,
31
+ floating border and floating selection alongside canvas and base/filled field
32
+ roles. Open a Select on both canvas and a filled surface and check its trigger,
33
+ panel and highlighted option. Check the opaque fallback as well.
34
+
21
35
  Keep layout/typography in rem, role line heights and tracking intact unless the
22
36
  task explicitly changes them. Never impose a root 16px or 62.5% reset. Bundled
23
37
  Inter retains its OFL notice; external icon/font assets keep their own notices.
@@ -5,6 +5,10 @@ description: Build or review Flood UI from existing library primitives before ad
5
5
 
6
6
  # Compose Flood from its primitives
7
7
 
8
+ When adding a reusable component or changing its visual contract, read
9
+ [component families](../component-families.md) before choosing anatomy, sizing,
10
+ shape or states. It governs Flood's own components as well as host composites.
11
+
8
12
  Existing Flood components are the building blocks, including inside other Flood
9
13
  components. Preserve their anatomy and behavior when improving a composition.
10
14
  Read the governing project instructions, matching declarations and relevant
@@ -5,6 +5,40 @@ description: Assemble Flood tables, lists, cards and file records with long or c
5
5
 
6
6
  # Compose meaningful data structures
7
7
 
8
+ Enable selection when it has a real consequence: a bulk operation, comparison or
9
+ another requested selection task. Do not add checkboxes merely because the table
10
+ supports them. Exercise the resulting action with the actual accepted scope.
11
+
12
+ For search, multiple conditions or saved query definitions, read
13
+ recipe:collection-views from the installed catalog when available. Separate the
14
+ working query, an uncommitted condition draft, a named saved definition and the
15
+ result/selection state. Save filters and supported sort, not result IDs. Name-only
16
+ edits must not commit dirty filters; deleting a view must not delete records.
17
+ Reset/revalidate page and selection when the query changes. Preferences read
18
+ failure need not hide an independently loaded collection, but must block writes
19
+ to that failed store and must not be disguised as an empty saved-view list.
20
+
21
+ Use CollectionViewSwitcher for accepted view choice and applicable commands,
22
+ separate from CollectionToolbar's working query controls. Offer update only for
23
+ an editable changed definition; keep rename name-only. The component requests IDs,
24
+ while the host owns acceptance, persistence and confirmation. Return naming and
25
+ deletion dialogs to its selectRef when their original action may disappear.
26
+
27
+ For one finite-choice property/operator/value row, use FilterCondition rather
28
+ than reassembling differently sized controls. A property change clears the
29
+ previous property's values in the proposed draft. Empty values are incomplete,
30
+ not an instruction to broaden the accepted query. The host owns Apply/Cancel,
31
+ duplicate-property policy and focus to another condition or Add after removal.
32
+ Text/date/number predicates need a deliberate supported editor; do not pretend
33
+ the finite-choice row implements arbitrary query semantics.
34
+
35
+ FilterGroup composes those rows for a flat finite-choice draft. It owns row IDs,
36
+ all/any controls and accepted row-change focus; the host owns Apply/Cancel and
37
+ query evaluation. Preserve accepted rows when addition limits or duplicate
38
+ policies change. Do not turn a new empty row into a broad accepted query or
39
+ wrap an empty group in decorative onboarding. Keep group labels contextual;
40
+ individual hidden legends/control names remain available to assistive technology.
41
+
8
42
  Use the installed component contracts and
9
43
  [composition workflow](../flood-composition/SKILL.md). Start with the content's
10
44
  relationships, not a wrapper around every piece of text.
@@ -21,6 +55,11 @@ the interface-content workflow for contextual placement.
21
55
  - Table/DataTable preserve caption, headers, cell relationships and documented
22
56
  sorting/selection behavior. A footer represents a summary and should be
23
57
  visually distinguishable without relying on a heavy border everywhere.
58
+ Mark comparable quantities and amounts with DataTable column `numeric` or
59
+ Table header/cell `data-numeric` for logical end alignment and tabular digits.
60
+ Keep identifiers, such as postal codes and account numbers, aligned as text
61
+ even when they contain only digits. Preserve formatted units and use raw sort
62
+ values when localized text or rich cells would sort differently.
24
63
  - DescriptionList expresses named values; DataList/DataListItem express records.
25
64
  Card/Section/Surface organize groups without inventing a second typography or
26
65
  spacing system. A heading's semantic level does not prescribe its visual size.
@@ -39,6 +78,11 @@ before filling metadata and actions. Identity, supporting context, lifecycle sta
39
78
  priority and timestamps have different purposes. Use Table/DataTable when users
40
79
  need several named comparisons; a trailing Inline of values is not a column model.
41
80
 
81
+ Use Table for short static details, such as receipt lines. When DataTable owns
82
+ sorting or selection and its result range adds no useful information, set
83
+ `showResults={false}`. Keep the range when it helps explain pagination or
84
+ the scope of filtered results. Selection feedback and page controls remain.
85
+
42
86
  ## Exercise data and geometry
43
87
 
44
88
  Test no records, one record, long/wrapping names, absent optional media/actions,
@@ -67,3 +111,76 @@ Use the documented local overflow owner, with a meaningful accessible name. Focu
67
111
  the last action/cell and check that a rail or rounded corner does not cover it.
68
112
  Compare narrow/wide, enlarged text and RTL. Locale-sensitive text in prerendered
69
113
  examples needs consistent server/client locale to avoid hydration differences.
114
+
115
+ ## Declare remote and selection ownership
116
+
117
+ Group collection controls by the task they affect. At a wide viewport, use the
118
+ available inline space for related search and filter controls. Keep view selection
119
+ and its management actions together, and make the result list reachable without
120
+ passing several sparse control rows. Add a row when it improves grouping or is
121
+ needed for wrapping, rather than assigning a row to each control type. Preserve
122
+ logical reading and keyboard order when the same groups wrap at enlarged text or
123
+ a narrow viewport. A collection host chooses the layout for its actual content.
124
+ Match the heights and typography of fields and actions sharing a control row.
125
+ Review the rendered sizes together. Keep management actions beside the view they
126
+ affect unless the wider composition gives their separation a clear purpose.
127
+
128
+ Default to at most two secondary filter controls beside a collection search.
129
+ When more than two filter properties are available, put the secondary choices
130
+ behind one Filters trigger. Count properties, including inactive filters, rather
131
+ than counting component names. Search, view selection, sorting and record actions
132
+ have different roles and do not count toward this filter limit. Keep applied
133
+ conditions visible as removable summaries and keep Clear filters reachable.
134
+ An explicitly primary filter can stay visible when the task warrants it. Move
135
+ secondary controls earlier if their labels or enlarged text already crowd the
136
+ row. Preserve draft/apply/cancel semantics and meaningful labels inside the panel.
137
+ When its trigger supplies the shared context, a nearby value can omit repeated
138
+ property text. A summary outside the panel needs its property named again.
139
+
140
+ Use CollectionToolbar for the search/filter query row, with accepted summaries
141
+ and a staged editor in filterContent. Keep saved views outside it. The fieldset
142
+ uses normal Tab navigation; do not place its editable search in a roving Toolbar.
143
+ Reuse FilterGroup for finite-choice drafts. The host owns validation, Apply,
144
+ Cancel, request execution and reset scope; canClear must include quickFilters
145
+ state when that slot is used. Preserve any-match meaning in summaryPrefix.
146
+ Inactive Clear filters reserves space and leaves the accessibility tree. Removal
147
+ and reset focus the persistent Filters trigger, or search without a panel.
148
+
149
+ DataTable supports ready/loading/error states. Use emptyContent to compose
150
+ EmptyState and a meaningful next action inside a ready empty table instead of
151
+ removing its headers. Distinguish no records from no matches; only the latter
152
+ offers reset of an active query. Custom empty content must not stand in for a
153
+ read failure or pending request. After reset removes the action, focus a persistent
154
+ query control. Omit emptyContent for the ordinary labels.empty message.
155
+
156
+ Client DataTable receives the complete local collection. Server paginationMode
157
+ receives one already sorted page, controlled page/onPageChange and totalRows;
158
+ sortable server columns require controlled sort/onSortChange. Do not locally
159
+ slice or sort a server page. Reconcile page when a filter reduces its total.
160
+ The host owns query identity and abort/request generations so a late response
161
+ cannot replace the current query. Present loading/error explicitly rather than
162
+ labeling old rows as an accepted new page.
163
+
164
+ Server page selection covers supplied rows only. Dataset scope requires controlled
165
+ selectedIds and host validation of IDs beyond that page. Select-page never means
166
+ select every search result. Clear/revalidate selection on query or permission
167
+ changes. Capture confirmed IDs and keep the proposal after an operation refusal.
168
+ Use BulkActionBar for a compact selected-record command rail; it composes
169
+ Toolbar and OverflowActions and keeps one row with a pill exterior. Prefer two
170
+ visible commands; at most three, with lower-priority commands in More. Use a
171
+ general Toolbar for unrelated editing controls rather than adding them here.
172
+ Show the actual selected count, distinguish page selection from the collection
173
+ scope, and keep clearing selection separate from resetting filters. Confirm
174
+ consequential actions against a captured list of IDs. Pending work targets that
175
+ snapshot even if the visible query changes. On success remove only those IDs
176
+ from current selection and reconcile pagination. Preserve accepted records and
177
+ selection after rejection, and retry the captured proposal. Give disappearing
178
+ action bars an intentional focus destination. Keep confirmation dialogs outside
179
+ the Toolbar's roving descendants.
180
+ A floating selection bar can keep record layout stable while selection changes.
181
+ Anchor it to the viewport with safe-area spacing and a bounded width. Measure
182
+ actual height and reserve scroll clearance so final rows and pagination remain
183
+ reachable. Verify its menus near the viewport edge and keep modal confirmation
184
+ in the dialog layer.
185
+ Read recipe:record-workspace from the matching installed catalog for a working
186
+ composition and its limits.
@@ -56,3 +56,28 @@ enlargement. Keep content visible without stealing focus merely to announce it.
56
56
  Reserve feedback space in a demo when needed for a stable sample, not universally
57
57
  inside every production component. Report audible announcement behavior only
58
58
  when it was actually tested with the relevant assistive technology.
59
+
60
+ ## Distinguish persistence failures from emptiness
61
+
62
+ Missing, valid, malformed, read-failed and write-failed are distinct states. A
63
+ read/parse failure is not permission to initialize samples or overwrite records.
64
+ Keep the raw snapshot where available and block editing/writes until recovery
65
+ succeeds or the user explicitly replaces that collection. Offer a named retry
66
+ and, when useful, a recovery export. A missing key can initialize an empty list;
67
+ fixture records declared in a test brief must not mask read failure.
68
+
69
+ A refused write preserves the last accepted collection and the current draft.
70
+ Discarding that draft ends its own save error, not an unresolved collection read
71
+ error. Accept results only for the current request/draft generation. These are
72
+ host-state decisions; Alert itself does not read storage or own recovery.
73
+
74
+ Describe the observed failure without inventing its cause. A refused browser
75
+ write can mean quota, denied access or another storage failure; do not prescribe
76
+ clearing data or freeing space unless that cause is actually known. Retain the
77
+ draft and offer an applicable retry/recovery action first.
78
+
79
+ Build write proposals without mutating the accepted collection or the current
80
+ draft in place. A rejected save must not append history, change status or alter
81
+ the next retry before acceptance. Retry should propose one operation, not repeat
82
+ side effects from the failed attempt. When a read failed, do not present invented
83
+ zero totals or an empty collection as if the data had loaded successfully.
@@ -43,6 +43,12 @@ need no inner heading. Field labels and values keep their documented sizes.
43
43
 
44
44
  ## Group before laying out fields
45
45
 
46
+ For settings with one Save action, keep a draft and the last saved values
47
+ separate. Group related fields under named sections, validate the complete
48
+ draft, and keep entered values available after a refused save. Reset returns
49
+ to the latest saved values. Confirm a successful save only after the host
50
+ accepts it. See `recipe:settings-workspace` for a working local example.
51
+
46
52
  Choose the form's reading order and semantic groups before placing controls in
47
53
  columns. Establish shared outer tracks, gap and group padding. Use a single Grid for
48
54
  related rows; do not narrow one numeric field in only one row merely because its
@@ -78,6 +84,11 @@ catalog. It demonstrates shared tracks and two-field peer groups in a workspace
78
84
  form. Adapt its grouping to the host; do not copy its business content or add
79
85
  unrequested sample records.
80
86
 
87
+ Choose the number of field tracks from the width available to the form. A wide
88
+ viewport can still contain a narrow drawer or a form squeezed by a sidebar.
89
+ Verify the same field group in wide and narrow hosts at the same viewport width.
90
+ Check reading order, control widths and labels after the group wraps.
91
+
81
92
  ## Exercise transitions, not just props
82
93
 
83
94
  Check entry, clear, incomplete drafts, invalid input, accepted/refused controlled
@@ -92,3 +103,23 @@ Show a real success only after the host operation succeeds. Explain consequentia
92
103
  storage limits once where they matter; a local example does not require a banner
93
104
  or repeated captions about its implementation. Follow the interface-content
94
105
  workflow for placement and wording.
106
+
107
+ ## Search values and remote collections
108
+
109
+ Selected chips supply a MultiSelect's visible context. Its empty query should
110
+ not reserve a redundant placeholder row; account for actual action/caret space
111
+ and let real search or overflowing chip content grow. Do not hide the combobox
112
+ or its keyboard entry to force a fixed-height appearance.
113
+
114
+ Combobox/MultiSelect submit selected IDs. Autocomplete accepts arbitrary text and
115
+ submits that text; choosing a suggestion does not turn it into an ID field.
116
+ Do not weaken a fixed-choice requirement merely to accept a failed search.
117
+ Manual filtering requires controlled query (Autocomplete: value), optionsQuery
118
+ identifying the accepted result and explicit loadState. Keep selectedOptions
119
+ while result pages change. The host owns fetching, cancellation and stale response
120
+ rejection; the control also prevents choosing options for another query.
121
+
122
+ Keep errors/loading distinct from zero matches and provide onRetry when useful.
123
+ Test Enter, Escape, blur, native reset, controlled refusal, IME, disabled/readonly
124
+ and actual FormData. Query completion, selection and text editing are separate
125
+ events. Do not announce success merely because a fetch callback fired.
@@ -26,6 +26,8 @@ applies the existing dark base; it does not start a palette, theme or motion red
26
26
  - Preserve rem sizing, the host root font, role line height and tracking. IconSlot
27
27
  owns explicit artwork dimensions; IconButton owns the accessible action/target.
28
28
  A large control does not mean an unconstrained SVG or oversized supporting copy.
29
+ Supporting disclosure can use a smaller IconButton iconSize while preserving
30
+ its control size, focus area and touch target. Do not size all glyph roles alike.
29
31
 
30
32
  Action icons are artwork with an explicit IconSlot size, not a plus, arrow or
31
33
  cross typed into the label. Font glyph bounds vary even at the same font size.
@@ -34,6 +36,27 @@ actions can omit the icon. Keep real symbols that are content, such as currency,
34
36
  phone prefixes or mathematical expressions, as text. Inspect the actual artwork
35
37
  and its centre relative to the label at the chosen Button size.
36
38
 
39
+ ## Surface context
40
+
41
+ Choose a material owner before tuning the nested controls. Surface, Dialog,
42
+ Drawer, Popover, selection popups and floating action bars establish their own
43
+ context. Neutral action fills, fields, selection and supporting elements adapt
44
+ to that nearest owner. Preserve solid action prominence, feedback meaning,
45
+ content contrast and the independent accent focus.
46
+
47
+ Do not fix a dark secondary button on an elevated panel with a page-specific
48
+ button color. Inspect the shared context roles and another consumer first.
49
+ Avoid broad ancestor selectors: a nested Surface owns its own context, while
50
+ a transparent layout wrapper inherits the current one. Material levels do not
51
+ count DOM nesting depth. Never alternate light/dark fills for every wrapper.
52
+
53
+ Review the same controls on canvas, default, raised, modal and floating surfaces.
54
+ Include nested surface resets, top-layer menus, read-only/disabled fields,
55
+ selection, supporting chips and progress tracks, not only Button screenshots.
56
+ Check the opaque fallback when transparency is reduced or unsupported and
57
+ system colors under forced colors. A token's alpha is not evidence of sufficient
58
+ contrast: inspect the composited color over the actual backing content.
59
+
37
60
  ## Evidence
38
61
 
39
62
  Trace a changed role to its consumers and compare resting, hover, selected,
@@ -42,3 +65,16 @@ a Surface and a popup over that field; inspect long text and enlarged root text.
42
65
  Do not claim visual consistency from token names or matching hex values alone.
43
66
  See [customization](../customization.md) and
44
67
  [accessibility](../accessibility.md) for perception/override details.
68
+
69
+ ## Destructive action tone
70
+
71
+ Button and IconButton accept tone="danger" for an actual destructive command,
72
+ independent of solid/subtle/outline/ghost prominence. It uses existing semantic
73
+ color roles in FloodRoot; keep the normal accent focus and disabled behavior.
74
+ A red label is not confirmation or permission to delete. Preserve that intent
75
+ when OverflowActions moves the command into Menu.
76
+
77
+ A numeric stepper is one horizontal control, not three wrapping fields. Keep its
78
+ minimum action/value budget inside a dense table's local scroll region. Test the
79
+ actual control at enlarged text in its narrowest repeated track; widening an
80
+ unrelated outer wrapper is not evidence that its internal geometry is sound.
@@ -3,6 +3,11 @@ name: flood-hierarchy
3
3
  description: Establish visual hierarchy, shared form tracks and vertical rhythm in Flood screens, forms and overlays. Use when titles, groups and labels compete or a composed interface feels flat; not a fixed page template.
4
4
  ---
5
5
 
6
+ Use PageHeader for the page's main heading and page-wide actions. Use Section
7
+ for a named block within the page. Keep breadcrumbs outside the header and
8
+ collection filters next to the collection. Add supporting copy only when it
9
+ changes what the user can understand or do on this page.
10
+
6
11
  # Structure before emphasis
7
12
 
8
13
  Start with the user's task, reading order and installed component contracts.
@@ -49,19 +54,30 @@ semantic grouping can justify another order. Do not turn every group into a box.
49
54
 
50
55
  ## Choose a rhythm, not a uniform gap
51
56
 
52
- For an ordinary desktop form, start with space-6 between field rows and space-8
53
- between independent groups or before the closing action row. The Dialog body
54
- inset is already space-6: do not add the same inset again to the first child.
55
- Keep a label nearer its control than the next field and a group title nearer
56
- its own fields than the next group. Dense filters, table editors and choice lists
57
- have different budgets; apply their component recipes instead of spreading this
58
- form rhythm everywhere.
57
+ For a compact settings form, start with the page heading, section legends,
58
+ and ordinary Field labels. Check that each level is recognizable by size,
59
+ weight and proximity. Use space-6 between sections as a starting point.
60
+ Repeated switch rows already provide a full hit area. Keep those rows close
61
+ and align the switches on one shared edge within a readable column.
62
+ Check actual row centers and wrapping at enlarged text.
63
+
64
+ Keep a label visually nearer its control than the next field and a group title
65
+ nearer its own fields than the next group. Inspect the rendered line height,
66
+ control padding and fill before adjusting a parent gap. Dialog already supplies
67
+ its body inset. Compare one change in size, weight, contrast, or spacing at a
68
+ time using the [spacing review](../spacing.md#judge-the-space-you-can-see).
59
69
 
60
70
  Treat action order/alignment as part of the task. An end-aligned cancel/primary
61
71
  pair can finish a short desktop dialog clearly. This is not a universal order:
62
72
  respect host conventions, direction, destructive confirmation and keyboard flow.
63
73
  Do not add a footer surface or separator unless it resolves a real boundary.
64
74
 
75
+ Choose the strongest action within the current task region. Check the page,
76
+ each repeated row and any open overlay separately. In a settings form, Save
77
+ can lead and Discard can stay secondary. In a filtered empty list, clearing
78
+ filters may become the most useful action. A read-only detail can have no
79
+ primary action. Keep the intended next action recognizable across states.
80
+
65
81
  Record lists and details need an information budget as well as type hierarchy.
66
82
  Use the [records workflow](../flood-records/SKILL.md) for metadata placement,
67
83
  comparison columns and status/category/priority meanings; do not give every
@@ -78,6 +78,14 @@ affected object named again, a long form may repeat its primary action at the en
78
78
  and a printed document has its own content hierarchy. Do not remove those merely
79
79
  because similar words appear elsewhere on the screen.
80
80
 
81
+ Review shared context across the shell, page header, toolbar, list and open
82
+ record. A page title can carry the task, a section can name the collection, and
83
+ column labels can carry units or field meaning. Trace each repeated fact to its
84
+ visible owner. Temporarily remove optional subtitles, count captions and labels
85
+ beside values. Restore a string when its absence hides scope, changes a decision
86
+ or makes a pane ambiguous when it opens on its own. Keep names required by
87
+ assistive technology when the corresponding visible caption goes away.
88
+
81
89
  ## Explain only what changes a decision
82
90
 
83
91
  Prefer a clear label or unit to an added helper paragraph. Add a field hint for a
@@ -128,11 +136,16 @@ location, remove it. Read the decision examples when uncertain; reading this
128
136
  workflow without applying that review does not satisfy it. Preserve essential
129
137
  consequences and actionable errors rather than stripping every explanation.
130
138
 
131
- Read the whole screen in task order, including navigation, heading, fields,
132
- actions and the state after an action. Review visible strings together with
133
- accessible names, placeholders and announcements. Check repeated meaning across
134
- locations, not just repeated words in one file. Removing a subtitle should not
135
- leave its reserved space or an empty banner behind.
139
+ Read the whole screen in task order, including navigation, heading, fields and
140
+ actions. For a collection, repeat with populated and empty results, then with the
141
+ record open. Compare count scope before dropping duplicates. An active filter
142
+ count and a footer range may differ when search or pagination is active. If all
143
+ receipts are already visible in their column, omit a routine completion caption;
144
+ keep a missing-receipt signal if it affects approval. Name totals when two
145
+ simultaneously visible amounts represent different scopes.
146
+
147
+ Review visible strings together with accessible names, placeholders and
148
+ announcements. Removing a subtitle should also remove its reserved space.
136
149
 
137
150
  For a writing pass, report the consequential keep/rewrite/move/remove decisions
138
151
  outside the product UI, and exercise the affected action or error. Automated
@@ -140,3 +153,11 @@ phrase scans cannot establish editorial quality. Use [decision examples](../inte
140
153
  when a similar-looking string needs different treatment in another context.
141
154
  Do not claim an independent agent evaluation when the author already knows the
142
155
  implementation or corrected the initial output manually.
156
+
157
+ ## Make canonical examples teach the same standard
158
+
159
+ Apply these decisions to playground defaults and copied recipes. Optional
160
+ descriptions start absent. When demonstrating one, use a real distinction or
161
+ constraint, such as a plan's member limit, rather than a friendly sentence
162
+ repeating its title. Marketing prose belongs to a deliberate marketing surface,
163
+ not default field/dialog content. Review the printed example as well as its DOM.