cleanplate 0.2.0 → 0.2.2

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/AGENTS.md ADDED
@@ -0,0 +1,45 @@
1
+ # Agent instructions — CleanPlate (React)
2
+
3
+ Use this file when generating or refactoring UI in **this frontend project**. This app uses **[CleanPlate](https://www.npmjs.com/package/cleanplate)** (`cleanplate` on npm): a headless React component library.
4
+
5
+ ## Where to load full documentation
6
+
7
+ 1. **Index (start here):** `node_modules/cleanplate/llms.txt`
8
+ Overview, AI-oriented guidelines, and pointers to each component doc.
9
+
10
+ 2. **Component reference:** `node_modules/cleanplate/docs/<ComponentName>.md`
11
+ Example: `docs/Button.md`, `docs/PageHeader.md` — props, types, examples, behavior.
12
+
13
+ If `node_modules` is missing, run install first. Optionally use a **semver-pinned CDN** mirror of the same files (substitute your installed version):
14
+ `https://unpkg.com/cleanplate@<version>/llms.txt` · `https://unpkg.com/cleanplate@<version>/docs/Button.md`
15
+
16
+ Human-facing demos: [Storybook — cleanplate.sivadass.in](https://cleanplate.sivadass.in)
17
+
18
+ ## Imports and styling
19
+
20
+ - Import components as **named exports** from `'cleanplate'`.
21
+ - Include framework styles **once** at the app root:
22
+ `import "cleanplate/dist/index.css";`
23
+ - **`Icon`** uses [Google Material Symbols](https://fonts.google.com/icons); ensure the Material Symbols font is loaded in the app (see `docs/Icon.md`).
24
+
25
+ ## Rules for generated code
26
+
27
+ - Prefer **component props** for layout, spacing, and alignment — **avoid inline `style`** when CleanPlate exposes a prop for it.
28
+ - **Spacing (`margin`, `padding`, `gap`):** use the **suffix-only** API everywhere it applies — e.g. `margin="b-2"`, `padding="4"`, `gap="2"`. Do **not** pass CSS-class-style prefixes (`m-`, `p-`, `g-`) in prop values.
29
+ - **`Typography`:** use `align` for text alignment, `isBold` for bold, `margin` for spacing — not equivalent inline styles unless there is no prop.
30
+
31
+ Correct vs avoid:
32
+
33
+ ```jsx
34
+ <Typography variant="h4" align="center" margin="b-2">Login</Typography>
35
+ ```
36
+
37
+ ```jsx
38
+ <Typography variant="h4" style={{ textAlign: "center", marginBottom: "1rem" }}>Login</Typography>
39
+ ```
40
+
41
+ ## Workflow
42
+
43
+ 1. Read `node_modules/cleanplate/llms.txt` for global rules and the right `docs/*.md` path.
44
+ 2. Open the matching `docs/<Component>.md` before inventing props or patterns.
45
+ 3. Match **TypeScript types** exported from `'cleanplate'` when the project uses TypeScript.
package/README.md CHANGED
@@ -1,104 +1,249 @@
1
- # cleanplate
1
+ # CleanPlate
2
2
 
3
- CleanPlate - Headless React UI Framework
3
+ **A headless React UI framework** — reusable, accessible components you can style to match your brand. No opinionated theme; you bring the look and feel.
4
4
 
5
- ### Installation
5
+ - [Installation](#installation)
6
+ - [Quick start](#quick-start)
7
+ - [Available components](#available-components)
8
+ - [Documentation](#documentation)
9
+ - [TypeScript](#typescript)
10
+ - [LLM / AI-friendly docs & agents](#llm--ai-friendly-docs--agents)
11
+ - [`AGENTS.md` in your app repo](#agentsmd-in-your-app-repo)
12
+ - [GitHub MCP server](#github-mcp-server)
6
13
 
7
- ```
8
- npm install cleanplate
9
- ```
14
+ ---
10
15
 
11
- Check all versions at [NPM](https://www.npmjs.com/package/cleanplate).
16
+ ## Requirements
12
17
 
13
- ### Usage
18
+ - **React** 18 or higher
19
+ - **React DOM** 18 or higher
14
20
 
15
- All components can be consumed by `import` using their respective names from `cleanplate` package.
21
+ ---
16
22
 
17
- #### Initial Setup
23
+ ## Installation
18
24
 
19
- Import the CSS Reset and minimal cleanplate styles at top most level or root level.
20
-
21
- ```
22
- import "cleanplate/dist/index.css";
25
+ ```bash
26
+ npm install cleanplate
23
27
  ```
24
28
 
25
- #### Button
29
+ Or with Yarn:
26
30
 
31
+ ```bash
32
+ yarn add cleanplate
27
33
  ```
28
- import { Button } from "cleanplate";
29
34
 
30
- <Button variant="primary" onClick={() => {}}>Save</Button>
31
- <Button variant="secondary" onClick={() => {}}>Save</Button>
32
- <Button variant="nude" onClick={() => {}}>Save</Button>
33
- <Button variant="special" onClick={() => {}}>Save</Button>
34
- ```
35
+ Published packages: [npm — cleanplate](https://www.npmjs.com/package/cleanplate)
35
36
 
36
- #### Typography
37
+ ---
37
38
 
38
- ```
39
- import { Typography } from "cleanplate";
39
+ ## Quick start
40
+
41
+ ### 1. Add styles
40
42
 
41
- <Typography variant="h1">Hello World!</Typography>
42
- <Typography variant="h2">Hello World!</Typography>
43
- <Typography variant="h3">Hello World!</Typography>
44
- <Typography variant="h4">Hello World!</Typography>
45
- <Typography variant="h5">Hello World!</Typography>
46
- <Typography variant="h6">Hello World!</Typography>
47
- <Typography variant="p">Hello World!</Typography>
48
- <Typography variant="small">Hello World!</Typography>
43
+ Import the reset and base styles **once** at your app root (e.g. `main.jsx`, `App.jsx`, or `index.js`):
49
44
 
45
+ ```jsx
46
+ import "cleanplate/dist/index.css";
50
47
  ```
51
48
 
52
- #### Badge
49
+ ### 2. Import and use components
53
50
 
54
- ```
55
- import { Badge } from "cleanplate";
51
+ All components are **named exports** from `cleanplate`:
52
+
53
+ ```jsx
54
+ import { Button, Typography, Container } from "cleanplate";
56
55
 
57
- <Badge label="New" />
56
+ function App() {
57
+ return (
58
+ <Container padding="4">
59
+ <Typography variant="h1">Hello</Typography>
60
+ <Button variant="solid" onClick={() => alert("Saved!")}>
61
+ Save
62
+ </Button>
63
+ </Container>
64
+ );
65
+ }
58
66
  ```
59
67
 
60
- #### AppShell
68
+ ### Example: Button
61
69
 
62
- ```
63
- import { AppShell } from "cleanplate";
70
+ ```jsx
71
+ import { Button } from "cleanplate";
64
72
 
65
- <AppShell />
73
+ <Button variant="solid">Primary action</Button>
74
+ <Button variant="outline">Secondary</Button>
75
+ <Button variant="ghost">Tertiary</Button>
66
76
  ```
67
77
 
68
- #### Form Controls
78
+ Variants: `solid`, `outline`, `ghost`, `icon`. Sizes: `small`, `medium`.
79
+
80
+ ### Example: Typography
69
81
 
82
+ ```jsx
83
+ import { Typography } from "cleanplate";
84
+
85
+ <Typography variant="h1">Heading 1</Typography>
86
+ <Typography variant="h4">Heading 4</Typography>
87
+ <Typography variant="p">Body paragraph.</Typography>
70
88
  ```
71
- import { FormControl } from "cleanplate";
72
89
 
73
- <FormControl.Input
74
- name="email"
75
- onChange={(e) => handleChange(e)}
76
- value={values.email}
90
+ Variants: `h1`–`h6`, `p`, `span`, `small`.
91
+
92
+ ### Example: Form controls
93
+
94
+ ```jsx
95
+ import { FormControls } from "cleanplate";
96
+
97
+ <FormControls.Input
98
+ label="Email"
99
+ value={email}
100
+ onChange={(e) => setEmail(e.target.value)}
77
101
  />
78
102
 
79
- <FormControl.TextArea
80
- name="bio"
81
- onChange={(e) => handleChange(e)}
82
- value={values.bio}
103
+ <FormControls.Select
104
+ label="Country"
105
+ options={[
106
+ { label: "United States", value: "us" },
107
+ { label: "Canada", value: "ca" },
108
+ ]}
109
+ value={country}
110
+ onChange={(e) => setCountry(e.target.value)}
83
111
  />
84
112
  ```
85
113
 
86
- #### Icon
114
+ Other form primitives: `TextArea`, `Checkbox`, `Radio`, `Date`, `File`, `Toggle`, etc.
87
115
 
88
- ```
116
+ ### Example: Icon
117
+
118
+ Uses [Google Material Symbols](https://fonts.google.com/icons). Include the font in your app; then:
119
+
120
+ ```jsx
89
121
  import { Icon } from "cleanplate";
90
122
 
91
- <Icon name="settings" size="small" color="balck">
123
+ <Icon name="settings" size="small" color="black" />
124
+ <Icon name="check_circle" size="medium" />
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Available components
130
+
131
+ | Component | Use case |
132
+ |----------------|----------|
133
+ | Accordion | Collapsible panels, FAQ sections |
134
+ | Alert | Inline feedback (success, error, warning, info) |
135
+ | Animated | Scroll-triggered animations |
136
+ | AppShell | Full-page layout with Header, Footer, sidebar |
137
+ | Avatar | User initials, image, or icon |
138
+ | Badge | Status labels, tags |
139
+ | BottomSheet | Slide-up panel |
140
+ | BreadCrumb | Navigation trail |
141
+ | Button | Actions and buttons |
142
+ | ConfirmDialog | Confirmation modals |
143
+ | Container | Layout, spacing, flex |
144
+ | Dropdown | Menus, floating panels |
145
+ | Footer | App footer |
146
+ | FormControls | Input, Select, TextArea, Checkbox, etc. |
147
+ | Header | App header with nav |
148
+ | Icon | Material Symbols icons |
149
+ | MediaObject | Media + title + description |
150
+ | MenuList | Navigation lists |
151
+ | Modal | Dialogs, overlays |
152
+ | PageHeader | Page title + CTA + more menu |
153
+ | Pagination | Page navigation |
154
+ | Pills | Tags/chips |
155
+ | ProgressBar | Progress indicator |
156
+ | Spinner | Loading indicator |
157
+ | Stepper | Multi-step flows |
158
+ | Table | Tabular data |
159
+ | Toast | Transient messages |
160
+ | Typography | Headings and text |
161
+
162
+ Import any of them from `cleanplate`:
163
+
164
+ ```jsx
165
+ import {
166
+ Button,
167
+ Typography,
168
+ Container,
169
+ Header,
170
+ PageHeader,
171
+ BreadCrumb,
172
+ Table,
173
+ FormControls,
174
+ // ... etc.
175
+ } from "cleanplate";
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Documentation
181
+
182
+ - **Storybook** — Interactive playground and docs for every component:
183
+ [https://cleanplate.sivadass.in](https://cleanplate.sivadass.in)
184
+ - **GitHub** — Source and issue tracker:
185
+ [github.com/sivadass/cleanplate](https://github.com/sivadass/cleanplate)
186
+
187
+ ---
188
+
189
+ ## TypeScript
190
+
191
+ CleanPlate is written in TypeScript and ships type definitions. Types are included in the package (`dist/index.d.ts`). No extra `@types` package needed.
192
+
193
+ ```tsx
194
+ import { Button } from "cleanplate";
195
+ import type { ButtonProps } from "cleanplate";
92
196
  ```
93
197
 
94
- View all the available icon names from [Google Material Icons](https://fonts.google.com/icons).
198
+ ---
95
199
 
96
- #### Modal
200
+ ## LLM / AI-friendly docs & agents
97
201
 
98
- ```
99
- import { Modal } from "cleanplate";
100
- ```
202
+ Documentation for **coding agents** and LLMs ships with the npm package alongside the compiled library.
203
+
204
+ ### After `npm install cleanplate`
205
+
206
+ - **Index:** `node_modules/cleanplate/llms.txt` — component list, conventions, and links to each doc file.
207
+ - **Per-component docs:** `node_modules/cleanplate/docs/<ComponentName>.md` — props, types, examples, behavior.
208
+
209
+ **Agent workflow:** read `node_modules/cleanplate/llms.txt` first, then open the specific files under `node_modules/cleanplate/docs/` (not imports alone).
210
+
211
+ ### Version-pinned URLs (no download step)
212
+
213
+ CDN mirrors of the published tarball work well for prompts and CI; pin the semver you depend on:
214
+
215
+ - **Latest:** [unpkg — `llms.txt`](https://unpkg.com/cleanplate@latest/llms.txt) · [jsDelivr — `llms.txt`](https://cdn.jsdelivr.net/npm/cleanplate@latest/llms.txt)
216
+ - **Pinned example:** `https://unpkg.com/cleanplate@0.2.0/llms.txt` and `https://unpkg.com/cleanplate@0.2.0/docs/Button.md` (substitute your installed version)
217
+
218
+ Human-facing Storybook: [cleanplate.sivadass.in](https://cleanplate.sivadass.in).
219
+
220
+ ### `AGENTS.md` in your app repo
221
+
222
+ Many coding agents automatically read **`AGENTS.md`** at the **root of the repository** they are working in. To give agents CleanPlate-specific context in **your** frontend project:
223
+
224
+ 1. Copy the template into your app root:
225
+ - From this repo: [`AGENTS.md`](https://github.com/sivadass/cleanplate/blob/main/AGENTS.md) (raw: [`AGENTS.md` raw](https://raw.githubusercontent.com/sivadass/cleanplate/main/AGENTS.md))
226
+ - Or from an install: `node_modules/cleanplate/AGENTS.md` → paste/rename as `AGENTS.md` at your project root
227
+ 2. Commit `AGENTS.md` so teammates and agents see the same rules.
228
+
229
+ The published tarball also includes **`AGENTS.md`** next to `llms.txt` for easy copying after `npm install`.
230
+
231
+ ---
232
+
233
+ ## GitHub MCP server
234
+
235
+ This repository is **compatible with the [GitHub MCP server](https://github.com/github/github-mcp-server)** (Model Context Protocol). The GitHub MCP server lets AI assistants (e.g. in Cursor or VS Code) access GitHub—repos, issues, pull requests, and workflows—so you can work with this codebase using natural language.
236
+
237
+ - **Compatibility:** CleanPlate is a standard GitHub repo with no special constraints. The GitHub MCP server can read and interact with it once connected.
238
+ - **Setup:** Add the GitHub MCP server in your editor:
239
+ - **Cursor:** Settings → Tools & MCP → add the GitHub MCP server (or add it to `~/.cursor/mcp.json`). Use [Cursor’s MCP docs](https://cursor.com/docs/context/mcp) for the exact config.
240
+ - **VS Code (1.101+):** Use the MCP servers UI or add the server to `.vscode/mcp.json`. See [GitHub: Using the GitHub MCP Server](https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server).
241
+ - **Auth:** You’ll need to authenticate with GitHub (OAuth or a Personal Access Token with the scopes the MCP server needs).
242
+
243
+ No project-level MCP config is required; configure the GitHub MCP server in your editor or global config and point it at this repo.
244
+
245
+ ---
101
246
 
102
- ### Documentation & Demo
247
+ ## License
103
248
 
104
- Storybook playground is available for all components at [https://cleanplate.sivadass.in](https://cleanplate.sivadass.in).
249
+ MIT © Sivadass N