cleanplate 0.3.14 → 0.3.15
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 +4 -0
- package/README.md +1 -1
- package/dist/components/menu-list/MenuList.d.ts +5 -1
- package/dist/components/menu-list/MenuList.d.ts.map +1 -1
- package/docs/MenuList.md +44 -1
- package/llms.txt +7 -3
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -38,6 +38,10 @@ Correct vs avoid:
|
|
|
38
38
|
<Typography variant="h4" style={{ textAlign: "center", marginBottom: "1rem" }}>Login</Typography>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
## Tabs
|
|
42
|
+
|
|
43
|
+
There is **no** `Tabs` component in CleanPlate. For tab bars and in-page tab switching, use **`MenuList`** (`docs/MenuList.md`): horizontal `direction`, `activeItem`, `onMenuClick`, and render panel content in the parent from the same state.
|
|
44
|
+
|
|
41
45
|
## Workflow
|
|
42
46
|
|
|
43
47
|
1. Read `node_modules/cleanplate/llms.txt` for global rules and the right `docs/*.md` path.
|
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ import { Icon } from "cleanplate";
|
|
|
147
147
|
| Header | App header with nav |
|
|
148
148
|
| Icon | Material Symbols icons |
|
|
149
149
|
| MediaObject | Media + title + description |
|
|
150
|
-
| MenuList | Navigation lists |
|
|
150
|
+
| MenuList | Navigation lists; **tabs / tab bar** (no separate Tabs component) |
|
|
151
151
|
| Modal | Dialogs, overlays |
|
|
152
152
|
| PageHeader | Page title + CTA + more menu |
|
|
153
153
|
| Pagination | Page navigation |
|
|
@@ -12,7 +12,11 @@ export interface MenuListItem {
|
|
|
12
12
|
icon?: MaterialIconName;
|
|
13
13
|
}
|
|
14
14
|
export interface MenuListProps {
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* List of menu items; each has label, value, and optional icon.
|
|
17
|
+
* Also used as a **tab bar** (tabs): set `direction="horizontal"`, control `activeItem`,
|
|
18
|
+
* and render panel content in the parent. CleanPlate has no separate `Tabs` component.
|
|
19
|
+
*/
|
|
16
20
|
items: MenuListItem[];
|
|
17
21
|
/** Value of the currently active item (matches item.value) */
|
|
18
22
|
activeItem?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../../src/components/menu-list/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAKzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,EAAE,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B
|
|
1
|
+
{"version":3,"file":"MenuList.d.ts","sourceRoot":"","sources":["../../../src/components/menu-list/MenuList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAKzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,aAAa,EAAE,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mCAAmC;IACnC,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,mCAAmC;IACnC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,mEAAmE;IACnE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;CAC5C;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuDrC,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
package/docs/MenuList.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# MenuList Component
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Also known as:** **Tabs**, **tab bar**, **tab list** — CleanPlate does **not** ship a separate `Tabs` component. Use **MenuList** for in-page tab UIs (settings sections, filters, dashboard views). Pair a horizontal MenuList with your own panel content keyed off `activeItem`.
|
|
4
|
+
|
|
5
|
+
Purpose: Renders a list of navigational items with optional icons, active state highlighting, and customizable layout. Use for nav menus, sidebars, link lists, **and tab bars**. Supports horizontal and vertical directions, sizes (small, medium, large), variants (light, dark), and margin spacing. Items use Animated with fade-in-left on mount.
|
|
4
6
|
|
|
5
7
|
## Props / Inputs
|
|
6
8
|
|
|
@@ -97,8 +99,49 @@ const Nav = () => {
|
|
|
97
99
|
<MenuList items={items} size="large" activeItem={activeItem} onMenuClick={handleClick} />
|
|
98
100
|
```
|
|
99
101
|
|
|
102
|
+
### Tabs (in-page panels)
|
|
103
|
+
|
|
104
|
+
Use `direction="horizontal"`, controlled `activeItem`, and `onMenuClick` as the tab control. Render the active panel below (or beside) based on the same `activeItem` state. Do **not** import or invent a `Tabs` export — it does not exist in CleanPlate.
|
|
105
|
+
|
|
106
|
+
```jsx
|
|
107
|
+
import { useState } from "react";
|
|
108
|
+
import { MenuList, Container, Typography } from "cleanplate";
|
|
109
|
+
|
|
110
|
+
const TAB_ITEMS = [
|
|
111
|
+
{ label: "General", value: "general", icon: "settings" },
|
|
112
|
+
{ label: "Security", value: "security", icon: "lock" },
|
|
113
|
+
{ label: "Notifications", value: "notifications", icon: "notifications" },
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
const PANELS = {
|
|
117
|
+
general: <Typography variant="p">General settings content.</Typography>,
|
|
118
|
+
security: <Typography variant="p">Security settings content.</Typography>,
|
|
119
|
+
notifications: <Typography variant="p">Notification preferences.</Typography>,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const SettingsTabs = () => {
|
|
123
|
+
const [activeItem, setActiveItem] = useState("general");
|
|
124
|
+
return (
|
|
125
|
+
<>
|
|
126
|
+
<MenuList
|
|
127
|
+
items={TAB_ITEMS}
|
|
128
|
+
direction="horizontal"
|
|
129
|
+
variant="light"
|
|
130
|
+
activeItem={activeItem}
|
|
131
|
+
onMenuClick={(item) => setActiveItem(item.value)}
|
|
132
|
+
margin="b-2"
|
|
133
|
+
/>
|
|
134
|
+
<Container padding="4">{PANELS[activeItem]}</Container>
|
|
135
|
+
</>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
For URL-driven tabs, keep `activeItem` in sync with the route (e.g. search param or path segment) in the parent; MenuList stays presentational.
|
|
141
|
+
|
|
100
142
|
## Behavior Notes
|
|
101
143
|
|
|
144
|
+
- **No separate Tabs component:** Search terms like “tabs”, “tab bar”, or “TabList” map to **MenuList** + conditional panel content in the app.
|
|
102
145
|
- **Items:** Each item must have `label` and `value`. `icon` is optional (Material icon name).
|
|
103
146
|
- **onMenuClick:** Called with the clicked item. Use it to update `activeItem` or navigate.
|
|
104
147
|
- **DOM:** A `div` wrapping a `ul` of `li` elements; each `li` contains an anchor.
|
package/llms.txt
CHANGED
|
@@ -30,6 +30,9 @@ When generating code that uses CleanPlate components, **use component props inst
|
|
|
30
30
|
- **Container:** Use `padding`, `margin`, `gap`, `align`, `justify`, `display`, `width` props (spacing uses suffix rule above).
|
|
31
31
|
- **Button, Alert, Badge, etc.:** Each has documented props (e.g. variant, size, margin). Prefer these over inline style. Any `margin` or `padding` prop follows the suffix rule. See `docs/<ComponentName>.md` for the full prop list.
|
|
32
32
|
|
|
33
|
+
### Tabs (no separate component)
|
|
34
|
+
- CleanPlate does **not** export `Tabs`. For tab bars / in-page tab UIs, use **`MenuList`** (`docs/MenuList.md`): `direction="horizontal"`, `activeItem`, `onMenuClick`, then render panel content from the same `activeItem` state in the parent. Do not add a `Tabs` import or expect a `docs/Tabs.md` file.
|
|
35
|
+
|
|
33
36
|
### Example (correct)
|
|
34
37
|
```jsx
|
|
35
38
|
<Typography variant="h4" align="center" margin="b-2">Login</Typography>
|
|
@@ -193,10 +196,11 @@ All component documentation is located in the `docs/` folder. The following docu
|
|
|
193
196
|
|
|
194
197
|
### MenuList Component
|
|
195
198
|
- File: `docs/MenuList.md`
|
|
196
|
-
-
|
|
199
|
+
- **Aliases (LLM / search):** **Tabs**, **tab bar**, **tab list** — there is no separate Tabs component; use MenuList + parent-rendered panels (see “Tabs (in-page panels)” in `docs/MenuList.md`).
|
|
200
|
+
- Purpose: Renders a list of navigational items with optional icons, active state highlighting, and customizable layout. Use for nav menus, sidebars, dropdown actions, **and horizontal tab bars** with conditional panel content below.
|
|
197
201
|
- Key Features: items (label, value, icon), activeItem, direction (horizontal, vertical), sizes (small, medium, large), variants (light, dark), margin (suffix API), onMenuClick(item), Animated entrance
|
|
198
202
|
- Types: MenuListProps, MenuListItem, MenuListSize, MenuListVariant, MenuListDirection, MenuListMargin
|
|
199
|
-
- Related Components: Dropdown (content), Header (navigation), Container, Typography, Icon, Animated (used internally)
|
|
203
|
+
- Related Components: Dropdown (content), Header (navigation), Container (tab panels + layout), Typography, Icon, Animated (used internally)
|
|
200
204
|
|
|
201
205
|
### Header Component
|
|
202
206
|
- File: `docs/Header.md`
|
|
@@ -268,7 +272,7 @@ All documentation files follow a consistent format:
|
|
|
268
272
|
| Animated | `docs/Animated.md` | Scroll-triggered entrance/exit animations |
|
|
269
273
|
| FormControls | `docs/FormControls.md` | Form primitives (Input, Select, TextArea, Date, Checkbox, **numeric Stepper**, etc.) |
|
|
270
274
|
| Toast | `docs/Toast.md` | Transient messages via ref.addMessage |
|
|
271
|
-
| MenuList | `docs/MenuList.md` | Nav menus
|
|
275
|
+
| MenuList | `docs/MenuList.md` | Nav menus, link lists, **tabs / tab bar** (no separate Tabs) |
|
|
272
276
|
| Header | `docs/Header.md` | Responsive navigation header with logo and menu |
|
|
273
277
|
| PageHeader | `docs/PageHeader.md` | Page title, subtitle, primary CTA, and more menu |
|
|
274
278
|
| BottomSheet | `docs/BottomSheet.md` | Slide-up panel for forms and actions |
|