@flood-md/agent 0.2.3 → 0.2.5

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 CHANGED
@@ -1,17 +1,17 @@
1
- # Flood design system · 0.2.3
1
+ # Flood design system · 0.2.5
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.3; existing installations
7
+ relevant reference. This expanded bundle belongs to 0.2.5; 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 all 37 exports in 0.2.3 and their layout refinements. Confirm
14
+ This guide covers the supported exports in 0.2.5 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.5 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.5. 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.5. 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.5; 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.5)
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.5)
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.5
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.3 reference bundle includes spacing
4
+ contract before composing screens. The 0.2.5 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
@@ -53,7 +53,7 @@
53
53
  "kind": "reference"
54
54
  }
55
55
  ],
56
- "version": "0.2.3",
56
+ "version": "0.2.5",
57
57
  "installedEntry": ".agents/skills/flood-ui/SKILL.md",
58
58
  "pathBase": "source is package-relative; target is relative to the host project root"
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flood-md/agent",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "Versioned Flood design instructions for coding agents.",
6
6
  "license": "MIT",
@@ -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; do not hide interactive label content. Use it only where surrounding
50
- context supplies the visible meaning. Input/Textarea/Select/InputGroup configure
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,131 @@ 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.
162
+
163
+ NumberInput composes InputGroup/Input/IconButton for finite numeric values or null.
164
+ Use Field for label and feedback, min/max/step for native validity and explicit
165
+ translated increaseLabel/decreaseLabel for step actions. Do not replace it with a
166
+ styled text box that loses numeric forms. Slider receives an array of one value or
167
+ an ordered pair; use thumbLabels to distinguish bounds, preserve native keyboard
168
+ controls and keep explanatory feedback visible. Range handles cannot cross.
169
+ Both support controlled/uncontrolled state, form reset and read-only presentation.
170
+ Available in 0.2.5; do not imply registry availability.
171
+
172
+ Combobox is editable single selection from explicit option values. Use Field for
173
+ its input name/description associations, never submit typed search text as an ID.
174
+ Arrow keys move the active suggestion; Enter commits, Escape cancels the search.
175
+ Use descriptive labels/keywords, keep disabled choices inert, and translate the
176
+ list/clear/toggle/empty/validation messages. Read-only selection remains selectable
177
+ for copying. Native forms/reset and required validity apply to the selected ID.
178
+ Do not imply freeform values, async fetching, multiple selection or virtualization.
179
+
180
+ Tag is label content with an optional named native removal action; it is not a
181
+ status Badge or Toggle. The host owns removal/state and standalone focus recovery.
182
+ Provide removeLabel for rich content and localization. MultiSelect composes Tag
183
+ and the shared Combobox search/layer model with an array of selected option IDs.
184
+ Never pass arrays to Combobox or submit search text as selected values. Use Field
185
+ for associations/feedback. Preserve repeated form entries, reset and required
186
+ selection validity. Disabled selected items stay selected through clear/remove;
187
+ read-only blocks edits. Do not shrink touch targets to force tags into a row.
188
+ Let tags wrap while the search editor and its suffix actions remain together.
189
+
190
+ Keep selection-field chrome calm: Combobox/MultiSelect show only the chevron by
191
+ default. Add clearable=true only when a separate clear-selection action is useful;
192
+ individual MultiSelect tags already expose named removal actions.
193
+
194
+
195
+ SearchInput and PasswordInput are field controls in 0.2.5.
196
+ Compose them with Field and pass its control props. SearchInput uses native search
197
+ editing and one clear action (clearable=true); the host owns filtering/submission.
198
+ Read-only hides clear. PasswordInput has a single show/hide action with localized
199
+ showPasswordLabel/hidePasswordLabel, controlled visible/onVisibleChange or initial
200
+ defaultVisible. Read-only still allows reveal. Native refs, autocomplete and forms
201
+ remain owned by the host. Do not add another suffix chevron or browser clear icon.
202
+
203
+
204
+ FileInput (0.2.5) composes a native file input with Flood field geometry,
205
+ IconSlot and one optional clear IconButton. Pass Field's render props for its
206
+ accessible name/description/status. Native name, form, required, accept, multiple,
207
+ capture and input ref remain available. onChange is a native React change handler;
208
+ onFilesChange receives a new readonly File array for selection and clear. Do not
209
+ pass value/defaultValue/readOnly; FileList belongs to the browser. Uncontrolled
210
+ form reset clears the summary; cancelling the chooser keeps its prior selection.
211
+ Localize placeholder and clearLabel. Long names truncate visually, and the host
212
+ owns upload, file validation and progress. accept only guides the chooser.
213
+
214
+
215
+ FileInput multiple selection exposes a collapsible file list with full names and
216
+ localized file sizes (lang controls number formatting), and a count in the picker.
217
+ Translate selectionLabel and removeFileLabel. Individual removal updates the native
218
+ FileList through DataTransfer, then emits the same change callbacks as selection.
219
+ Focus moves to the next/previous remove action, or back to the input when empty.
220
+ clearable=false disables individual and global removal UI. In multiple mode, picking again appends files to the current selection; cancel
221
+ preserves it. Repeated files are deduplicated by name, size, type, lastModified and
222
+ relative path, without reading their contents. Single mode replaces its selection. The host remains responsible for upload.
223
+
224
+
225
+ AlertDialog (0.2.5) is a concise confirmation, composed from Flood's
226
+ native modal layer and Button. Supply title, description, trigger and onConfirm.
227
+ Cancel receives initial focus; Escape cancels; outside clicks do not dismiss.
228
+ Tab containment, background inertness, scroll lock and return focus reuse Dialog.
229
+ Translate confirmLabel/cancelLabel. onConfirm runs before requesting close, while
230
+ onCancel covers Cancel/Escape. Use open/onOpenChange for controlled state and
231
+ confirmDisabled to disable confirmation. Callbacks are not awaited; the host owns
232
+ async requests, pending UI and errors. Use Dialog for forms/complex content.
233
+
234
+
235
+ Drawer (0.2.5) reuses Dialog's modal behavior with an edge-panel layout.
236
+ side is logical start/end (default end) or top/bottom; size sm/md/lg sets the
237
+ cross-axis extent to 20/26/34rem within the viewport. Vertical panels fill height,
238
+ horizontal panels fill width. Use footer for host-owned actions; only body content
239
+ scrolls with Flood ScrollArea. Header/close action/footer remain visible. Native
240
+ ref, controlled open/onOpenChange, outside dismissal and initialFocusRef match
241
+ Dialog. Translate closeLabel/title/description; reduced motion disables entry
242
+ animation. Closing is immediate. There is no swipe/drag gesture or auto-save logic.
243
+
244
+
245
+ The 0.2.5 separates floating surfaces from modal surfaces.
246
+ Nine additional semantic roles bring the dark profile to 193 roles; previous token
247
+ values remain intact. surface.floating is the opaque fallback;
248
+ surface.floating-translucent, border.floating, selection.floating, shadow.floating
249
+ and effect.floating blur/saturation/shadow-offset/shadow-blur define the floating
250
+ material. Select, Combobox, MultiSelect, Menu, Popover and Tooltip share it; Dialog
251
+ and Drawer retain surface.overlay. Backdrop filtering is progressive enhancement;
252
+ reduced transparency uses the opaque fill and forced colors use system colors.
253
+ Keep text opaque and evaluate it against the actual composited background.
254
+
255
+
256
+ Version 0.2.5 expansion includes AvatarGroup/StatusIndicator/Figure/
257
+ Blockquote/InlineCode/Metric/Timeline; NavigationList/Steps/Section/Split/Center/
258
+ SkipLink; ListBox/PinInput/Rating/Dropzone/CharacterCount; CopyButton/ToastRegion.
259
+ Compose these before inventing equivalent host wrappers. Read each generated
260
+ component contract and docs/base-components.md. Keep collection IDs stable, form
261
+ names explicit, labels localized, state meaning independent of color and visible
262
+ content within relative geometry. Native chooser/clipboard/OTP semantics do not
263
+ supply upload/auth/server logic. Toast queues, actions and navigation state remain
264
+ host-owned. No third-party component implementation was introduced.
265
+
266
+
267
+ Section headingLevel controls native h2–h6 semantics. Its independent headingSize
268
+ uses the existing Heading roles (section/page/large/display), defaulting to section.
269
+ Keep document hierarchy meaningful when changing visual emphasis.
@@ -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
  {