@flood-md/agent 0.1.1 → 0.2.1

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 (3) hide show
  1. package/DESIGN.md +76 -37
  2. package/SKILL.md +15 -6
  3. package/package.json +1 -1
package/DESIGN.md CHANGED
@@ -1,57 +1,96 @@
1
- # Flood design system · 0.1.1
1
+ # Flood design system · 0.2.1
2
2
 
3
- React + TypeScript. Next.js App Router is supported. Flood owns its components,
4
- tokens, CSS and installer. Do not introduce another UI library or copy external components.
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 `@flood-md/react/styles.css` once in the application entry or Next root layout.
9
- Use `Button, Input, Textarea, Checkbox, Radio, Switch, Field, Link` from `@flood-md/react`.
10
- Add `"use client"` to Next components that pass callbacks or use state. Flood's React
11
- entry already has a client boundary. Keep server data fetching in server components.
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
- - Read installed `flood.json`; use docs matching its version. Run `flood doctor` if uncertain.
16
- - Use semantic `--flood-*` tokens. Primitive values are authored in the tokens package.
17
- - Parent layout owns gaps: 4/8 for controls, 12/16 within groups, 24 between groups,
18
- 32/48 between sections. Avoid redundant cards and containers.
19
- - One clear primary action per task. Use solid, outline and ghost button variants.
20
- - Use a real link for navigation, a button for actions. Button defaults to type=button;
21
- set type=submit deliberately in forms.
22
- - Labels are visible. Use Field's render callback to pass id, aria-describedby and
23
- aria-invalid to Input/Textarea. Checkbox, Radio and Switch require their label prop.
24
- - Field takes a function child, so compose it inside a client component in Next.
25
- - Radio groups share a name and have a fieldset/legend. Native inputs keep form semantics.
26
- - Use `data-flood-theme="dark"` or `"light"` on the root; default follows system theme.
27
- - Preserve focus, long content, native form submission and disabled behavior.
28
- - Loading buttons keep meaningful text; loading disables the action and sets aria-busy.
29
- - Never use color alone for state. Include an error message and a recovery action.
30
- - Theme-specific customization uses semantic CSS variable overrides after the Flood import.
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 use, labels, focus, empty/loading/error/disabled states, narrow screens,
35
- light/dark themes and reduced motion. Do not fabricate a working command or release.
36
- Never overwrite existing project instructions. Keep application data and side effects
37
- in the host project; Flood provides UI only.
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 (client component)
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
- <form onSubmit={(event) => event.preventDefault()}>
48
- <Field label="Name" hint="Shown on your profile">
49
- {(props) => (
50
- <Input {...props} name="name" autoComplete="name" required />
51
- )}
52
- </Field>
53
- <Button type="submit">Save changes</Button>
54
- </form>
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 the installed Flood design system. Use for Flood components, themes, forms and layout composition.
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 `flood.json` and `flood/DESIGN.md` from the project root first. Run
7
- `npx @flood-md/cli doctor` to check versions. Import only published APIs from
8
- `@flood-md/react`; use its styles once in the application entry. Follow the installed
9
- design guide for composition, accessible forms and Next.js client boundaries.
10
- Do not replace project instructions or introduce another UI library.
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flood-md/agent",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Versioned Flood design instructions for coding agents.",
6
6
  "license": "MIT",