@flood-md/agent 0.2.11 → 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.
- package/DESIGN.md +10 -1
- package/README.md +9 -4
- package/SKILL.md +16 -5
- package/dist/catalog.json +816 -232
- package/dist/materials/component-alert-dialog.md +1 -0
- package/dist/materials/component-app-shell.md +3 -1
- package/dist/materials/component-bar-chart.md +52 -0
- package/dist/materials/component-bar-list.md +41 -0
- package/dist/materials/component-box-plot.md +46 -0
- package/dist/materials/component-bullet-chart.md +43 -0
- package/dist/materials/component-code-snippet.md +3 -1
- package/dist/materials/component-collection-toolbar.md +4 -1
- package/dist/materials/component-command-palette.md +1 -0
- package/dist/materials/component-copy-button.md +2 -0
- package/dist/materials/component-data-table.md +21 -3
- package/dist/materials/component-dialog.md +2 -0
- package/dist/materials/component-donut-chart.md +46 -0
- package/dist/materials/component-drawer.md +2 -0
- package/dist/materials/component-dumbbell-chart.md +46 -0
- package/dist/materials/component-editable.md +4 -0
- package/dist/materials/component-heading.md +1 -1
- package/dist/materials/component-heatmap.md +45 -0
- package/dist/materials/component-histogram.md +46 -0
- package/dist/materials/component-image-preview.md +1 -0
- package/dist/materials/component-line-chart.md +50 -0
- package/dist/materials/component-menu.md +2 -0
- package/dist/materials/component-range-chart.md +46 -0
- package/dist/materials/component-scatter-chart.md +48 -0
- package/dist/materials/component-section.md +1 -1
- package/dist/materials/component-sheet.md +50 -0
- package/dist/materials/component-sparkline.md +41 -0
- package/dist/materials/component-table.md +3 -1
- package/dist/materials/component-toolbar.md +1 -0
- package/dist/materials/component-waterfall-chart.md +47 -0
- package/dist/materials/guide-agent-knowledge.md +5 -5
- package/dist/materials/guide-agents.md +35 -2
- package/dist/materials/guide-charts.md +34 -0
- package/dist/materials/guide-foundations.md +2 -2
- package/dist/materials/guide-installation.md +6 -6
- package/dist/materials/guide-introduction.md +2 -1
- package/dist/materials/guide-motion.md +19 -10
- package/dist/materials/guide-skills.md +10 -0
- package/dist/materials/recipe-collection-views.md +72 -47
- package/dist/materials/recipe-navigation-workspace.md +3 -0
- package/dist/materials/recipe-record-management.md +109 -61
- package/knowledge.json +16 -0
- package/lib/inspect.d.ts +14 -2
- package/lib/inspect.mjs +65 -0
- package/manifest.json +11 -1
- package/package.json +1 -1
- package/references/component-families.md +14 -0
- package/references/composition.md +12 -0
- package/references/flood-composition/SKILL.md +7 -0
- package/references/flood-data-display/SKILL.md +114 -0
- package/references/flood-feedback/SKILL.md +12 -0
- package/references/flood-forms/SKILL.md +5 -0
- package/references/flood-hierarchy/SKILL.md +4 -0
- package/references/flood-interface-content/SKILL.md +7 -0
- package/references/flood-motion/SKILL.md +3 -0
- package/references/flood-overlays/SKILL.md +11 -0
- package/references/flood-records/SKILL.md +32 -0
- package/references/flood-screen-composition/SKILL.md +48 -0
- package/references/flood-spacing/SKILL.md +7 -0
- package/references/flood-verification/SKILL.md +32 -0
- package/references/flood-visual-review/SKILL.md +59 -0
- package/references/rendered-review.md +49 -3
- package/references/routing.md +2 -1
- package/rules.json +37 -1
- 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,8 @@ export function Example() {
|
|
|
23
23
|
|
|
24
24
|
## Design notes
|
|
25
25
|
|
|
26
|
-
-
|
|
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
|
+
- Content mode uses Flood ScrollArea. Set scrollContentInset="none" when existing workspace padding clears the overlay rails and the content width needs to stay fixed.
|
|
27
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.
|
|
28
29
|
- Use mainAs="section" only when embedding a shell inside an existing main landmark.
|
|
29
30
|
|
|
@@ -43,5 +44,6 @@ export function Example() {
|
|
|
43
44
|
| `mainRef` | `Ref<HTMLElement>` | `—` |
|
|
44
45
|
| `scrollLabel` | `string` | `—` |
|
|
45
46
|
| `scrollOrientation` | `ScrollAreaProps["orientation"]` | `—` |
|
|
47
|
+
| `scrollContentInset` | `ScrollAreaProps["contentInset"]` | `—` |
|
|
46
48
|
| `skipLabel` | `string` | `—` |
|
|
47
49
|
| `Native HTML props` | `HTMLAttributes<HTMLDivElement>` | `Forwarded` |
|
|
@@ -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` |
|
|
@@ -30,7 +30,8 @@ export function Example() {
|
|
|
30
30
|
- filterContent supplies the existing filter editor, including FilterGroup or a project-specific form. The host retains draft validation, Apply/Cancel, query evaluation, persistence and saved views. filtersOpen/onFiltersOpenChange optionally control the existing Popover; filterPanelRef and filterPanelClassName support real panel focus and sizing.
|
|
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
|
-
- Search, accepted summaries and commands share a responsive row
|
|
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,7 +54,9 @@ 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` | `—` |
|
|
59
|
+
| `actions` | `ReactNode` | `—` |
|
|
57
60
|
| `filterContent` | `ReactNode` | `—` |
|
|
58
61
|
| `filtersLabel` | `string` | `—` |
|
|
59
62
|
| `filterTitle` | `string` | `—` |
|
|
@@ -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"` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DataTable
|
|
2
2
|
|
|
3
|
-
A native data table with
|
|
3
|
+
A native data table with sorting, selection, pagination, column layout and expandable records.
|
|
4
4
|
|
|
5
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
6
|
|
|
@@ -25,10 +25,15 @@ export function Example() {
|
|
|
25
25
|
|
|
26
26
|
## Design notes
|
|
27
27
|
|
|
28
|
-
- Supply the complete client
|
|
28
|
+
- Supply the complete collection in client mode. Server mode accepts one page with controlled page and totalRows, and controlled sort when enabled.
|
|
29
|
+
- Offer Columns when users need different subsets of fields. Pass its toolbar control into CollectionToolbar.actions alongside search and filters. Reset restores initial visibility and widths.
|
|
30
|
+
- Opt in to resizable columns and logical start/end pinning for wider tables. Persist width and visibility preferences by column ID.
|
|
31
|
+
- Keep headers short and use the optional column unit badge for values such as USD or kg. A constrained header remains on one line with its full accessible name.
|
|
32
|
+
- Use expandedContent for short related details and a captioned Flood Table for nested line items. Use Sparkline for compact trend cells with a shared domain when comparing magnitudes.
|
|
29
33
|
- Select all affects selectable rows on the current page and preserves selection on other pages.
|
|
30
34
|
- Use sortValues for rich React cells; missing values sort last in both directions.
|
|
31
35
|
- Use showResults={false} to omit a redundant result range. Selection feedback and pagination remain, and the footer disappears when it has no other content.
|
|
36
|
+
- Use showSelection={false} when a floating BulkActionBar displays the selected count. The table retains its accessible selection status.
|
|
32
37
|
- Set column.numeric for comparable amounts and quantities. Header and cells align to the logical end with tabular figures, while explicit align takes precedence. Keep numeric identifiers as text and provide raw sortValues for localized amounts.
|
|
33
38
|
- For in-place record details, supply row.primaryAction with the identity column, title, optional description and native button props. Pointer activation extends across the row, while keyboard focus lands on the title button. Secondary controls retain their own behavior.
|
|
34
39
|
- Use toolbar for the heading and filters that share the table surface. Set inset to roomy for a shared outer inset on toolbar, table cells and footer.
|
|
@@ -38,16 +43,28 @@ export function Example() {
|
|
|
38
43
|
|
|
39
44
|
| Prop | Values | Default |
|
|
40
45
|
| --- | --- | --- |
|
|
41
|
-
| `toolbar` | `ReactNode` | `—` |
|
|
46
|
+
| `toolbar` | `ReactNode \| (controls: { columns: ReactNode }) => ReactNode` | `—` |
|
|
42
47
|
| `inset` | `"standard" \| "roomy"` | `—` |
|
|
43
48
|
| `emptyContent` | `ReactNode` | `—` |
|
|
44
49
|
| `caption` | `string` | `Required` |
|
|
45
50
|
| `hideCaption` | `boolean` | `—` |
|
|
46
51
|
| `columns` | `readonly DataTableColumn[]` | `Required` |
|
|
52
|
+
| `showColumnVisibility` | `boolean` | `—` |
|
|
53
|
+
| `hiddenColumnIds` | `readonly string[]` | `—` |
|
|
54
|
+
| `defaultHiddenColumnIds` | `readonly string[]` | `—` |
|
|
55
|
+
| `onHiddenColumnIdsChange` | `(ids: string[]) => void` | `—` |
|
|
56
|
+
| `columnWidths` | `Readonly<Record<string, number>>` | `—` |
|
|
57
|
+
| `defaultColumnWidths` | `Readonly<Record<string, number>>` | `—` |
|
|
58
|
+
| `onColumnWidthsChange` | `(widths: Record<string, number>) => void` | `—` |
|
|
47
59
|
| `rows` | `readonly DataTableRow[]` | `Required` |
|
|
60
|
+
| `expandedIds` | `readonly string[]` | `—` |
|
|
61
|
+
| `defaultExpandedIds` | `readonly string[]` | `—` |
|
|
62
|
+
| `onExpandedChange` | `(ids: string[]) => void` | `—` |
|
|
48
63
|
| `density` | `"compact" \| "comfortable"` | `—` |
|
|
49
64
|
| `striped` | `boolean` | `—` |
|
|
50
65
|
| `minWidth` | `CSSProperties["minWidth"]` | `—` |
|
|
66
|
+
| `maxViewportHeight` | `CSSProperties["maxBlockSize"]` | `—` |
|
|
67
|
+
| `stickyHeader` | `boolean` | `—` |
|
|
51
68
|
| `sort` | `DataTableSort \| null` | `—` |
|
|
52
69
|
| `defaultSort` | `DataTableSort \| null` | `—` |
|
|
53
70
|
| `onSortChange` | `(sort: DataTableSort \| null) => void` | `—` |
|
|
@@ -61,6 +78,7 @@ export function Example() {
|
|
|
61
78
|
| `pageSize` | `number` | `—` |
|
|
62
79
|
| `onPageChange` | `(page: number) => void` | `—` |
|
|
63
80
|
| `showResults` | `boolean` | `—` |
|
|
81
|
+
| `showSelection` | `boolean` | `—` |
|
|
64
82
|
| `paginationMode` | `"client" \| "server"` | `—` |
|
|
65
83
|
| `totalRows` | `number` | `—` |
|
|
66
84
|
| `selectionScope` | `"page" \| "dataset"` | `—` |
|
|
@@ -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` |
|
|
@@ -42,6 +42,10 @@ export function Example() {
|
|
|
42
42
|
| `onEditingChange` | `(editing: boolean) => void` | `—` |
|
|
43
43
|
| `onCommit` | `(value: string) => void` | `—` |
|
|
44
44
|
| `onCancel` | `() => void` | `—` |
|
|
45
|
+
| `validate` | `(value: string) => string \| undefined` | `—` |
|
|
46
|
+
| `inputMode` | `InputHTMLAttributes<HTMLInputElement>["inputMode"]` | `—` |
|
|
47
|
+
| `previewVariant` | `"subtle" \| "ghost"` | `—` |
|
|
48
|
+
| `editorOverlayWidth` | `CSSProperties["inlineSize"]` | `—` |
|
|
45
49
|
| `blurAction` | `"commit" \| "cancel" \| "none"` | `"commit"` |
|
|
46
50
|
| `readOnly` | `boolean` | `—` |
|
|
47
51
|
| `disabled` | `boolean` | `—` |
|
|
@@ -34,5 +34,5 @@ export function Example() {
|
|
|
34
34
|
| Prop | Values | Default |
|
|
35
35
|
| --- | --- | --- |
|
|
36
36
|
| `level` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `2` |
|
|
37
|
-
| `size` | `"display" \| "large" \| "page" \| "section"` | `"page"` |
|
|
37
|
+
| `size` | `"display" \| "large" \| "page" \| "section" \| "group"` | `"page"` |
|
|
38
38
|
| `Native HTML props` | `HTMLAttributes<HTMLHeadingElement>` | `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` |
|