@flood-md/agent 0.2.2 → 0.2.4
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/DESIGN.md +175 -3
- package/README.md +33 -3
- package/SKILL.md +29 -13
- package/manifest.json +59 -0
- package/package.json +8 -2
- package/references/accessibility.md +79 -0
- package/references/composition.md +161 -0
- package/references/customization.md +27 -0
- package/references/routing.md +26 -0
- package/references/spacing.md +61 -0
- package/references/verification.md +30 -0
- package/rules.json +187 -0
package/DESIGN.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
# Flood design system · 0.2.
|
|
1
|
+
# Flood design system · 0.2.4
|
|
2
|
+
|
|
3
|
+
Read project-root flood.json and installed declarations with this contract.
|
|
4
|
+
The source bundle's SKILL.md routes to focused composition, accessibility,
|
|
5
|
+
customization and verification references. Its routing matrix names prerequisites
|
|
6
|
+
and sources of truth; flood/rules.json indexes observable checks. Read only the
|
|
7
|
+
relevant reference. This expanded bundle belongs to 0.2.4; existing installations
|
|
8
|
+
keep their matching guide set.
|
|
2
9
|
|
|
3
10
|
React + TypeScript and Next.js App Router. Use this guide with matching installed
|
|
4
11
|
Flood packages and flood.json. The source repository's release status does not
|
|
5
12
|
grant permission to publish or assume a version is available on npm.
|
|
6
13
|
|
|
14
|
+
This guide covers the supported exports in 0.2.4 and their layout refinements. Confirm
|
|
15
|
+
the matching installed declarations before using APIs absent from older versions.
|
|
16
|
+
|
|
7
17
|
## Connect
|
|
8
18
|
|
|
9
19
|
Import @flood-md/react/styles.css once in the application entry or Next root
|
|
@@ -23,6 +33,13 @@ child. Keep server data fetching in server components.
|
|
|
23
33
|
- Use CodeSnippet with a code string and optional action slot for commands or
|
|
24
34
|
short examples. The host owns clipboard permission, feedback and errors;
|
|
25
35
|
selectable wrapped code remains available when copying fails.
|
|
36
|
+
- Use source ScrollArea for deliberately constrained overflow, with a named
|
|
37
|
+
viewport and explicit height/maxHeight for vertical content. Ref/style/native
|
|
38
|
+
div props target the native viewport. Overlay rails sit above content without
|
|
39
|
+
a gutter; default contentInset="scrollbar" protects text with inner padding.
|
|
40
|
+
Use explicit "none" only with adequate host padding or intentional overlap.
|
|
41
|
+
Keep wheel/touch/keyboard behavior and native
|
|
42
|
+
forced-colors fallback. Confirm this export exists in installed declarations.
|
|
26
43
|
- Use Stack and wrapping Inline. Gap and Surface padding keys are strings
|
|
27
44
|
0/1/2/3/4/6/8/12. Parent layout owns spacing; avoid redundant cards and borders.
|
|
28
45
|
- Sizes use rem, line heights ratios, tracking em. Do not impose a fixed root
|
|
@@ -34,18 +51,57 @@ child. Keep server data fetching in server components.
|
|
|
34
51
|
- Use Link for navigation and Button for actions. Button defaults to type=button;
|
|
35
52
|
set type=submit deliberately. Loading disables activation and sets aria-busy;
|
|
36
53
|
retain meaningful visible text and let the host announce completion.
|
|
37
|
-
- Input/Textarea use controlSize sm/md/lg/xl. Preserve
|
|
54
|
+
- Input/Textarea and source Select use controlSize sm/md/lg/xl. Preserve native
|
|
55
|
+
numeric size props. Select accepts native option/optgroup children and an
|
|
56
|
+
HTMLSelectElement ref. Single selection uses Flood's custom trigger/listbox,
|
|
57
|
+
with a native select form-value/ref bridge; never replace it with the OS popup.
|
|
58
|
+
Multiple or size>1 remains an inline native listbox, without a dropdown arrow.
|
|
59
|
+
For single selection, arrows/Home/End highlight, Enter/Space/Tab commits, and
|
|
60
|
+
Escape cancels; typeahead matches option labels. Preserve trigger focus and
|
|
61
|
+
aria-activedescendant rather than moving focus into each option. The ref remains
|
|
62
|
+
HTMLSelectElement; its focus() targets the trigger. In onChange, read the event's
|
|
63
|
+
currentTarget as the native select; retain name/required/defaultValue/form reset.
|
|
64
|
+
Supply ordinary text-labeled options/optgroups, not interactive option content.
|
|
38
65
|
Field required forwards native required and adds a visible marker. Spread all
|
|
39
66
|
callback props to preserve id, aria-describedby and aria-invalid. describedBy
|
|
40
67
|
merges external description IDs with hint/error IDs.
|
|
41
68
|
- Checkbox, Radio and Switch require visible labels and preserve native forms.
|
|
42
69
|
Radio groups share a name and belong in a host fieldset/legend. Readonly and
|
|
43
70
|
disabled are different states; explain unavailability outside disabled controls.
|
|
71
|
+
Select has no native readOnly state. Do not block its keyboard events to fake one.
|
|
44
72
|
- IconSlot adapts host SVG artwork; without label it is decorative. IconButton
|
|
45
73
|
requires a nonempty action label. Retain the external icon pack's license.
|
|
46
74
|
- Surface elevation overlay is visual only: no portal, focus trap, dismissal or
|
|
47
75
|
dialog semantics are implied. Layer tokens do not implement an overlay manager.
|
|
48
76
|
|
|
77
|
+
## Layout rules
|
|
78
|
+
|
|
79
|
+
- Keep Button width intrinsic to its content. Use Inline for sibling actions;
|
|
80
|
+
opt into full width only for a deliberate host layout with inlineSize:100%.
|
|
81
|
+
Do not stretch every action because its parent is a grid or vertical stack.
|
|
82
|
+
- Inside a choice, keep the indicator a non-shrinking 1.125rem square and its
|
|
83
|
+
visible label .5rem away (8px at the reference root). Custom Checkbox/Radio
|
|
84
|
+
appearance still uses real native inputs; forced colors restores native marks.
|
|
85
|
+
- Separate independent choices with Inline gap="4" (1rem/16px at the reference
|
|
86
|
+
root). Inline's default gap="2" remains unchanged. Internal label gap and
|
|
87
|
+
parent group gap are separate decisions; do not conflate them.
|
|
88
|
+
- Center-align choice rows; keep each label close to its indicator. Do not use
|
|
89
|
+
space-between inside a Checkbox/Radio/Switch to push the label to the other edge.
|
|
90
|
+
- Give form/Field parents a responsive width such as min(100%,26rem), with
|
|
91
|
+
min-inline-size:0 in grid/flex contexts. Input/Textarea/Select fill that width.
|
|
92
|
+
Check the actual wrapper tree after adding FloodRoot or Surface; do not leave
|
|
93
|
+
fields trapped in an intrinsic-width wrapper.
|
|
94
|
+
- Build hierarchy with Heading, body/compact text, Field labels and supporting
|
|
95
|
+
helper text. Use gap4 within groups, gap6 between related groups, and wrap
|
|
96
|
+
action rows. Add surfaces for meaningful grouping, not around every control.
|
|
97
|
+
- Keep geometry in rem, line-height unitless and tracking em; preserve the host
|
|
98
|
+
root size. Check320px widths, enlarged text and user text-spacing overrides
|
|
99
|
+
instead of shrinking type or clipping labels to make the layout fit.
|
|
100
|
+
|
|
101
|
+
For inset shapes that share a contour (Select popup and highlighted rows),
|
|
102
|
+
derive inner radius as max(0, outer radius - padding - border width). Keep this
|
|
103
|
+
local to the composition; independent nested actions keep their own radii.
|
|
104
|
+
|
|
49
105
|
## Tokens and accessibility
|
|
50
106
|
|
|
51
107
|
Use semantic --flood-sys-* roles inside FloodRoot; values are authored only in
|
|
@@ -54,7 +110,10 @@ Nested token scopes repeat both data-flood-foundations=neutral and
|
|
|
54
110
|
data-flood-theme=dark attributes. Preserve independent surface, content, boundary,
|
|
55
111
|
selection, feedback and focus roles rather than hardcoding component colors.
|
|
56
112
|
|
|
57
|
-
|
|
113
|
+
Default controls use the quiet field.border role, without a second bottom edge or
|
|
114
|
+
inset shadow. Keep field.boundary as an explicit stronger alternative; do not apply
|
|
115
|
+
it to every ordinary control. Quiet defaults do not establish 3:1 non-text
|
|
116
|
+
contrast. Focus is 2px
|
|
58
117
|
without offset; the configurable pink default is provisional. Keep focus visible
|
|
59
118
|
with invalid and selected states. Do not mute a whole component through opacity
|
|
60
119
|
to reduce one border. Never convey error, selection or status by color alone.
|
|
@@ -99,3 +158,116 @@ export function Profile() {
|
|
|
99
158
|
);
|
|
100
159
|
}
|
|
101
160
|
```
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
0.2.4 adds Badge, Spinner, Skeleton and Avatar. Read references/composition.md and references/accessibility.md for status announcements, fallback geometry and decorative naming. Button loading reuses Spinner. These APIs are not present in 0.2.3.
|
|
164
|
+
|
|
165
|
+
Progress, Meter and Alert are also available in 0.2.4. Distinguish task completion from bounded measurements, preserve names/units, and select alert announcement priority explicitly.
|
|
166
|
+
|
|
167
|
+
DescriptionList and Table are also available in 0.2.4. Preserve native description-list/table structure, table captions and header relationships. Range of displayed data and formatting remain host-owned; DataTable behavior is outside these primitives.
|
|
168
|
+
|
|
169
|
+
Menu adds a real action-menu keyboard contract in 0.2.4; it reuses the layer engine and ScrollArea while remaining distinct from Select and Popover. onAction business effects belong to the host.
|
|
170
|
+
|
|
171
|
+
### Toolbar and Kbd (0.2.4)
|
|
172
|
+
|
|
173
|
+
Toolbar groups Button, IconButton, Toggle, native buttons/links and Menu triggers
|
|
174
|
+
under one named action panel. After hydration it uses one Tab entry, directional
|
|
175
|
+
arrows, Home/End and optional looping. Disabled/hidden actions are skipped. Arrows
|
|
176
|
+
move focus, not activation. Horizontal order follows writing direction. In vertical
|
|
177
|
+
toolbars open Menu with Enter/Space; horizontal menus retain Up/Down opening.
|
|
178
|
+
Keep text inputs and independent selection widgets outside this action-only API.
|
|
179
|
+
Native child handlers and refs remain attached; Toolbar owns their tabIndex while
|
|
180
|
+
mounted and restores original attributes on cleanup. Without JavaScript, native
|
|
181
|
+
child Tab order remains available. Use a meaningful required label.
|
|
182
|
+
|
|
183
|
+
Kbd renders native kbd markup with sm/md/lg sizes and relative keycap heights.
|
|
184
|
+
It displays a key or combination; the host implements real shortcuts. It is not
|
|
185
|
+
interactive. Menu shortcut hints reuse Kbd and remain hidden from item names.
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
<Toolbar label="Editor actions">
|
|
189
|
+
<Button variant="ghost">Undo</Button>
|
|
190
|
+
<Toggle variant="ghost">Bold</Toggle>
|
|
191
|
+
<Button variant="ghost">Share</Button>
|
|
192
|
+
</Toolbar>
|
|
193
|
+
<Kbd>Ctrl</Kbd> + <Kbd>K</Kbd>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Card (0.2.4)
|
|
197
|
+
|
|
198
|
+
Card composes Surface into a header, body and footer. Optional title, description,
|
|
199
|
+
actions and footer accept React content; children are the body. Missing slots
|
|
200
|
+
create no empty section. Use Surface when only a background/padding is needed.
|
|
201
|
+
|
|
202
|
+
Card is a noninteractive div. Put Button, Link or Menu in actions/footer and keep
|
|
203
|
+
its container out of the Tab order. Do not make the entire card clickable around
|
|
204
|
+
nested controls. Native div props, styles and HTMLDivElement ref target the root.
|
|
205
|
+
The title prop is heading content, not an HTML tooltip; supply phrasing content.
|
|
206
|
+
headingLevel defaults to 2; choose the correct hierarchy for the host page.
|
|
207
|
+
|
|
208
|
+
Compact/comfortable density controls existing spacing tokens. Header actions wrap
|
|
209
|
+
without clipping menus or focus indicators. Footer uses a quiet separator; a
|
|
210
|
+
footer-only card has no redundant separator. Elevation is default or raised.
|
|
211
|
+
No data access, selection or interactive-card behavior is implied.
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
<Card title="Project details" description="Keep your team in sync."
|
|
215
|
+
footer={<Button variant="subtle">Open project</Button>}>
|
|
216
|
+
<Text as="p" size="compact">A calm place for the next idea.</Text>
|
|
217
|
+
</Card>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Structural, media and accessible primitives · 0.2.4
|
|
221
|
+
|
|
222
|
+
Container centers a max-width box with logical gutters. size sm/md/lg uses
|
|
223
|
+
40/64/80rem bounds including padding; full removes the max. gutter uses Space.
|
|
224
|
+
Grid defaults to auto-fit with a16rem semantic minimum clamped to available
|
|
225
|
+
width. gap uses Space. minItemWidth overrides the auto minimum; explicit columns
|
|
226
|
+
(1/2/3/4/6/12) remain fixed. Grid is ordinary layout, never an ARIA grid widget.
|
|
227
|
+
|
|
228
|
+
VisuallyHidden preserves content in the accessibility tree using span/div. Default
|
|
229
|
+
is for noninteractive content. Use focusable for a skip link: focus-within reveals
|
|
230
|
+
its wrapper; style the actual link's focus. This is different from aria-hidden or
|
|
231
|
+
conditional rendering. Native captions/legends may use the same hiding utility
|
|
232
|
+
without an invalid generic wrapper. Spinner and hidden indicator captions compose
|
|
233
|
+
VisuallyHidden. Field hideLabel and Fieldset hideLabel use focusable hiding so
|
|
234
|
+
valid interactive label/legend descendants reveal their label while focused;
|
|
235
|
+
keep primary actions visible in ordinary compositions.
|
|
236
|
+
|
|
237
|
+
AspectRatio reserves responsive media geometry before loading, accepting a finite
|
|
238
|
+
positive ratio (16/9 default). Direct img/video/iframe children fill its box. It
|
|
239
|
+
does not clip focus or make arbitrary long content fit; the host owns alternative
|
|
240
|
+
text, captions, media controls and deliberate cropping. Image is a native img
|
|
241
|
+
with required alt (empty for decorative content), cover/contain fit and preserved
|
|
242
|
+
srcSet/sizes/loading/decoding/dimensions/events/ref. No optimizer, fetch engine or
|
|
243
|
+
fallback is implied. Avatar composes Image for its own loading lifecycle. Supply
|
|
244
|
+
image dimensions or AspectRatio to reserve space.
|
|
245
|
+
|
|
246
|
+
List renders native ul/ol with native li children and token gap. ordered selects
|
|
247
|
+
ol; start/reversed apply there. start must be a safe integer. marker=false retains
|
|
248
|
+
explicit list semantics for platforms that drop lists without visible markers.
|
|
249
|
+
This is content, not ListBox selection or arrow navigation.
|
|
250
|
+
|
|
251
|
+
EmptyState composes Stack, Heading, Text, IconSlot and Inline. Required title,
|
|
252
|
+
optional description, decorative icon and actions explain absent content; choose
|
|
253
|
+
headingLevel for the host hierarchy. It is static, with no automatic focus or
|
|
254
|
+
announcement. compact/comfortable density controls padding. The host implements
|
|
255
|
+
real actions and decides whether asynchronously changed results need announcing.
|
|
256
|
+
|
|
257
|
+
Checkbox adds indeterminate for a host-controlled mixed presentation after
|
|
258
|
+
hydration. checked independently determines form submission; mixed does not mean
|
|
259
|
+
a third submitted value. The host owns aggregate/select-all values. Native reset
|
|
260
|
+
and ref access remain available. Radio and Switch do not expose indeterminate.
|
|
261
|
+
|
|
262
|
+
ButtonGroup/ToggleGroup retain their keyboard contracts and locally scroll when
|
|
263
|
+
a connected row cannot fit. InputGroup actions keep words intact and can wrap to
|
|
264
|
+
a new row while the input retains usable space. Plain string adornments are bidi
|
|
265
|
+
isolated; for protocols/phones with explicit direction pass a bdi dir=ltr node.
|
|
266
|
+
Keep very long addon content concise. Hidden native choices hide their label too.
|
|
267
|
+
|
|
268
|
+
Dark foundations bundle both normal and italic Inter, including Cyrillic, with
|
|
269
|
+
original OFL notices. Color alone never communicates validation or progress.
|
|
270
|
+
|
|
271
|
+
CodeSnippet codeDirection defaults to ltr independently of RTL parent action layout; choose rtl/auto explicitly for content that needs it. Native dir still applies to the wrapper. Protected ScrollArea reveals focused descendants fully when needed, composes the host focus handler and avoids scrolling to nested top-layer controls.
|
|
272
|
+
|
|
273
|
+
Checkbox, Radio and Switch apply native hidden/dir/lang to their visible label wrapper as well as the input, so a component-local language/direction applies to its whole choice.
|
package/README.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @flood-md/agent
|
|
2
2
|
|
|
3
|
-
Version-matched
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Version-matched guidance for Flood React/Next.js projects. Read the installed
|
|
4
|
+
contract before composing screens. The 0.2.4 reference bundle includes spacing
|
|
5
|
+
guidance, routing and observable rules. These files grant
|
|
6
|
+
no authority to modify external services.
|
|
7
|
+
|
|
8
|
+
| Source | Role |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| DESIGN.md | Shared versioned UI/component contract |
|
|
11
|
+
| SKILL.md | Short entry and task router |
|
|
12
|
+
| references/routing.md | Applicability, audience, prerequisites and governing source |
|
|
13
|
+
| references/composition.md | Screen/form composition workflow |
|
|
14
|
+
| references/spacing.md | Measured spacing, density, nested geometry and hit areas |
|
|
15
|
+
| references/accessibility.md | Interaction and perception checks |
|
|
16
|
+
| references/customization.md | Scoped semantic customization |
|
|
17
|
+
| references/verification.md | Evidence before reporting completion |
|
|
18
|
+
| rules.json | Stable rule IDs with conditions, sources and observable checks |
|
|
19
|
+
| manifest.json | Source → installed-path mapping used by the CLI |
|
|
20
|
+
|
|
21
|
+
CLI init copies every manifest entry into an unused owned path. Doctor checks
|
|
22
|
+
expected regular files without linked destinations. Neither tool rewrites host
|
|
23
|
+
instructions or proves agent compliance. The website serves these sources under
|
|
24
|
+
/agent/ after a build. Read only relevant references; installed declarations
|
|
25
|
+
govern available APIs. See [the human guide](../../docs/agents.md).
|
|
26
|
+
|
|
27
|
+
DESIGN.md includes concrete composition rules: intrinsic action widths,
|
|
28
|
+
responsive form parents, a close indicator/label pair, spacing between choices,
|
|
29
|
+
and keyboard/native form requirements. Always check the declarations of the
|
|
30
|
+
installed package before using APIs introduced by a later version.
|
|
31
|
+
See the user-facing [layout guide](../../docs/layout.md) for complete examples.
|
|
32
|
+
|
|
33
|
+
Manifest entry/rule guide paths identify package sources; manifest.files maps
|
|
34
|
+
them to project-root targets. installedEntry points directly to the project
|
|
35
|
+
skill. Keep manifest.version aligned with the package and DESIGN header.
|
package/SKILL.md
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flood-ui
|
|
3
|
-
description:
|
|
3
|
+
description: Compose, customize or review React and Next.js interfaces using installed Flood components, tokens and form contracts. Use in a Flood project; not for unrelated frameworks or deployment.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
versions; run doctor when uncertain. Import @flood-md/react/styles.css once and
|
|
8
|
-
compose new interfaces inside FloodRoot for explicit neutral/dark foundations.
|
|
6
|
+
## Start with the installed project
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
IconSlot and retain their licenses. Respect Next.js client boundaries.
|
|
8
|
+
Read the host instructions, package.json, flood.json and flood/DESIGN.md from
|
|
9
|
+
the project root. Installed declarations decide which APIs exist. A newer web
|
|
10
|
+
page or repository example does not add exports to an older package. Run the
|
|
11
|
+
matching installed CLI's doctor when versions or guide files are uncertain.
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
Import @flood-md/react/styles.css once; compose new dark interfaces in FloodRoot.
|
|
14
|
+
Use Flood's existing components before introducing a local adapter. Keep user
|
|
15
|
+
scope and host conventions; missing Flood behavior must be stated rather than
|
|
16
|
+
invented as a package API. No external component library or parallel token system.
|
|
17
|
+
|
|
18
|
+
## Read only the relevant reference
|
|
19
|
+
|
|
20
|
+
| Work | Read next | Required result |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| New screen, layout or form | [Composition](references/composition.md) | Existing primitives, correct host width and form ownership |
|
|
23
|
+
| Spacing, density, nested geometry or shifting previews | [Spacing](references/spacing.md) | Measured visual relationships and nonoverlapping interactive areas |
|
|
24
|
+
| Keyboard, validation, names or states | [Accessibility](references/accessibility.md) | Real interaction and associations preserved |
|
|
25
|
+
| Brand, colors or typography | [Customization](references/customization.md) | Scoped semantic overrides; unchanged behavior |
|
|
26
|
+
| Completion, regression or upgrade review | [Verification](references/verification.md) | Checks and limits reported against the actual host |
|
|
27
|
+
| Decide which document governs a change | [Routing and sources](references/routing.md) | Source of truth and prerequisites identified |
|
|
28
|
+
|
|
29
|
+
The project-root flood/rules.json lists stable rule IDs and their observable
|
|
30
|
+
checks; it is an index, not executable policy. At completion report which checks
|
|
31
|
+
ran, their result and any unverified behavior. Doctor checks installation only.
|
|
32
|
+
Guidance cannot guarantee an agent's compliance or certify application accessibility.
|
|
33
|
+
|
|
34
|
+
Preserve existing instructions and customized guides. This skill authorizes no
|
|
35
|
+
deployment, deletion, external messages or sending host source to other services.
|
package/manifest.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"entry": "SKILL.md",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"source": "DESIGN.md",
|
|
7
|
+
"target": "flood/DESIGN.md",
|
|
8
|
+
"kind": "contract"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"source": "rules.json",
|
|
12
|
+
"target": "flood/rules.json",
|
|
13
|
+
"kind": "rules"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"source": "manifest.json",
|
|
17
|
+
"target": "flood/manifest.json",
|
|
18
|
+
"kind": "manifest"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"source": "SKILL.md",
|
|
22
|
+
"target": ".agents/skills/flood-ui/SKILL.md",
|
|
23
|
+
"kind": "skill"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"source": "references/routing.md",
|
|
27
|
+
"target": ".agents/skills/flood-ui/references/routing.md",
|
|
28
|
+
"kind": "reference"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"source": "references/composition.md",
|
|
32
|
+
"target": ".agents/skills/flood-ui/references/composition.md",
|
|
33
|
+
"kind": "reference"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"source": "references/accessibility.md",
|
|
37
|
+
"target": ".agents/skills/flood-ui/references/accessibility.md",
|
|
38
|
+
"kind": "reference"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"source": "references/customization.md",
|
|
42
|
+
"target": ".agents/skills/flood-ui/references/customization.md",
|
|
43
|
+
"kind": "reference"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"source": "references/verification.md",
|
|
47
|
+
"target": ".agents/skills/flood-ui/references/verification.md",
|
|
48
|
+
"kind": "reference"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"source": "references/spacing.md",
|
|
52
|
+
"target": ".agents/skills/flood-ui/references/spacing.md",
|
|
53
|
+
"kind": "reference"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"version": "0.2.4",
|
|
57
|
+
"installedEntry": ".agents/skills/flood-ui/SKILL.md",
|
|
58
|
+
"pathBase": "source is package-relative; target is relative to the host project root"
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flood-md/agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Versioned Flood design instructions for coding agents.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,11 +12,17 @@
|
|
|
12
12
|
"files": [
|
|
13
13
|
"DESIGN.md",
|
|
14
14
|
"SKILL.md",
|
|
15
|
+
"references",
|
|
16
|
+
"rules.json",
|
|
17
|
+
"manifest.json",
|
|
15
18
|
"README.md"
|
|
16
19
|
],
|
|
17
20
|
"exports": {
|
|
18
21
|
"./DESIGN.md": "./DESIGN.md",
|
|
19
|
-
"./SKILL.md": "./SKILL.md"
|
|
22
|
+
"./SKILL.md": "./SKILL.md",
|
|
23
|
+
"./manifest.json": "./manifest.json",
|
|
24
|
+
"./rules.json": "./rules.json",
|
|
25
|
+
"./references/*": "./references/*"
|
|
20
26
|
},
|
|
21
27
|
"publishConfig": {
|
|
22
28
|
"access": "public"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Preserve interaction and perception
|
|
2
|
+
|
|
3
|
+
Read the installed component contract before changing its behavior. Do not add
|
|
4
|
+
ARIA to replace functioning native semantics or describe behavior that is absent.
|
|
5
|
+
|
|
6
|
+
- Every field needs a visible associated label. Spread Field callback props;
|
|
7
|
+
preserve id, required, aria-describedby and aria-invalid. Hint/error content
|
|
8
|
+
must describe the field. A placeholder is not its label.
|
|
9
|
+
- Keep the visible 2px focus perimeter with zero offset, including invalid and
|
|
10
|
+
selected states. Focus should not move layout or create another noisy contour.
|
|
11
|
+
Verify the actual foreground/background when overriding its accent.
|
|
12
|
+
- Checkbox, Radio and Switch keep native inputs, values, reset and keyboard.
|
|
13
|
+
Radios share name and use a host fieldset/legend. Disabled and readOnly differ;
|
|
14
|
+
Select has no native readOnly behavior.
|
|
15
|
+
- If installed Select exists: single choice uses Flood's custom popup, not an OS
|
|
16
|
+
dropdown. Arrows/Home/End highlight; Enter/Space/Tab commits; Escape cancels.
|
|
17
|
+
The native select bridge owns the form/ref contract. Multiple or size>1 is an
|
|
18
|
+
inline listbox. Do not turn the option text into another interactive control.
|
|
19
|
+
- Name icon-only actions by their effect, not glyph. Keep decorative SVGs out of
|
|
20
|
+
accessible names. Loading disables activation; announce host completion/errors
|
|
21
|
+
separately. Explain disabled actions in text outside the disabled element.
|
|
22
|
+
- Evaluate text contrast using WCAG and APCA guidance with actual size, weight
|
|
23
|
+
and background. APCA does not replace applicable WCAG requirements. Decorative
|
|
24
|
+
separators differ from necessary control boundaries; never mute a whole
|
|
25
|
+
component with opacity just to soften a border.
|
|
26
|
+
- Root font sizing belongs to the host. Preserve rem geometry, text wrapping,
|
|
27
|
+
forced-colors indicators and reduced-motion preferences.
|
|
28
|
+
|
|
29
|
+
Test keyboard start-to-finish, focus visibility, labels and descriptions,
|
|
30
|
+
validation, native form reset, long text, 320px layout and root text enlargement.
|
|
31
|
+
An automated scanner alone cannot establish application accessibility or WCAG 3
|
|
32
|
+
conformance. Record what was actually checked; see [verification](verification.md).
|
|
33
|
+
## Field status and read-only values
|
|
34
|
+
|
|
35
|
+
Use status on Field/Input/Textarea/Select for error, warning, success or info.
|
|
36
|
+
With Field, provide message and spread its callback props onto the Flood control.
|
|
37
|
+
Only error marks aria-invalid; warning/success/info are advisory. Existing error
|
|
38
|
+
or invalid takes precedence. Include a useful description instead of relying on
|
|
39
|
+
color alone. Status does not implement host validation or native constraints.
|
|
40
|
+
|
|
41
|
+
readOnly on text-like Input/Textarea prevents editing while preserving focus,
|
|
42
|
+
selection, copy and submission. Do not substitute disabled or apply readOnly to
|
|
43
|
+
Select/checkboxes. Explain the restriction. Preserve the solid accent focus even
|
|
44
|
+
when a read-only field uses a dashed resting perimeter.
|
|
45
|
+
|
|
46
|
+
External-label visibility: source Field/Fieldset hideLabel preserves the actual
|
|
47
|
+
label/legend and accessible name while removing its visual row. RadioGroup,
|
|
48
|
+
CheckboxGroup and SegmentedControl inherit it. Keep label/legend supplied and
|
|
49
|
+
textual and keep actions visibly discoverable. In 0.2.4 a hidden Field label or
|
|
50
|
+
Fieldset legend reveals while its descendant has focus, preserving native names
|
|
51
|
+
and child state. Use hideLabel only where surrounding context supplies the
|
|
52
|
+
visible meaning. Input/Textarea/Select/InputGroup configure
|
|
53
|
+
this on their Field wrapper, not the control. Placeholder never replaces naming;
|
|
54
|
+
choice option labels and button names have separate contracts. Available in 0.2.3.
|
|
55
|
+
|
|
56
|
+
Overlay source APIs: forward trigger render props/ref onto one actual button;
|
|
57
|
+
keep trigger mounted/visible. Tooltip is noninteractive text help, not the only
|
|
58
|
+
name/instruction; hover/focus opens, Escape dismisses, focus stays. Popover is a
|
|
59
|
+
named nonmodal dialog; outside/focus-leave/Escape close without trapping Tab.
|
|
60
|
+
Dialog uses native showModal and inert background, cycles focus, restores scroll
|
|
61
|
+
and opener. Escape dismisses the top layer; outside closing is independently
|
|
62
|
+
configurable. Provide a visible title and safe initialFocusRef when needed. Closed
|
|
63
|
+
Popover/Dialog children unmount; host owns persistent values and controlled open.
|
|
64
|
+
Modern native APIs required. DOM/theme scope stays intact; no body portal needed.
|
|
65
|
+
Available in 0.2.3.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
For 0.2.4 loading primitives: localize standalone Spinner label, avoid duplicate live announcements, and keep Skeleton hidden from AT. Reduced motion stops their animations. Avatar exposes one named image, or decorative presentation when the adjacent text already supplies identity. Badge text must express status without relying on its color.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
Progress and Meter are not live regions. Keep their labels even with hideLabel, and provide meaningful valueText when percentages would be misleading. Unknown Progress omits aria-valuenow; Meter has no unknown state. Alert defaults to silent static content; opt into announcement=polite (status) or assertive (alert) only for the required urgency. Do not move focus to these messages or claim every screen reader announces initial markup. Verify with actual assistive technology.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
Retain DescriptionList native dl/dt/dd semantics without redundant ARIA term/definition roles. Table needs a meaningful caption (hideCaption keeps its name) and host-owned header associations; never convert table rows into display:block cards without preserving relationships. Name the horizontal scroll viewport, retain keyboard scrolling and check that focusable cell controls remain reachable. Native table ref points to table, not viewport.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
Menu: preserve menu/menuitem/separator semantics and trigger aria-haspopup/expanded/controls. Disabled items remain arrow-focusable with aria-disabled and must never activate. Use arrows/Home/End/typeahead within the menu, Escape to close, Tab out and Shift+Tab to trigger. Do not turn ordinary navigation lists into application menus. Restore focus unless the host deliberately moved it; test nested Dialog behavior and actual assistive technology separately.
|
|
78
|
+
|
|
79
|
+
Toolbar requires a meaningful label. After hydration it manages child tabIndex, skips hidden/disabled actions, supports Home/End, orientation and RTL, and restores original child tabIndex attributes on cleanup. Native child handlers/refs remain attached. Before JavaScript native child Tab order remains. Kbd has native keyboard-input semantics and adds no focus stop or handler; do not present unimplemented bindings as working shortcuts.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Compose an interface
|
|
2
|
+
|
|
3
|
+
For spacing, density or nested-geometry decisions, read [Spacing](spacing.md).
|
|
4
|
+
Measure the complete row geometry before adding a gap to repeated controls.
|
|
5
|
+
|
|
6
|
+
Start with content and the user's interaction. Use the installed exports shown
|
|
7
|
+
in flood/DESIGN.md; no invented props, new component library or copied registry.
|
|
8
|
+
|
|
9
|
+
1. Choose semantic Heading levels independently of visual size. Text handles
|
|
10
|
+
supporting copy; keep the content hierarchy quieter than the primary task.
|
|
11
|
+
2. Compose vertical rhythm with Stack and wrapping rows with Inline. Surface
|
|
12
|
+
represents a real container/elevation, not a wrapper around every element.
|
|
13
|
+
3. Keep action widths intrinsic. A full-width action is an explicit host choice.
|
|
14
|
+
Controls fill a responsive form parent such as min(100%, 26rem); min-inline-size:0
|
|
15
|
+
belongs on constrained grid/flex children. Inspect the actual wrapper tree.
|
|
16
|
+
4. Keep a choice glyph and its label together: .5rem within Checkbox/Radio/Switch;
|
|
17
|
+
use an explicit Inline gap="4" (1rem) between separate choices. Center the row;
|
|
18
|
+
never use space-between to pull a single label away from its indicator.
|
|
19
|
+
5. Use Field's callback props on the control. Keep name/value/required/form/reset
|
|
20
|
+
behavior and wire submission/validation in the host. Button type defaults to
|
|
21
|
+
button, so choose submit/reset deliberately. Link navigates.
|
|
22
|
+
6. Standalone secondary actions use subtle. Ghost needs an existing toolbar or
|
|
23
|
+
clear parent context. Loading must leave a meaningful action name.
|
|
24
|
+
|
|
25
|
+
In Next.js import CSS once in app/layout.tsx. State, event callbacks and Field's
|
|
26
|
+
function child belong in a client component. Keep serializable compositions on
|
|
27
|
+
the server where useful. Flood does not save data or define permissions.
|
|
28
|
+
|
|
29
|
+
Use IconSlot for host SVGs and IconButton for named icon-only actions. Retain
|
|
30
|
+
the icon license; slot dimensions must control the artwork. A local semantic
|
|
31
|
+
adapter such as @/ui/button may re-export Flood, but does not change React APIs.
|
|
32
|
+
|
|
33
|
+
Before handing off, inspect a real composed screen at narrow and wide widths,
|
|
34
|
+
not only isolated controls. See [verification](verification.md).
|
|
35
|
+
|
|
36
|
+
For constrained overflow, use installed ScrollArea when available. Set height or
|
|
37
|
+
maxHeight on its viewport, choose the needed axis, and provide a useful accessible
|
|
38
|
+
name. Rails overlay content with insets; keep essential content out of the rail
|
|
39
|
+
zone through the default `contentInset="scrollbar"`. Use explicit `"none"` only
|
|
40
|
+
when host padding already protects essential content, or overlap is intentional.
|
|
41
|
+
The engine
|
|
42
|
+
shortens rails near rounded clipping corners; do not add ad-hoc per-page rail
|
|
43
|
+
offsets. Do not hide native scrolling as a CSS-only
|
|
44
|
+
substitute for an overlay engine. Check wheel, touch, keyboard, thumb drag, resize
|
|
45
|
+
and RTL; preserve the native forced-colors fallback.
|
|
46
|
+
|
|
47
|
+
## label and group foundations
|
|
48
|
+
|
|
49
|
+
Field already composes Label. Use standalone Label when assembling an associated
|
|
50
|
+
control outside Field; its required marker does not set native required. Keep IDs
|
|
51
|
+
unique. Use Fieldset and its legend for related controls, with hint/message/error
|
|
52
|
+
on the group and individual labels on each control. A disabled native fieldset
|
|
53
|
+
disables descendants except controls in its first legend. Fieldset does not own
|
|
54
|
+
selected values or replace a RadioGroup/CheckboxGroup selection contract. Preserve
|
|
55
|
+
these semantics in nested groups and native form submission.
|
|
56
|
+
|
|
57
|
+
## selection groups
|
|
58
|
+
|
|
59
|
+
Use RadioGroup for one string value and CheckboxGroup for a string array. Supply
|
|
60
|
+
name, legend and options with unique values; disable individual options when
|
|
61
|
+
needed. Use value/onValueChange for host-controlled selection, or defaultValue
|
|
62
|
+
for local selection. RadioGroup required is native; validate CheckboxGroup
|
|
63
|
+
selection counts in the host. Read repeated checkbox form values with getAll.
|
|
64
|
+
The group forwards Fieldset descriptions/status and native form ownership.
|
|
65
|
+
Form reset restores uncontrolled defaults and preserves controlled values;
|
|
66
|
+
canceled reset is ignored and reset does not emit onValueChange.
|
|
67
|
+
|
|
68
|
+
## connected controls
|
|
69
|
+
|
|
70
|
+
ButtonGroup contains direct Button/IconButton actions with compatible sizes and
|
|
71
|
+
an accessible group label. Tab navigation is ordinary; do not invent toolbar
|
|
72
|
+
arrow-key behavior. InputGroup wraps one native text-like Input; Field callback
|
|
73
|
+
props and ref target that input. start/end slots provide host-owned text/icons/
|
|
74
|
+
actions; they are not submitted values or labels. className/style own the wrapper.
|
|
75
|
+
Disable addon actions explicitly when the task needs it. Preserve a single field
|
|
76
|
+
perimeter and distinguish input focus from action focus. Use supported installed
|
|
77
|
+
exports; these constructs are available in 0.2.3.
|
|
78
|
+
|
|
79
|
+
Nested actions in InputGroup use the group's height and equal space-1 optical
|
|
80
|
+
insets, with inner radius = field radius minus inset. Button size still controls
|
|
81
|
+
text/icon/padding; do not compensate with extra margins. Touch targets may grow
|
|
82
|
+
the shell. Text-only addons keep the field's reading padding.
|
|
83
|
+
|
|
84
|
+
ButtonGroup accepts Button and named IconButton children, including mixed groups;
|
|
85
|
+
full separators follow its orientation. InputGroup start/end independently accept
|
|
86
|
+
short text, decorative icons or named actions. Plain addons are subtle; actions
|
|
87
|
+
keep action colors. Explain units in the label/description. Prefixes are not masks
|
|
88
|
+
or automatically submitted value fragments; compose complete values in the host.
|
|
89
|
+
|
|
90
|
+
Toggle is a pressed native action: keep its name stable, use pressed/onPressedChange
|
|
91
|
+
or defaultPressed, and label iconOnly artwork. ToggleGroup uses unique options
|
|
92
|
+
and string-array values in both single/multiple modes; single can be cleared.
|
|
93
|
+
Arrow/Home/End navigate focus; Enter/Space activate; ordinary Tab order remains.
|
|
94
|
+
Do not use these as form inputs, required radios or tabs. No automatic native
|
|
95
|
+
form reset/submission is provided. Default props initialize only; host state owns
|
|
96
|
+
controlled values. Available in 0.2.3.
|
|
97
|
+
|
|
98
|
+
SegmentedControl composes native RadioGroup for one value/mode: label, unique form
|
|
99
|
+
name and string-label options, with optional artwork. Use value/onValueChange or
|
|
100
|
+
defaultValue; it does not clear when the selected item is pressed again. Arrows
|
|
101
|
+
select, Home/End select endpoints, Space checks; Enter keeps native form behavior.
|
|
102
|
+
Native form/required/disabled/reset behavior remains. Use actual tabs for panels,
|
|
103
|
+
not SegmentedControl. Choose short labels, icons or vertical orientation for
|
|
104
|
+
constrained widths; fullWidth distributes segments equally. iconOnly retains
|
|
105
|
+
accessible option labels. Available in 0.2.3.
|
|
106
|
+
|
|
107
|
+
Collapsible: title + children, open/onOpenChange or defaultOpen. Accordion composes
|
|
108
|
+
Collapsible via unique value/title/content items; string-array selection in single
|
|
109
|
+
(one or none) or multiple expansionMode. Choose headingLevel for host structure.
|
|
110
|
+
Enter/Space activate; Accordion Up/Down/Home/End focus enabled top-level headers,
|
|
111
|
+
not nested disclosures. Panels stay mounted and hidden, so form values and native
|
|
112
|
+
constraints persist. Disabled only prevents trigger activation. Programmatic
|
|
113
|
+
closing returns panel focus to an enabled trigger if focus has not moved elsewhere;
|
|
114
|
+
host owns focus for removed/disabled triggers. Only chevron motion, reduced-motion
|
|
115
|
+
aware; no height animation or per-panel landmark flood. Available in 0.2.3.
|
|
116
|
+
|
|
117
|
+
Tooltip/Popover/Dialog: trigger is a render function; forward every
|
|
118
|
+
supplied prop/ref to one connected visible Button in the same document. Tooltip
|
|
119
|
+
content is text only. Use Popover for interactive contextual UI and Dialog for a
|
|
120
|
+
modal task. Controlled open/onOpenChange needs host updates; initial defaults are
|
|
121
|
+
not synchronization. Closed Popover/Dialog children unmount, so keep persistent
|
|
122
|
+
form values in host state. initialFocusRef chooses a safe element in the panel;
|
|
123
|
+
closeLabel localizes the explicit close action. Native top-layer APIs preserve
|
|
124
|
+
FloodRoot theme scope without body portals. Avoid overriding positioning fields.
|
|
125
|
+
Native Popover/dialog support is required, no legacy polyfill. Available in 0.2.3.
|
|
126
|
+
|
|
127
|
+
Link defaults to text; opt-in solid/subtle/outline/ghost and
|
|
128
|
+
Button sizes share the button recipe without changing native anchor semantics.
|
|
129
|
+
Use href/target for navigation, Button for actions; never nest the two or add
|
|
130
|
+
role=button. Link has no disabled/loading contract. Available in 0.2.3.
|
|
131
|
+
Tabs switches linked content panels (not modes or radio values) on a shared
|
|
132
|
+
contained surface. Avoid a second enclosing card inside the panel; selected fill
|
|
133
|
+
joins the panel without an additional underline. Arrows activate by default,
|
|
134
|
+
or focus only with activationMode=manual; Enter/Space commit. One tab
|
|
135
|
+
stop, RTL/orientation aware, disabled skip. Panels stay mounted/hidden and retain
|
|
136
|
+
native form constraints. Controlled/missing/disabled selected values derive first
|
|
137
|
+
available; host reconciles values. Breadcrumb is an ordered native link hierarchy,
|
|
138
|
+
last item current. Pagination is controlled page/pageCount with onPageChange or
|
|
139
|
+
getHref; host owns data/routes and empty states. Counts must be positive safe
|
|
140
|
+
integers in range; siblingCount 0/1/2 bounds window size. Native modifier navigation,
|
|
141
|
+
localized names, unavailable endpoints and narrow wrapping stay intact. Available in 0.2.3.
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## Metadata, loading and identity · 0.2.4
|
|
145
|
+
|
|
146
|
+
Use Badge for noninteractive metadata with meaningful text. Spinner is indeterminate loading; use decorative inside a control already named by its owner. Button loading already composes it. Skeleton reserves geometry and is always hidden from AT; the host owns aria-busy and loading text. Avatar requires name and supports src/fallback; choose decorative beside an equivalent visible name. Keep image and fallback geometry fixed. None of these primitives fetch data or provide upload behavior.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
Progress is task completion; omit value for unknown progress. Meter is a bounded measurement and always requires value. Both need label and finite increasing ranges; invalid values throw. Use valueText for localized units and hideLabel for visually hidden captions. Wrapper refs and native div props do not replace the internal range semantics. Alert is inline feedback: title optional, host actions inside children, icon=null to omit artwork. Tone and announcement are independent. No task manager, validation engine, automatic dismissal or Toast queue is supplied. Available in 0.2.4.
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
DescriptionList uses native dl/dt/dd for related readonly properties; use unique item IDs, meaningful term text and formatted description content. Inline layout stacks according to container width; it does not label editable controls. Table owns caption and a horizontal Flood ScrollArea. Supply native table sections and correct th scope/id/headers relationships; className/style/ref target the actual table. Use data-numeric for numeric cells and style.minWidth for wide tables. Cell actions stay ordinary focusable controls; do not imply DataTable sorting, selection or fetching. Available in 0.2.4.
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
Menu is a dedicated action-menu contract, not Popover with arbitrary buttons. Forward supplied trigger props/ref to Button/IconButton. Use unique IDs and nonempty labels; separators are noninteractive, disabled items discoverable but inert, danger is visual intent only. onAction requests closing then calls host logic. No href, submenu or checkbox/radio behavior is supplied. Items/shortcuts do not install global key bindings. Place Table row actions inside a cell, with an IconButton name that includes the row identity. Available in 0.2.4.
|
|
156
|
+
|
|
157
|
+
Toolbar groups actions with one Tab entry after hydration. Use Button/IconButton/Toggle, native buttons/links and Menu triggers. Arrows move focus; Enter/Space activate the native control. Keep independent selection widgets and text fields outside this action-only toolbar. In a vertical toolbar Enter/Space opens Menu; Up/Down remain toolbar navigation. Use Kbd for display-only keyboard hints and implement actual bindings in the host. Available in 0.2.4.
|
|
158
|
+
|
|
159
|
+
Card is structured Surface containment: title/description/header actions, body children and footer. Missing slots add no empty sections. Choose compact/comfortable density; preserve the tight title-description relationship. Use appropriate headingLevel. Keep root noninteractive and place named controls inside, never a card-wide click handler around nested actions. Use Surface for unstructured containment.
|
|
160
|
+
|
|
161
|
+
Compose lower-level responsibilities: Container/Grid and Stack/Inline arrange; Surface contains; Card structures; Image/AspectRatio reserve media; List preserves native li. EmptyState composes the shared typography/icon/action atoms. Use VisuallyHidden for supplemental noninteractive text or focusable reveal for skip links. Do not replace native caption/legend structures with generic wrappers solely for reuse. Mixed Checkbox is host-owned aggregation, with checked still controlling submission.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Customize without a parallel system
|
|
2
|
+
|
|
3
|
+
Use FloodRoot for the neutral/dark foundations profile. The new light foundations
|
|
4
|
+
profile is not supplied; do not infer it from legacy controls outside FloodRoot.
|
|
5
|
+
|
|
6
|
+
Read the installed @flood-md/tokens foundation manifest and matching DESIGN.md.
|
|
7
|
+
Override semantic --flood-sys-* variables on a deliberate host scope after the
|
|
8
|
+
Flood stylesheet. Reuse existing content, surface, state, typography, spacing,
|
|
9
|
+
radius and control roles before adding a local application token. State which
|
|
10
|
+
role changes, why and which components consume it.
|
|
11
|
+
|
|
12
|
+
Do not edit generated node_modules assets, paste a second raw color scale into
|
|
13
|
+
components or invent unsupported token names. In the Flood source repository,
|
|
14
|
+
tokens are authored only in packages/tokens/src/tokens.json; generated files
|
|
15
|
+
are outputs. A consuming application's overrides remain application-owned.
|
|
16
|
+
|
|
17
|
+
Keep reference values separate from semantic roles. Component recipes consume
|
|
18
|
+
roles, and screen composition consumes components. An accent/material experiment
|
|
19
|
+
must be scoped; it must not silently alter ordinary fields, text or focus.
|
|
20
|
+
|
|
21
|
+
Keep layout/typography in rem, role line heights and tracking intact unless the
|
|
22
|
+
task explicitly changes them. Never impose a root 16px or 62.5% reset. Bundled
|
|
23
|
+
Inter retains its OFL notice; external icon/font assets keep their own notices.
|
|
24
|
+
|
|
25
|
+
Verify resolved token values, all affected states and surfaces, WCAG/APCA text
|
|
26
|
+
context, focus/non-text contrast, forced colors, narrow layout and text scaling.
|
|
27
|
+
An attractive default screenshot does not validate an override across a product.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Route work to its source
|
|
2
|
+
|
|
3
|
+
Read the host's instructions before Flood guidance. User requirements define the
|
|
4
|
+
task; Flood's contracts explain supported implementation. These files do not
|
|
5
|
+
override user authority or grant permission for unrelated operations.
|
|
6
|
+
|
|
7
|
+
| Question / when | Audience | Prerequisite | Source of truth | Verify with |
|
|
8
|
+
| --- | --- | --- | --- | --- |
|
|
9
|
+
| Which API can I import? Every component edit | Developer / agent | Installed exact versions | Installed @flood-md/react declarations; flood.json | Type-check host imports; CLI doctor for alignment |
|
|
10
|
+
| What does this release mean? Setup / upgrade | Developer / agent | Matching guide | flood/DESIGN.md, package changelog | Compare version and declarations; preserve host edits |
|
|
11
|
+
| How should a screen fit together? Screen / form work | Designer / developer / agent | Scope, content and current API | composition.md; host layout requirements | Narrow/wide rendered screen and native form interaction |
|
|
12
|
+
| Why does spacing look wrong? Density / nested geometry | Designer / developer / agent | Installed tokens and actual wrapper tree | spacing.md; host content hierarchy | Measured visible gaps, row pitch, text reflow and touch targets |
|
|
13
|
+
| What must remain accessible? Control/state work | Developer / reviewer / agent | Named controls and actual host context | accessibility.md; installed component contract | Keyboard, accessible names, validation and focus checks |
|
|
14
|
+
| How can appearance change? Theme / density work | Designer / developer / agent | Existing semantic roles | customization.md; installed token manifest | Inspect resolved roles, contrast and reflow |
|
|
15
|
+
| Is this done? Completion / regression | Reviewer / agent | Runnable host and checks | verification.md; project scripts | Report commands, manual checks and gaps |
|
|
16
|
+
| Which rules apply? Planning / review | Human / agent / tooling | Same installed guide set | flood/rules.json | Rule IDs linked to evidence, not a blanket pass |
|
|
17
|
+
|
|
18
|
+
References are beside this file. In an initialized project the contract and
|
|
19
|
+
rules are under project-root flood/. On the website these files are under
|
|
20
|
+
/agent/references/ and /agent/. Use installed files for existing applications;
|
|
21
|
+
the deployed website describes its own source/release status.
|
|
22
|
+
|
|
23
|
+
For exact per-component examples and API tables, read the matching component
|
|
24
|
+
Markdown page. Do not load every component page or all references by default.
|
|
25
|
+
Public source catalog/declarations generate website API tables during builds;
|
|
26
|
+
the website is not a replacement for the host's installed declarations.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Spacing, density and nested geometry
|
|
2
|
+
|
|
3
|
+
Use this guide when composing Flood controls or correcting excessive gaps,
|
|
4
|
+
inconsistent grouping or shifting previews. Start with host instructions, the
|
|
5
|
+
installed declarations and token manifest. User-approved geometry takes precedence
|
|
6
|
+
over a generic recipe; newer website examples do not add APIs to an older package.
|
|
7
|
+
|
|
8
|
+
## Identify the relationship
|
|
9
|
+
|
|
10
|
+
Decide what each space separates: an indicator and its label, a title and its
|
|
11
|
+
description, choices in one group, independent actions, sections or nested surfaces.
|
|
12
|
+
Keep related content together and give unrelated sections a stronger separation.
|
|
13
|
+
One gap value should not be repeated indiscriminately through nested wrappers.
|
|
14
|
+
|
|
15
|
+
| Relationship | Starting point; check the installed recipe |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Indicator and its own label | Existing choice component geometry; do not add another wrapper gap |
|
|
18
|
+
| Title and supporting description | A close pair, typically space-1 in the current Fieldset recipe |
|
|
19
|
+
| Repeated choices | Group row height already provides separation; inspect it before adding gap |
|
|
20
|
+
| Separate horizontal actions | Explicit parent spacing; space-4 is a starting point |
|
|
21
|
+
| Sections | Host content hierarchy and available width |
|
|
22
|
+
|
|
23
|
+
These are contextual defaults rather than a universal scale. Prefer supported
|
|
24
|
+
Stack/Inline spacing props and scoped semantic tokens. Host layout CSS owns host
|
|
25
|
+
spacing. Do not edit installed package files or invent unavailable component props
|
|
26
|
+
to change density. Use relative units and preserve the host's root font size.
|
|
27
|
+
|
|
28
|
+
## Measure visible geometry
|
|
29
|
+
|
|
30
|
+
Inspect the rendered interface, wrapper tree and computed gap, padding, margin,
|
|
31
|
+
line-height, minimum height and alignment. Measure the visible indicator/text as
|
|
32
|
+
well as the full interactive row. A zero flex gap can still look widely spaced.
|
|
33
|
+
|
|
34
|
+
For equal centered rows, indicator separation is approximately row height minus
|
|
35
|
+
indicator height plus row gap. A 40px row plus an 8px gap creates 48px row pitch;
|
|
36
|
+
the gap declaration alone does not describe perceived density. Those numbers
|
|
37
|
+
illustrate the calculation, not a fixed recipe for every installed release.
|
|
38
|
+
|
|
39
|
+
Remove redundant space at its owning layer. Preserve explicit icon dimensions,
|
|
40
|
+
the relationship between indicator and label, and independent form semantics.
|
|
41
|
+
Avoid negative margins or transforms that conceal a layout problem or overlap
|
|
42
|
+
click targets. For nested surfaces, compare inner radius with outer radius minus
|
|
43
|
+
padding and stroke; independent controls retain their own radius recipe.
|
|
44
|
+
|
|
45
|
+
## Check the composition
|
|
46
|
+
|
|
47
|
+
- Inspect short and wrapping labels, narrow/wide widths and larger root text.
|
|
48
|
+
Rows may grow for content; do not clip text to enforce a compact height.
|
|
49
|
+
- Check hint, error, status, loading and disabled cases where applicable.
|
|
50
|
+
Different content must not unexpectedly reposition an unrelated demo control.
|
|
51
|
+
- Distinguish the component from its preview host. Fixed scenes and reserved
|
|
52
|
+
message rows belong to a demo when needed, not automatically to a host product.
|
|
53
|
+
- Check fine and coarse pointers separately. Compact mouse geometry must preserve
|
|
54
|
+
the supported touch-target minimum and nonoverlapping hit areas on touch.
|
|
55
|
+
- Recheck keyboard focus, label activation and a sibling that shares the recipe.
|
|
56
|
+
|
|
57
|
+
Use actual screenshots and measured geometry to judge the result. Follow the
|
|
58
|
+
host's verification workflow; add a regression check for a repeated failure rather
|
|
59
|
+
than a test that merely repeats a CSS declaration. Report what was measured and
|
|
60
|
+
what remains unverified. See [accessibility](accessibility.md) and
|
|
61
|
+
[verification](verification.md) for related contracts.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Verify the actual change
|
|
2
|
+
|
|
3
|
+
Use the host's scripts and conventions; do not assume Flood's repository scripts
|
|
4
|
+
exist in a consumer. Run the matching CLI doctor for version/file alignment when
|
|
5
|
+
setup or upgrades changed. Doctor does not parse CSS imports or certify UI.
|
|
6
|
+
|
|
7
|
+
| Change | Evidence needed |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Imports / package upgrade | Host type-check/build; installed versions and declarations match |
|
|
10
|
+
| Form / control behavior | Labels/descriptions, keyboard, value/submission, required/invalid, reset, disabled/loading and focus |
|
|
11
|
+
| Layout / typography | Actual narrow and wide screen, long content, root 24px text sizing and increased text spacing; no accidental page overflow |
|
|
12
|
+
| Appearance / tokens | Resolved roles and actual surfaces/states; contrast, focus, forced colors and reduced motion |
|
|
13
|
+
| Copy / external actions | Exact clipboard payload where applicable; honest local/saved/sent state and error feedback |
|
|
14
|
+
|
|
15
|
+
For visual changes capture and inspect the rendered screen. A passing build does
|
|
16
|
+
not show alignment, hierarchy or wrapping. Use meaningful existing browser tests
|
|
17
|
+
and an accessibility scanner when available; also perform keyboard checks.
|
|
18
|
+
|
|
19
|
+
In the Flood source repository run npm run verify, and browser tests for changed
|
|
20
|
+
behavior/styles. In a consuming project use its equivalent checks. Report commands
|
|
21
|
+
run and results, manual visual/keyboard checks, and anything left unverified.
|
|
22
|
+
Use rule IDs from project-root flood/rules.json when useful to connect findings
|
|
23
|
+
to the specific contract. Do not report a rule as tested from prose alone.
|
|
24
|
+
|
|
25
|
+
Never infer npm publication, a deployment or a backend save from a local build.
|
|
26
|
+
Updating an installed guide is a review/merge task: preserve customized files;
|
|
27
|
+
do not rerun init to overwrite them. No reference grants authority to deploy,
|
|
28
|
+
delete data or transmit private source.
|
|
29
|
+
|
|
30
|
+
Check both normal and italic font loading where emphasis is used; matching font-family text alone does not establish that the face loaded. For responsive geometry verify320px plus enlarged root text/RTL in the actual served production assets, not only injected source CSS. Exercise local overflow by focusing the final action/item and verify content is not beneath a scrollbar. Test failed/missing images and absent component slots without inventing loading/fallback promises.
|
package/rules.json
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"scope": "Installed Flood React/Next.js projects",
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"id": "api.installed",
|
|
7
|
+
"when": "Importing or changing Flood APIs",
|
|
8
|
+
"for": [
|
|
9
|
+
"developer",
|
|
10
|
+
"agent"
|
|
11
|
+
],
|
|
12
|
+
"requires": [
|
|
13
|
+
"Host package.json",
|
|
14
|
+
"flood.json"
|
|
15
|
+
],
|
|
16
|
+
"sourceOfTruth": "Installed @flood-md/react declarations",
|
|
17
|
+
"guide": "references/routing.md",
|
|
18
|
+
"verify": [
|
|
19
|
+
"Host type-check",
|
|
20
|
+
"Matching CLI doctor for package alignment"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "composition.primitives",
|
|
25
|
+
"when": "Composing screens or forms",
|
|
26
|
+
"for": [
|
|
27
|
+
"designer",
|
|
28
|
+
"developer",
|
|
29
|
+
"agent"
|
|
30
|
+
],
|
|
31
|
+
"requires": [
|
|
32
|
+
"Supported installed exports",
|
|
33
|
+
"User interaction requirements"
|
|
34
|
+
],
|
|
35
|
+
"sourceOfTruth": "DESIGN.md",
|
|
36
|
+
"guide": "references/composition.md",
|
|
37
|
+
"verify": [
|
|
38
|
+
"Rendered narrow/wide screen",
|
|
39
|
+
"Intrinsic actions and responsive form parent",
|
|
40
|
+
"Close choice label and independent group spacing",
|
|
41
|
+
"Reuse shared atoms while preserving specialized native semantics",
|
|
42
|
+
"Container/grid/media geometry at320px and enlarged RTL text",
|
|
43
|
+
"No invisible focusable content without reveal behavior"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "forms.associations",
|
|
48
|
+
"when": "Changing fields or submission",
|
|
49
|
+
"for": [
|
|
50
|
+
"developer",
|
|
51
|
+
"reviewer",
|
|
52
|
+
"agent"
|
|
53
|
+
],
|
|
54
|
+
"requires": [
|
|
55
|
+
"Visible labels",
|
|
56
|
+
"Host validation and submission flow"
|
|
57
|
+
],
|
|
58
|
+
"sourceOfTruth": "Installed Field/control contract",
|
|
59
|
+
"guide": "references/accessibility.md",
|
|
60
|
+
"verify": [
|
|
61
|
+
"Accessible names and descriptions",
|
|
62
|
+
"Native values, required and reset",
|
|
63
|
+
"Invalid focus and disabled/loading behavior"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "interaction.keyboard",
|
|
68
|
+
"when": "Changing interactive controls",
|
|
69
|
+
"for": [
|
|
70
|
+
"developer",
|
|
71
|
+
"reviewer",
|
|
72
|
+
"agent"
|
|
73
|
+
],
|
|
74
|
+
"requires": [
|
|
75
|
+
"Runnable screen",
|
|
76
|
+
"Installed control keyboard contract"
|
|
77
|
+
],
|
|
78
|
+
"sourceOfTruth": "Installed component behavior and DESIGN.md",
|
|
79
|
+
"guide": "references/accessibility.md",
|
|
80
|
+
"verify": [
|
|
81
|
+
"Keyboard-only full interaction",
|
|
82
|
+
"Visible focus in every relevant state",
|
|
83
|
+
"Select commit/cancel if present"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "theme.semantic",
|
|
88
|
+
"when": "Customizing visual roles",
|
|
89
|
+
"for": [
|
|
90
|
+
"designer",
|
|
91
|
+
"developer",
|
|
92
|
+
"agent"
|
|
93
|
+
],
|
|
94
|
+
"requires": [
|
|
95
|
+
"Installed token manifest",
|
|
96
|
+
"Actual affected surfaces"
|
|
97
|
+
],
|
|
98
|
+
"sourceOfTruth": "Installed token roles; source tokens.json when developing Flood",
|
|
99
|
+
"guide": "references/customization.md",
|
|
100
|
+
"verify": [
|
|
101
|
+
"Resolved scoped semantic values",
|
|
102
|
+
"Text and non-text contrast",
|
|
103
|
+
"No parallel raw palette"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "layout.reflow",
|
|
108
|
+
"when": "Changing layout or type",
|
|
109
|
+
"for": [
|
|
110
|
+
"designer",
|
|
111
|
+
"reviewer",
|
|
112
|
+
"agent"
|
|
113
|
+
],
|
|
114
|
+
"requires": [
|
|
115
|
+
"Actual composed screen"
|
|
116
|
+
],
|
|
117
|
+
"sourceOfTruth": "DESIGN.md and host content requirements",
|
|
118
|
+
"guide": "references/composition.md",
|
|
119
|
+
"verify": [
|
|
120
|
+
"320px width",
|
|
121
|
+
"Root 24px and increased text spacing",
|
|
122
|
+
"No glyph shrink or unintended page overflow"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "verification.evidence",
|
|
127
|
+
"when": "Reporting completion",
|
|
128
|
+
"for": [
|
|
129
|
+
"developer",
|
|
130
|
+
"reviewer",
|
|
131
|
+
"agent"
|
|
132
|
+
],
|
|
133
|
+
"requires": [
|
|
134
|
+
"Host verification scripts",
|
|
135
|
+
"Task scope"
|
|
136
|
+
],
|
|
137
|
+
"sourceOfTruth": "Observed command and rendered behavior results",
|
|
138
|
+
"guide": "references/verification.md",
|
|
139
|
+
"verify": [
|
|
140
|
+
"Commands and actual results recorded",
|
|
141
|
+
"Manual checks distinguished",
|
|
142
|
+
"Untested behavior stated"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "installation.preserve",
|
|
147
|
+
"when": "Installing or updating guidance",
|
|
148
|
+
"for": [
|
|
149
|
+
"developer",
|
|
150
|
+
"agent"
|
|
151
|
+
],
|
|
152
|
+
"requires": [
|
|
153
|
+
"Existing host instructions",
|
|
154
|
+
"User scope"
|
|
155
|
+
],
|
|
156
|
+
"sourceOfTruth": "Host files and version-matched guide set",
|
|
157
|
+
"guide": "references/routing.md",
|
|
158
|
+
"verify": [
|
|
159
|
+
"Existing files preserved",
|
|
160
|
+
"No linked destinations followed",
|
|
161
|
+
"No publication inferred from source version"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "layout.spacing",
|
|
166
|
+
"when": "Composing or reviewing spacing, density, nested surfaces or moving previews",
|
|
167
|
+
"for": [
|
|
168
|
+
"designer",
|
|
169
|
+
"developer",
|
|
170
|
+
"agent"
|
|
171
|
+
],
|
|
172
|
+
"requires": [
|
|
173
|
+
"Installed token manifest",
|
|
174
|
+
"Rendered host and actual wrapper tree"
|
|
175
|
+
],
|
|
176
|
+
"sourceOfTruth": "Installed component recipe and host layout requirements",
|
|
177
|
+
"guide": "references/spacing.md",
|
|
178
|
+
"verify": [
|
|
179
|
+
"Measure visible gaps and row pitch, including padding and minimum height",
|
|
180
|
+
"Check wrapping and enlarged text",
|
|
181
|
+
"Check fine/coarse pointers and nonoverlapping interactive targets",
|
|
182
|
+
"Preserve keyboard focus and label activation"
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"guideResolution": "Match guide to source in manifest.files; use its target relative to the host project root."
|
|
187
|
+
}
|