@flood-md/agent 0.1.1 → 0.2.0
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 +76 -37
- package/SKILL.md +15 -6
- package/package.json +1 -1
package/DESIGN.md
CHANGED
|
@@ -1,57 +1,96 @@
|
|
|
1
|
-
# Flood design system · 0.
|
|
1
|
+
# Flood design system · 0.2.0
|
|
2
2
|
|
|
3
|
-
React + TypeScript
|
|
4
|
-
|
|
3
|
+
React + TypeScript and Next.js App Router. Use this guide with matching installed
|
|
4
|
+
Flood packages and flood.json. The source repository's release status does not
|
|
5
|
+
grant permission to publish or assume a version is available on npm.
|
|
5
6
|
|
|
6
7
|
## Connect
|
|
7
8
|
|
|
8
|
-
Import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Import @flood-md/react/styles.css once in the application entry or Next root
|
|
10
|
+
layout. Wrap new interfaces in FloodRoot, which explicitly selects neutral/dark.
|
|
11
|
+
FloodRoot does not mutate the document theme. This foundations profile is dark
|
|
12
|
+
only. Legacy controls outside FloodRoot retain their earlier light/dark behavior.
|
|
13
|
+
Add "use client" to host components using callbacks, state or Field's function
|
|
14
|
+
child. Keep server data fetching in server components.
|
|
12
15
|
|
|
13
16
|
## Compose
|
|
14
17
|
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- Use
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
18
|
+
- Use Text sizes body/compact/label/helper and Heading sizes large/page/section.
|
|
19
|
+
Heading level 1–6 sets semantics independently of visual size. Text label size
|
|
20
|
+
does not associate a form control; use Field.
|
|
21
|
+
- Use Stack and wrapping Inline. Gap and Surface padding keys are strings
|
|
22
|
+
0/1/2/3/4/6/8/12. Parent layout owns spacing; avoid redundant cards and borders.
|
|
23
|
+
- Sizes use rem, line heights ratios, tracking em. Do not impose a fixed root
|
|
24
|
+
font size or a global letter-spacing override. Inter is bundled locally with
|
|
25
|
+
its original OFL license; preserve the notice when distributing it.
|
|
26
|
+
- Use solid for the main action and subtle for standalone secondary actions.
|
|
27
|
+
Ghost requires a clear parent context such as a toolbar. Button sizes are
|
|
28
|
+
2xs/xs/sm/md/lg/xl/2xl; md is default. Small sizes need contextual touch checks.
|
|
29
|
+
- Use Link for navigation and Button for actions. Button defaults to type=button;
|
|
30
|
+
set type=submit deliberately. Loading disables activation and sets aria-busy;
|
|
31
|
+
retain meaningful visible text and let the host announce completion.
|
|
32
|
+
- Input/Textarea use controlSize sm/md/lg/xl. Preserve Input's native size prop.
|
|
33
|
+
Field required forwards native required and adds a visible marker. Spread all
|
|
34
|
+
callback props to preserve id, aria-describedby and aria-invalid. describedBy
|
|
35
|
+
merges external description IDs with hint/error IDs.
|
|
36
|
+
- Checkbox, Radio and Switch require visible labels and preserve native forms.
|
|
37
|
+
Radio groups share a name and belong in a host fieldset/legend. Readonly and
|
|
38
|
+
disabled are different states; explain unavailability outside disabled controls.
|
|
39
|
+
- IconSlot adapts host SVG artwork; without label it is decorative. IconButton
|
|
40
|
+
requires a nonempty action label. Retain the external icon pack's license.
|
|
41
|
+
- Surface elevation overlay is visual only: no portal, focus trap, dismissal or
|
|
42
|
+
dialog semantics are implied. Layer tokens do not implement an overlay manager.
|
|
43
|
+
|
|
44
|
+
## Tokens and accessibility
|
|
45
|
+
|
|
46
|
+
Use semantic --flood-sys-* roles inside FloodRoot; values are authored only in
|
|
47
|
+
the tokens package. Apply overrides on the scope element after the stylesheet.
|
|
48
|
+
Nested token scopes repeat both data-flood-foundations=neutral and
|
|
49
|
+
data-flood-theme=dark attributes. Preserve independent surface, content, boundary,
|
|
50
|
+
selection, feedback and focus roles rather than hardcoding component colors.
|
|
51
|
+
|
|
52
|
+
The quiet field outline needs its stronger necessary boundary. Focus is 2px
|
|
53
|
+
without offset; the configurable pink default is provisional. Keep focus visible
|
|
54
|
+
with invalid and selected states. Do not mute a whole component through opacity
|
|
55
|
+
to reduce one border. Never convey error, selection or status by color alone.
|
|
56
|
+
|
|
57
|
+
Evaluate text using actual size, weight, font and neighboring surface: WCAG plus
|
|
58
|
+
supplementary APCA guidance. Do not apply text thresholds to decorative lines or
|
|
59
|
+
claim full WCAG/APCA certification from a color-pair calculation. Small helper
|
|
60
|
+
text is supporting content, not the sole presentation of required instructions.
|
|
31
61
|
|
|
32
62
|
## Verify
|
|
33
63
|
|
|
34
|
-
Check keyboard
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
in the host project
|
|
64
|
+
Check keyboard, labels, focus/invalid combinations, required fields, native form
|
|
65
|
+
submission, loading/disabled/readonly, root scaling, text-spacing overrides,
|
|
66
|
+
narrow screens, long content, forced colors and reduced motion. Keep application
|
|
67
|
+
data and side effects in the host project. Flood owns UI only.
|
|
68
|
+
|
|
69
|
+
Read flood.json and use the matching CLI when running doctor. Doctor checks
|
|
70
|
+
versions/instruction files, not CSS imports or completed UI behavior. Do not
|
|
71
|
+
overwrite host instructions or fabricate installation/publication success.
|
|
38
72
|
|
|
39
|
-
## Example
|
|
73
|
+
## Example
|
|
40
74
|
|
|
41
75
|
```tsx
|
|
42
76
|
"use client";
|
|
43
|
-
import { Button, Field, Input } from "@flood-md/react";
|
|
77
|
+
import { Button, Field, FloodRoot, Heading, Input, Stack } from "@flood-md/react";
|
|
44
78
|
|
|
45
79
|
export function Profile() {
|
|
46
80
|
return (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
81
|
+
<FloodRoot>
|
|
82
|
+
<Stack gap="6">
|
|
83
|
+
<Heading level={1}>Profile</Heading>
|
|
84
|
+
<form onSubmit={(event) => event.preventDefault()}>
|
|
85
|
+
<Stack gap="4">
|
|
86
|
+
<Field label="Name" required hint="Shown on your profile">
|
|
87
|
+
{(props) => <Input {...props} name="name" autoComplete="name" />}
|
|
88
|
+
</Field>
|
|
89
|
+
<Button type="submit">Save changes</Button>
|
|
90
|
+
</Stack>
|
|
91
|
+
</form>
|
|
92
|
+
</Stack>
|
|
93
|
+
</FloodRoot>
|
|
55
94
|
);
|
|
56
95
|
}
|
|
57
96
|
```
|
package/SKILL.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flood-ui
|
|
3
|
-
description: Build React and Next.js interfaces with
|
|
3
|
+
description: Build React and Next.js interfaces with Flood 0.2 dark foundations, native controls and shared layout primitives. Use for Flood components, tokens, forms and composition.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Read
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
Read flood.json and flood/DESIGN.md first. Use matching installed package and CLI
|
|
7
|
+
versions; run doctor when uncertain. Import @flood-md/react/styles.css once and
|
|
8
|
+
compose new interfaces inside FloodRoot for explicit neutral/dark foundations.
|
|
9
|
+
|
|
10
|
+
Use Text/Heading, Stack/Inline/Surface, Button/IconButton, Field/Input/Textarea
|
|
11
|
+
and native Checkbox/Radio/Switch. Secondary standalone actions use subtle; ghost
|
|
12
|
+
needs context. Keep associations, required/invalid semantics, keyboard focus,
|
|
13
|
+
relative typography/spacing and responsive layout. Use host SVG icons through
|
|
14
|
+
IconSlot and retain their licenses. Respect Next.js client boundaries.
|
|
15
|
+
|
|
16
|
+
Only use the API provided by the installed version. Preserve host instructions;
|
|
17
|
+
do not introduce another component library, hardcode a parallel token system,
|
|
18
|
+
or assume npm publication from the repository version. This skill does not
|
|
19
|
+
authorize deployment, data deletion or sending host source elsewhere.
|