@flood-md/agent 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/DESIGN.md +10 -1
  2. package/README.md +9 -4
  3. package/SKILL.md +16 -5
  4. package/dist/catalog.json +742 -214
  5. package/dist/materials/component-alert-dialog.md +1 -0
  6. package/dist/materials/component-app-shell.md +1 -1
  7. package/dist/materials/component-bar-chart.md +52 -0
  8. package/dist/materials/component-bar-list.md +41 -0
  9. package/dist/materials/component-box-plot.md +46 -0
  10. package/dist/materials/component-bullet-chart.md +43 -0
  11. package/dist/materials/component-code-snippet.md +3 -1
  12. package/dist/materials/component-collection-toolbar.md +2 -0
  13. package/dist/materials/component-command-palette.md +1 -0
  14. package/dist/materials/component-copy-button.md +2 -0
  15. package/dist/materials/component-dialog.md +2 -0
  16. package/dist/materials/component-donut-chart.md +46 -0
  17. package/dist/materials/component-drawer.md +2 -0
  18. package/dist/materials/component-dumbbell-chart.md +46 -0
  19. package/dist/materials/component-heatmap.md +45 -0
  20. package/dist/materials/component-histogram.md +46 -0
  21. package/dist/materials/component-image-preview.md +1 -0
  22. package/dist/materials/component-line-chart.md +50 -0
  23. package/dist/materials/component-menu.md +2 -0
  24. package/dist/materials/component-range-chart.md +46 -0
  25. package/dist/materials/component-scatter-chart.md +48 -0
  26. package/dist/materials/component-sheet.md +1 -0
  27. package/dist/materials/component-table.md +1 -1
  28. package/dist/materials/component-waterfall-chart.md +47 -0
  29. package/dist/materials/guide-agent-knowledge.md +5 -5
  30. package/dist/materials/guide-agents.md +35 -2
  31. package/dist/materials/guide-charts.md +34 -0
  32. package/dist/materials/guide-foundations.md +2 -2
  33. package/dist/materials/guide-installation.md +6 -6
  34. package/dist/materials/guide-introduction.md +2 -1
  35. package/dist/materials/guide-motion.md +12 -0
  36. package/dist/materials/guide-skills.md +10 -0
  37. package/dist/materials/recipe-collection-views.md +3 -0
  38. package/dist/materials/recipe-navigation-workspace.md +3 -0
  39. package/dist/materials/recipe-record-management.md +92 -58
  40. package/knowledge.json +16 -0
  41. package/lib/inspect.d.ts +14 -2
  42. package/lib/inspect.mjs +63 -9
  43. package/manifest.json +11 -1
  44. package/package.json +1 -1
  45. package/references/component-families.md +10 -0
  46. package/references/flood-composition/SKILL.md +7 -0
  47. package/references/flood-data-display/SKILL.md +85 -0
  48. package/references/flood-forms/SKILL.md +5 -0
  49. package/references/flood-overlays/SKILL.md +5 -0
  50. package/references/flood-records/SKILL.md +13 -4
  51. package/references/flood-screen-composition/SKILL.md +48 -0
  52. package/references/flood-verification/SKILL.md +32 -0
  53. package/references/flood-visual-review/SKILL.md +59 -0
  54. package/references/rendered-review.md +49 -3
  55. package/references/routing.md +2 -1
  56. package/rules.json +34 -2
  57. package/workflows.json +22 -0
@@ -37,6 +37,7 @@ export function Example() {
37
37
  | `defaultOpen` | `boolean` | `false` |
38
38
  | `onOpenChange` | `(open: boolean) => void` | `—` |
39
39
  | `disabled` | `boolean` | `—` |
40
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
40
41
  | `description` | `string` | `Required` |
41
42
  | `confirmLabel` | `string` | `"Continue"` |
42
43
  | `cancelLabel` | `string` | `"Cancel"` |
@@ -23,7 +23,7 @@ export function Example() {
23
23
 
24
24
  ## Design notes
25
25
 
26
- - Content scrolling keeps navigation, top bar and footer outside the work scrollport. Use scroll="page" for a document that scrolls as a whole.
26
+ - Use content scrolling for a full-window application, including record queues whose row count changes. It keeps the navigation, top bar and footer outside the work scrollport. Use scroll="page" for a document that scrolls as a whole.
27
27
  - Content mode uses Flood ScrollArea. Set scrollContentInset="none" when existing workspace padding clears the overlay rails and the content width needs to stay fixed.
28
28
  - Supply Sidebar for docked navigation. Set navigationDrawer with a shell-width threshold and Drawer content to swap automatically. Share accepted route and branch state between the two presentations.
29
29
  - Use mainAs="section" only when embedding a shell inside an existing main landmark.
@@ -0,0 +1,52 @@
1
+ # BarChart
2
+
3
+ Grouped or stacked columns for comparing values across categories on a shared zero baseline.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, BarChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <BarChart label="Hours by team" categories={["Product", "Design", "Growth"]}
19
+ series={[
20
+ {id:"actual", label:"Actual", values:[38, 29, 46]},
21
+ {id:"plan", label:"Plan", values:[32, 36, 40]}
22
+ ]} />
23
+ </FloodRoot>
24
+ );
25
+ }
26
+ ```
27
+
28
+ ## Design notes
29
+
30
+ - Use layout stacked for additive series. Positive and negative values accumulate independently on either side of zero. A custom domain must contain the cumulative bounds.
31
+ - Use layout percent for nonnegative shares on a fixed 0–100% scale. The readout shows each share of the observed total and its raw value. A zero total leaves the column empty and shows raw zeros. Supply formatShare to localize percentages.
32
+ - Series names appear in the inspection readout. Set showLegend when the key needs to be visible before interaction.
33
+ - Pass up to four series in display order with one value per category. Put the primary series first to give it the accent fill. Comparison series use outline and dash styling as well as color.
34
+ - Grouped columns start at zero and reserve empty slots for missing observations. In stacks, zero and missing observations take no space and remain distinguishable in the readout. Use the same domain to compare separate charts.
35
+ - Explore exact values by hovering, tapping, or using arrow keys, Home and End. Supply formatValue and translated empty, missing and navigation labels for other locales.
36
+
37
+ ## API reference
38
+
39
+ | Prop | Values | Default |
40
+ | --- | --- | --- |
41
+ | `label` | `string` | `Required` |
42
+ | `categories` | `readonly string[]` | `Required` |
43
+ | `layout` | `"grouped" \| "stacked" \| "percent"` | `—` |
44
+ | `series` | `readonly ChartSeries[]` | `Required` |
45
+ | `domain` | `readonly [number, number]` | `—` |
46
+ | `showLegend` | `boolean` | `—` |
47
+ | `formatValue` | `(value: number) => string` | `—` |
48
+ | `formatShare` | `(share: number) => string` | `—` |
49
+ | `emptyLabel` | `string` | `"No data"` |
50
+ | `missingLabel` | `string` | `"No value"` |
51
+ | `navigationLabel` | `string` | `"Use the arrow keys to explore categories, or Home and End to jump."` |
52
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -0,0 +1,41 @@
1
+ # BarList
2
+
3
+ A compact ranked list of named values on one scale.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, BarList } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <BarList label="Visits by page" items={[
19
+ {id:"overview", label:"Overview", value:214},
20
+ {id:"components", label:"Components", value:136}
21
+ ]} />
22
+ </FloodRoot>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Design notes
28
+
29
+ - Sort items before passing them in. The list preserves display order and uses a shared zero baseline. Pass the same max to compare separate lists.
30
+ - Each item uses a proportional background bar from Flood Meter. Labels and exact values share one row and stay aligned across the list. Supply valueText for units or localized formatting.
31
+
32
+ ## API reference
33
+
34
+ | Prop | Values | Default |
35
+ | --- | --- | --- |
36
+ | `label` | `string` | `Required` |
37
+ | `items` | `readonly BarListItem[]` | `Required` |
38
+ | `max` | `number` | `—` |
39
+ | `tone` | `"neutral" \| "accent" \| "error" \| "warning" \| "success" \| "info"` | `"accent"` |
40
+ | `emptyLabel` | `string` | `"No data"` |
41
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -0,0 +1,46 @@
1
+ # BoxPlot
2
+
3
+ Compare the median, quartiles and spread across groups, such as request latency by service.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, BoxPlot } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <BoxPlot label="Request latency (ms)" items={[
19
+ {id:"api", label:"API", summary:{low:42, q1:74, median:96, q3:128, high:176}, outliers:[203]},
20
+ {id:"search", label:"Search", summary:{low:32, q1:58, median:88, q3:154, high:210}}
21
+ ]} />
22
+ </FloodRoot>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Design notes
28
+
29
+ - Supply a five-number summary for each group. The box spans Q1 to Q3 and the white line marks the median. Supply whiskers and outliers using the same statistical convention across groups.
30
+ - Use null for a missing summary. Use the same domain across related charts and include all observations, including outliers.
31
+ - Hover, tap or use the arrow keys to inspect the summary and outlier count. Use formatAxisValue for shorter ticks when units are already visible. Set --flood-chart-plot-height on a shared parent to align plot heights with Histogram.
32
+
33
+ ## API reference
34
+
35
+ | Prop | Values | Default |
36
+ | --- | --- | --- |
37
+ | `label` | `string` | `Required` |
38
+ | `items` | `readonly BoxPlotItem[]` | `Required` |
39
+ | `domain` | `readonly [number, number]` | `—` |
40
+ | `formatValue` | `(value: number) => string` | `—` |
41
+ | `formatAxisValue` | `(value: number) => string` | `—` |
42
+ | `emptyLabel` | `string` | `—` |
43
+ | `missingLabel` | `string` | `—` |
44
+ | `navigationLabel` | `string` | `—` |
45
+ | `statisticLabels` | `Partial<Record<keyof BoxPlotSummary \| "outliers" \| "whiskers", string>>` | `—` |
46
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -0,0 +1,43 @@
1
+ # BulletChart
2
+
3
+ Actual values and targets on the same horizontal scale.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, BulletChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <BulletChart label="Resolved requests" max={100} items={[
19
+ {id:"web", label:"Web", value:74, target:80},
20
+ {id:"email", label:"Email", value:56, target:50}
21
+ ]} />
22
+ </FloodRoot>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Design notes
28
+
29
+ - Supply finite nonnegative actuals and targets in the same unit. Use a shared max to compare separate charts.
30
+ - The fill shows the actual value and the vertical marker shows the target. Both exact values are visible without interaction.
31
+
32
+ ## API reference
33
+
34
+ | Prop | Values | Default |
35
+ | --- | --- | --- |
36
+ | `label` | `string` | `Required` |
37
+ | `items` | `readonly BulletChartItem[]` | `Required` |
38
+ | `max` | `number` | `—` |
39
+ | `formatValue` | `(value: number) => string` | `—` |
40
+ | `valueLabel` | `string` | `—` |
41
+ | `targetLabel` | `string` | `—` |
42
+ | `emptyLabel` | `string` | `—` |
43
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -15,7 +15,7 @@ import "@flood-md/react/styles.css";
15
15
  export function Example() {
16
16
  return (
17
17
  <FloodRoot>
18
- <CodeSnippet code="git status --short" />
18
+ <CodeSnippet prompt="$" code="git status --short" />
19
19
  </FloodRoot>
20
20
  );
21
21
  }
@@ -24,6 +24,7 @@ export function Example() {
24
24
  ## Design notes
25
25
 
26
26
  - CodeSnippet escapes code content and uses the semantic system monospace font stack.
27
+ - Use prompt for a decorative shell marker. Pass the original code to the copy action.
27
28
  - The host implements copy behavior, failure handling and feedback. No clipboard or network API runs inside the component.
28
29
  - Code text defaults to LTR independently of parent layout. codeDirection can be ltr/rtl/auto; native dir still controls the wrapper and action layout.
29
30
 
@@ -33,5 +34,6 @@ export function Example() {
33
34
  | --- | --- | --- |
34
35
  | `code` | `string` | `Required` |
35
36
  | `codeDirection` | `"ltr" \| "rtl" \| "auto"` | `"ltr"` |
37
+ | `prompt · 0.2.13` | `string` | `—` |
36
38
  | `action` | `ReactNode` | `—` |
37
39
  | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | `Forwarded` |
@@ -31,6 +31,7 @@ export function Example() {
31
31
  - Clear keeps its space immediately before the right-anchored Filters trigger while inactive. Removing a summary or clearing returns focus to Filters, or Search when no panel exists. Filter disclosure is omitted when no filterContent is supplied.
32
32
  - quickFilters is an optional slot for at most two task-important properties; larger property sets belong inside filterContent. The host owns the threshold and slot behavior. Supply canClear when active state is not represented by searchValue/appliedFilters, such as controls in that slot.
33
33
  - Search, accepted summaries and commands share a responsive row. The actions slot places table commands, such as Columns, next to Filters. Saved-view selectors and save/rename actions stay outside this query row.
34
+ - Use align="end" when a sibling such as a view selector or status switcher occupies the start of the row. Search, quick filters, summaries and commands form an end-aligned group and wrap in their original order as space runs out.
34
35
  - controlSize defaults to sm; action/field sizes and chip typography follow the shared family. disabled applies to the complete fieldset, including native quick-filter controls and panel descendants. Labels and summaries remain host-localizable.
35
36
 
36
37
  ## API reference
@@ -53,6 +54,7 @@ export function Example() {
53
54
  | `onRemoveFilter` | `(id: string) => void` | `—` |
54
55
  | `appliedFiltersLabel` | `string` | `—` |
55
56
  | `summaryPrefix` | `ReactNode` | `—` |
57
+ | `align` | `"stretch" \| "end"` | `—` |
56
58
  | `quickFilters` | `ReactNode` | `—` |
57
59
  | `actions` | `ReactNode` | `—` |
58
60
  | `filterContent` | `ReactNode` | `—` |
@@ -39,6 +39,7 @@ export function Example() {
39
39
  | `disabled` | `boolean` | `—` |
40
40
  | `closeLabel` | `string` | `—` |
41
41
  | `closeOnOutsideClick` | `boolean` | `—` |
42
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
42
43
  | `searchLabel` | `string` | `Required` |
43
44
  | `items` | `readonly CommandListItem[]` | `Required` |
44
45
  | `density` | `"comfortable" \| "compact"` | `"comfortable"` |
@@ -25,6 +25,7 @@ export function Example() {
25
25
 
26
26
  - Copies only on a user click. Requires a secure context and Clipboard API; onCopyError receives unavailable/denied errors. The host owns any manual-copy fallback. Native button ref and disabled semantics are preserved.
27
27
  - Localize copyLabel/copiedLabel/errorLabel. resetDelay restores the idle state after success. Labels reserve their common width and a live status announces the result. No remote data transfer is built in. Available in 0.2.5.
28
+ - Use iconOnly for a square IconButton when the nearby content makes the copy target clear. The button keeps its accessible name and success or failure feedback.
28
29
 
29
30
  ## API reference
30
31
 
@@ -34,6 +35,7 @@ export function Example() {
34
35
  | `tone` | `"default" \| "danger"` | `—` |
35
36
  | `size` | `"2xs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` |
36
37
  | `value` | `string` | `Required` |
38
+ | `iconOnly · 0.2.13` | `boolean` | `—` |
37
39
  | `copyLabel` | `string` | `"Copy"` |
38
40
  | `copiedLabel` | `string` | `"Copied"` |
39
41
  | `errorLabel` | `string` | `"Failed"` |
@@ -25,6 +25,7 @@ export function Example() {
25
25
 
26
26
  - Uses native showModal, not a simulated modal div.
27
27
  - Escape closes the top layer; outside closing can be disabled independently. Tab remains inside the dialog.
28
+ - Use getFallbackFocus to resolve a surviving focus target when the opener disappears or becomes unavailable on close.
28
29
  - Closed content unmounts. Forward trigger props/ref; initialFocusRef can select a safe initial control. Modern native dialog support is required.
29
30
 
30
31
  ## API reference
@@ -42,4 +43,5 @@ export function Example() {
42
43
  | `closeLabel` | `string` | `"Close"` |
43
44
  | `closeOnOutsideClick` | `boolean` | `true` |
44
45
  | `initialFocusRef` | `RefObject<HTMLElement \| null>` | `—` |
46
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
45
47
  | `Native HTML props` | `Omit<HTMLAttributes<HTMLDialogElement>, "children" \| "title" \| "role">` | `Forwarded` |
@@ -0,0 +1,46 @@
1
+ # DonutChart
2
+
3
+ Shares of a whole with an in-ring total and exact values on inspection.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, DonutChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <DonutChart label="Traffic sources" totalLabel="Visits" items={[
19
+ {id:"direct", label:"Direct", value:6420},
20
+ {id:"search", label:"Search", value:3720},
21
+ {id:"referrals", label:"Referrals", value:1960}
22
+ ]} />
23
+ </FloodRoot>
24
+ );
25
+ }
26
+ ```
27
+
28
+ ## Design notes
29
+
30
+ - Pass up to six mutually exclusive categories in display order. Values must be finite and nonnegative. The ring uses their sum as the whole.
31
+ - Hover, tap or use arrow keys, Home and End to inspect a category. Its name, exact value and share appear inside the ring. Enable showLegend when readers need the category names before interacting.
32
+ - An empty list displays the empty label. All-zero data displays a total of zero and omits percentages. Supply formatValue and formatShare for localized output.
33
+
34
+ ## API reference
35
+
36
+ | Prop | Values | Default |
37
+ | --- | --- | --- |
38
+ | `label` | `string` | `Required` |
39
+ | `items` | `readonly DonutChartItem[]` | `Required` |
40
+ | `totalLabel` | `string` | `"Total"` |
41
+ | `emptyLabel` | `string` | `"No data"` |
42
+ | `navigationLabel` | `string` | `"Use the arrow keys to explore segments, or Home and End to jump."` |
43
+ | `showLegend` | `boolean` | `—` |
44
+ | `formatValue` | `(value: number) => string` | `—` |
45
+ | `formatShare` | `(share: number) => string` | `—` |
46
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -26,6 +26,7 @@ export function Example() {
26
26
  ## Design notes
27
27
 
28
28
  - Uses Flood native Dialog focus containment, scroll lock, background inertness, nested layers and return focus. Escape and the named close IconButton dismiss it; closeOnOutsideClick defaults to true. Controlled open/onOpenChange and initialFocusRef match Dialog.
29
+ - Drawer inherits getFallbackFocus from Dialog. Use it when saving or deleting can remove the opening row from a collection.
29
30
  - side is logical start/end or physical top/bottom. size sets 20/26/34rem for sm/md/lg, capped to the viewport. Vertical drawers occupy the viewport height; horizontal drawers occupy its width. Entry motion respects reduced motion; closing is immediate.
30
31
  - Choose width against a populated record. For longer messages and several controls, compare md and lg. Use the description slot for short context and compose independent body groups with Section or Fieldset. Keep persistent actions in footer.
31
32
  - The body scrolls with Flood ScrollArea while the header and optional footer remain visible when space allows. Responsive padding and full-width narrow descriptions preserve the reading area at enlarged text; if the chrome cannot fit, the whole panel can scroll rather than clipping the body. Footer actions are host-owned, without implicit save or close. No swipe/drag gesture or nested navigation engine is included. Available in 0.2.5.
@@ -45,6 +46,7 @@ export function Example() {
45
46
  | `closeLabel` | `string` | `"Close"` |
46
47
  | `closeOnOutsideClick` | `boolean` | `true` |
47
48
  | `initialFocusRef` | `RefObject<HTMLElement \| null>` | `—` |
49
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
48
50
  | `side` | `"start" \| "end" \| "top" \| "bottom"` | `"end"` |
49
51
  | `size` | `"sm" \| "md" \| "lg"` | `"md"` |
50
52
  | `footer` | `ReactNode` | `—` |
@@ -0,0 +1,46 @@
1
+ # DumbbellChart
2
+
3
+ Paired values on one scale for comparing before and after across groups.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, DumbbellChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <DumbbellChart label="Response time before and after" items={[
19
+ {id:"api", label:"API", before:242, after:164},
20
+ {id:"billing", label:"Billing", before:153, after:190}
21
+ ]} formatValue={(value) => `${value} ms`} />
22
+ </FloodRoot>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Design notes
28
+
29
+ - The hollow point marks Before and the filled point marks After. Equal values share a position. A null endpoint leaves the other point visible.
30
+ - Compare the same measure in the same units. Supply a shared domain when comparing separate charts and use formatValue to include units.
31
+ - Hover, tap or use the arrow keys to read both values. Rename beforeLabel and afterLabel when comparing other paired conditions.
32
+
33
+ ## API reference
34
+
35
+ | Prop | Values | Default |
36
+ | --- | --- | --- |
37
+ | `label` | `string` | `Required` |
38
+ | `items` | `readonly DumbbellChartItem[]` | `Required` |
39
+ | `domain` | `readonly [number, number]` | `—` |
40
+ | `beforeLabel` | `string` | `—` |
41
+ | `afterLabel` | `string` | `—` |
42
+ | `missingLabel` | `string` | `—` |
43
+ | `emptyLabel` | `string` | `—` |
44
+ | `formatValue` | `(value: number) => string` | `—` |
45
+ | `navigationLabel` | `string` | `—` |
46
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -0,0 +1,45 @@
1
+ # Heatmap
2
+
3
+ A two-axis matrix that shows intensity and reveals exact cell values.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, Heatmap } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <Heatmap label="Requests by hour" columns={["08:00", "10:00", "12:00"]}
19
+ rows={[
20
+ {id:"mon", label:"Mon", values:[4, 13, 23]},
21
+ {id:"tue", label:"Tue", values:[7, null, 32]}
22
+ ]} max={40} />
23
+ </FloodRoot>
24
+ );
25
+ }
26
+ ```
27
+
28
+ ## Design notes
29
+
30
+ - Supply a value for each column. Values are finite and nonnegative; null represents a missing observation and gets a dashed tile. Zero is an observed value.
31
+ - Use the same max across matrices that should be compared. Hover, tap or use arrow keys to inspect exact values in a tooltip beside the cell. Home and End move within a row.
32
+ - Keep axis labels short at the target width. Provide formatValue and localized labels when needed.
33
+
34
+ ## API reference
35
+
36
+ | Prop | Values | Default |
37
+ | --- | --- | --- |
38
+ | `label` | `string` | `Required` |
39
+ | `columns` | `readonly string[]` | `Required` |
40
+ | `rows` | `readonly { id: string; label: string; values: readonly (number \| null)[] }[]` | `Required` |
41
+ | `max` | `number` | `—` |
42
+ | `formatValue` | `(value: number) => string` | `—` |
43
+ | `missingLabel` | `string` | `"No data"` |
44
+ | `emptyLabel` | `string` | `"No observations"` |
45
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | `Forwarded` |
@@ -0,0 +1,46 @@
1
+ # Histogram
2
+
3
+ Show how often values such as request latency fall into equal-width intervals.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, Histogram } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <Histogram label="Request latency distribution" xLabel="Latency (ms)" countLabel="Requests" start={0} binWidth={50} counts={[5, 16, 34, 49, 41, 28, 17, 9, 4, 0]} />
19
+ </FloodRoot>
20
+ );
21
+ }
22
+ ```
23
+
24
+ ## Design notes
25
+
26
+ - Supply precomputed nonnegative integer counts in ascending bin order. Every bin shares binWidth. Keep interior zero bins so the numeric scale stays continuous.
27
+ - Count each observation in exactly one interval. A typical convention includes the lower boundary and excludes the upper boundary, with the last upper boundary included if needed.
28
+ - Compare histograms on the same numeric boundaries and maxCount. Set showXAxisLabel to false when the title already supplies the unit. Hover, tap or use the keyboard to inspect an interval and its exact count.
29
+
30
+ ## API reference
31
+
32
+ | Prop | Values | Default |
33
+ | --- | --- | --- |
34
+ | `label` | `string` | `Required` |
35
+ | `xLabel` | `string` | `Required` |
36
+ | `showXAxisLabel` | `boolean` | `—` |
37
+ | `start` | `number` | `Required` |
38
+ | `binWidth` | `number` | `Required` |
39
+ | `counts` | `readonly number[]` | `Required` |
40
+ | `maxCount` | `number` | `—` |
41
+ | `countLabel` | `string` | `—` |
42
+ | `formatBoundary` | `(value: number) => string` | `—` |
43
+ | `formatCount` | `(count: number) => string` | `—` |
44
+ | `emptyLabel` | `string` | `—` |
45
+ | `navigationLabel` | `string` | `—` |
46
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -40,6 +40,7 @@ export function Example() {
40
40
  | `closeLabel` | `string` | `—` |
41
41
  | `closeOnOutsideClick` | `boolean` | `—` |
42
42
  | `initialFocusRef` | `RefObject<HTMLElement \| null>` | `—` |
43
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
43
44
  | `src` | `string` | `Required` |
44
45
  | `alt` | `string` | `Required` |
45
46
  | `caption` | `ReactNode` | `—` |
@@ -0,0 +1,50 @@
1
+ # LineChart
2
+
3
+ A line or area chart for comparing trends on a shared scale.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, LineChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <LineChart label="Daily visits" categories={["Mon", "Tue", "Wed"]}
19
+ series={[{id:"this-week", label:"This week", values:[38, 55, 48]}]}
20
+ domain={[0, 60]} variant="area" />
21
+ </FloodRoot>
22
+ );
23
+ }
24
+ ```
25
+
26
+ ## Design notes
27
+
28
+ - The chart shows dates and a quiet dot grid by default. Enable showYAxis when numeric levels need to be visible at a glance.
29
+ - Series names appear in the inspection readout. Set showLegend when the key needs to be visible before interaction.
30
+ - Supply equally spaced categories in reading order and up to four named series with the same number of values. Null and nonfinite values leave gaps. Zero is an observation.
31
+ - Use a shared domain containing all observations when comparing separate charts. Area shading belongs to the first series. Line styles distinguish the series independently of color. Set curve to linear for straight segments.
32
+ - Explore values by hovering, tapping, or using arrow keys, Home and End. The default number format is English; supply formatValue and translated empty, missing and navigation labels for other locales.
33
+
34
+ ## API reference
35
+
36
+ | Prop | Values | Default |
37
+ | --- | --- | --- |
38
+ | `label` | `string` | `Required` |
39
+ | `categories` | `readonly string[]` | `Required` |
40
+ | `series` | `readonly LineChartSeries[]` | `Required` |
41
+ | `domain` | `readonly [number, number]` | `—` |
42
+ | `variant` | `"line" \| "area"` | `"area"` |
43
+ | `curve` | `"linear" \| "smooth"` | `"smooth"` |
44
+ | `showYAxis` | `boolean` | `false` |
45
+ | `showLegend` | `boolean` | `—` |
46
+ | `formatValue` | `(value: number) => string` | `—` |
47
+ | `emptyLabel` | `string` | `"No data"` |
48
+ | `missingLabel` | `string` | `"No value"` |
49
+ | `navigationLabel` | `string` | `"Use the arrow keys to explore values, or Home and End to jump."` |
50
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |
@@ -31,6 +31,7 @@ export function Example() {
31
31
  - Enter/Space and ArrowDown open at the first item; ArrowUp opens at the last. Inside use arrows, Home/End and label-prefix typeahead.
32
32
  - Disabled items stay keyboard-focusable with aria-disabled but cannot activate. Separators are noninteractive; action IDs must be unique and nonempty. At least one action is required.
33
33
  - Escape closes and restores trigger focus. Tab moves to the next control after the trigger; Shift+Tab returns to the trigger. Outside interaction dismisses without stealing deliberately moved focus.
34
+ - Use getFallbackFocus when an action can remove or disable its opener. Resolve the surviving control from the committed interface.
34
35
  - Shortcut text is a visual hint, not an implemented key binding. No href or asynchronous task manager is included. Nested items use type="submenu" and a nonempty items array. Checkbox/radio items are controlled preferences, available in 0.2.7.
35
36
  - Controlled open needs host updates; onAction requests closure before calling the host. Modern native Popover API required. Native div props/ref target the popup. Available in 0.2.4.
36
37
  - Checkbox items take checked (boolean or mixed) and onCheckedChange. Radio items take a nonempty group label, checked and onCheckedChange; the host keeps one selected item per group. Keep each radio group contiguous. Preference items stay open by default; closeOnSelect opts into dismissal. They do not call onAction or submit form values.
@@ -47,6 +48,7 @@ export function Example() {
47
48
  | `open` | `boolean` | `—` |
48
49
  | `defaultOpen` | `boolean` | `false` |
49
50
  | `onOpenChange` | `(open: boolean) => void` | `—` |
51
+ | `getFallbackFocus` | `() => HTMLElement \| null` | `—` |
50
52
  | `disabled` | `boolean` | `false` |
51
53
  | `side` | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` |
52
54
  | `align` | `"start" \| "center" \| "end"` | `"start"` |
@@ -0,0 +1,46 @@
1
+ # RangeChart
2
+
3
+ Low and high values by category, with an optional midpoint.
4
+
5
+ Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
6
+
7
+ ## Example
8
+
9
+ ```tsx
10
+ "use client";
11
+
12
+ import { FloodRoot, RangeChart } from "@flood-md/react";
13
+ import "@flood-md/react/styles.css";
14
+
15
+ export function Example() {
16
+ return (
17
+ <FloodRoot>
18
+ <RangeChart label="Response time (ms)" lowLabel="P10" highLabel="P90" midpointLabel="Median" items={[
19
+ {id:"mon", label:"Mon", low:84, high:162, midpoint:119},
20
+ {id:"tue", label:"Tue", low:92, high:176, midpoint:125}
21
+ ]} />
22
+ </FloodRoot>
23
+ );
24
+ }
25
+ ```
26
+
27
+ ## Design notes
28
+
29
+ - Use a shared scale to compare intervals. Supply a midpoint only when it adds information, such as a measured median.
30
+ - Use null bounds for missing observations and give the bounds meaningful labels with units. Inspect a category to read its exact values.
31
+
32
+ ## API reference
33
+
34
+ | Prop | Values | Default |
35
+ | --- | --- | --- |
36
+ | `label` | `string` | `Required` |
37
+ | `items` | `readonly RangeChartItem[]` | `Required` |
38
+ | `domain` | `readonly [number, number]` | `—` |
39
+ | `formatValue` | `(value: number) => string` | `—` |
40
+ | `lowLabel` | `string` | `—` |
41
+ | `highLabel` | `string` | `—` |
42
+ | `midpointLabel` | `string` | `—` |
43
+ | `emptyLabel` | `string` | `—` |
44
+ | `missingLabel` | `string` | `—` |
45
+ | `navigationLabel` | `string` | `—` |
46
+ | `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role" \| "aria-label">` | `Forwarded` |