@flood-md/agent 0.2.3 → 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 +116 -3
- package/README.md +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/references/accessibility.md +18 -2
- package/references/composition.md +20 -0
- package/references/verification.md +2 -0
- package/rules.json +4 -1
package/DESIGN.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# Flood design system · 0.2.
|
|
1
|
+
# Flood design system · 0.2.4
|
|
2
2
|
|
|
3
3
|
Read project-root flood.json and installed declarations with this contract.
|
|
4
4
|
The source bundle's SKILL.md routes to focused composition, accessibility,
|
|
5
5
|
customization and verification references. Its routing matrix names prerequisites
|
|
6
6
|
and sources of truth; flood/rules.json indexes observable checks. Read only the
|
|
7
|
-
relevant reference. This expanded bundle belongs to 0.2.
|
|
7
|
+
relevant reference. This expanded bundle belongs to 0.2.4; existing installations
|
|
8
8
|
keep their matching guide set.
|
|
9
9
|
|
|
10
10
|
React + TypeScript and Next.js App Router. Use this guide with matching installed
|
|
11
11
|
Flood packages and flood.json. The source repository's release status does not
|
|
12
12
|
grant permission to publish or assume a version is available on npm.
|
|
13
13
|
|
|
14
|
-
This guide covers
|
|
14
|
+
This guide covers the supported exports in 0.2.4 and their layout refinements. Confirm
|
|
15
15
|
the matching installed declarations before using APIs absent from older versions.
|
|
16
16
|
|
|
17
17
|
## Connect
|
|
@@ -158,3 +158,116 @@ export function Profile() {
|
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
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,7 +1,7 @@
|
|
|
1
1
|
# @flood-md/agent
|
|
2
2
|
|
|
3
3
|
Version-matched guidance for Flood React/Next.js projects. Read the installed
|
|
4
|
-
contract before composing screens. The 0.2.
|
|
4
|
+
contract before composing screens. The 0.2.4 reference bundle includes spacing
|
|
5
5
|
guidance, routing and observable rules. These files grant
|
|
6
6
|
no authority to modify external services.
|
|
7
7
|
|
package/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -46,8 +46,10 @@ when a read-only field uses a dashed resting perimeter.
|
|
|
46
46
|
External-label visibility: source Field/Fieldset hideLabel preserves the actual
|
|
47
47
|
label/legend and accessible name while removing its visual row. RadioGroup,
|
|
48
48
|
CheckboxGroup and SegmentedControl inherit it. Keep label/legend supplied and
|
|
49
|
-
textual
|
|
50
|
-
|
|
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
|
|
51
53
|
this on their Field wrapper, not the control. Placeholder never replaces naming;
|
|
52
54
|
choice option labels and button names have separate contracts. Available in 0.2.3.
|
|
53
55
|
|
|
@@ -61,3 +63,17 @@ configurable. Provide a visible title and safe initialFocusRef when needed. Clos
|
|
|
61
63
|
Popover/Dialog children unmount; host owns persistent values and controlled open.
|
|
62
64
|
Modern native APIs required. DOM/theme scope stays intact; no body portal needed.
|
|
63
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.
|
|
@@ -139,3 +139,23 @@ last item current. Pagination is controlled page/pageCount with onPageChange or
|
|
|
139
139
|
getHref; host owns data/routes and empty states. Counts must be positive safe
|
|
140
140
|
integers in range; siblingCount 0/1/2 bounds window size. Native modifier navigation,
|
|
141
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.
|
|
@@ -26,3 +26,5 @@ Never infer npm publication, a deployment or a backend save from a local build.
|
|
|
26
26
|
Updating an installed guide is a review/merge task: preserve customized files;
|
|
27
27
|
do not rerun init to overwrite them. No reference grants authority to deploy,
|
|
28
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
CHANGED
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"verify": [
|
|
38
38
|
"Rendered narrow/wide screen",
|
|
39
39
|
"Intrinsic actions and responsive form parent",
|
|
40
|
-
"Close choice label and independent group spacing"
|
|
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"
|
|
41
44
|
]
|
|
42
45
|
},
|
|
43
46
|
{
|