cleanplate 0.1.11 → 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 (72) hide show
  1. package/README.md +193 -60
  2. package/dist/components/accordion/Accordion.d.ts +23 -12
  3. package/dist/components/accordion/Accordion.d.ts.map +1 -1
  4. package/dist/components/accordion/index.d.ts +2 -1
  5. package/dist/components/accordion/index.d.ts.map +1 -1
  6. package/dist/components/app-shell/AppShell.d.ts +35 -3
  7. package/dist/components/app-shell/AppShell.d.ts.map +1 -1
  8. package/dist/components/app-shell/index.d.ts +2 -1
  9. package/dist/components/app-shell/index.d.ts.map +1 -1
  10. package/dist/components/bottom-sheet/BottomSheet.d.ts +17 -16
  11. package/dist/components/bottom-sheet/BottomSheet.d.ts.map +1 -1
  12. package/dist/components/bottom-sheet/index.d.ts +2 -1
  13. package/dist/components/bottom-sheet/index.d.ts.map +1 -1
  14. package/dist/components/breadcrumb/BreadCrumb.d.ts +26 -0
  15. package/dist/components/breadcrumb/BreadCrumb.d.ts.map +1 -0
  16. package/dist/components/breadcrumb/index.d.ts +3 -2
  17. package/dist/components/breadcrumb/index.d.ts.map +1 -1
  18. package/dist/components/footer/Footer.d.ts +21 -16
  19. package/dist/components/footer/Footer.d.ts.map +1 -1
  20. package/dist/components/footer/index.d.ts +2 -1
  21. package/dist/components/footer/index.d.ts.map +1 -1
  22. package/dist/components/header/Header.d.ts +32 -28
  23. package/dist/components/header/Header.d.ts.map +1 -1
  24. package/dist/components/header/index.d.ts +2 -1
  25. package/dist/components/header/index.d.ts.map +1 -1
  26. package/dist/components/icon/material-icon-names.d.ts +5 -5
  27. package/dist/components/icon/material-icon-names.d.ts.map +1 -1
  28. package/dist/components/menu-list/MenuList.d.ts +32 -22
  29. package/dist/components/menu-list/MenuList.d.ts.map +1 -1
  30. package/dist/components/menu-list/index.d.ts +2 -1
  31. package/dist/components/menu-list/index.d.ts.map +1 -1
  32. package/dist/components/page-header/PageHeader.d.ts +22 -3
  33. package/dist/components/page-header/PageHeader.d.ts.map +1 -1
  34. package/dist/components/page-header/index.d.ts +2 -1
  35. package/dist/components/page-header/index.d.ts.map +1 -1
  36. package/dist/components/toast/Toast.d.ts +20 -12
  37. package/dist/components/toast/Toast.d.ts.map +1 -1
  38. package/dist/components/toast/index.d.ts +2 -1
  39. package/dist/components/toast/index.d.ts.map +1 -1
  40. package/dist/index.css +1 -1
  41. package/dist/index.es.css +1 -1
  42. package/dist/index.es.js +3 -3
  43. package/dist/index.js +3 -3
  44. package/docs/Accordion.md +125 -0
  45. package/docs/Alert.md +131 -0
  46. package/docs/Animated.md +101 -0
  47. package/docs/AppShell.md +145 -0
  48. package/docs/Avatar.md +130 -0
  49. package/docs/Badge.md +83 -0
  50. package/docs/BottomSheet.md +78 -0
  51. package/docs/BreadCrumb.md +133 -0
  52. package/docs/Button.md +189 -0
  53. package/docs/ConfirmDialog.md +139 -0
  54. package/docs/Container.md +230 -0
  55. package/docs/Dropdown.md +175 -0
  56. package/docs/Footer.md +93 -0
  57. package/docs/FormControls.md +115 -0
  58. package/docs/Header.md +115 -0
  59. package/docs/Icon.md +225 -0
  60. package/docs/MediaObject.md +303 -0
  61. package/docs/MenuList.md +113 -0
  62. package/docs/Modal.md +152 -0
  63. package/docs/PageHeader.md +134 -0
  64. package/docs/Pagination.md +142 -0
  65. package/docs/Pills.md +104 -0
  66. package/docs/Spinner.md +115 -0
  67. package/docs/Stepper.md +131 -0
  68. package/docs/Table.md +194 -0
  69. package/docs/Toast.md +96 -0
  70. package/docs/Typography.md +231 -0
  71. package/llms.txt +293 -0
  72. package/package.json +6 -1
package/docs/Icon.md ADDED
@@ -0,0 +1,225 @@
1
+ # Icon Component
2
+
3
+ Purpose: A versatile and reusable element for displaying scalable vector icons, supporting various sizes, colors, and custom classes. It seamlessly integrates into user interfaces to enhance visual appeal and provide intuitive, meaningful representations using Google Material Symbols.
4
+
5
+ ## Props / Inputs
6
+
7
+ | Prop | Type | Required | Default | Description |
8
+ | --- | --- | --- | --- | --- |
9
+ | name | MaterialIconName | no | "" | The name of the Material Symbol icon to display. Use a value from `MATERIAL_ICON_NAMES` or `ICON_CATEGORIES` (see **Icon names and categories** below). |
10
+ | size | "small" \| "medium" \| "large" | no | "medium" | Size variant of the icon. |
11
+ | color | "black" \| "white" \| "gray" \| "blue" \| "green" \| "red" \| "yellow" \| "orange" | no | "black" | Color variant of the icon. |
12
+ | className | string | no | "" | Additional class names for the root element. |
13
+ | ...rest | React.HTMLAttributes<HTMLSpanElement> | no | — | All other standard HTML span attributes are supported and passed through to the rendered element. |
14
+
15
+ ## Types
16
+
17
+ ### IconSize
18
+ ```typescript
19
+ type IconSize = "small" | "medium" | "large";
20
+ ```
21
+
22
+ ### IconColor
23
+ ```typescript
24
+ type IconColor = "black" | "white" | "gray" | "blue" | "green" | "red" | "yellow" | "orange";
25
+ ```
26
+
27
+ ### IconProps
28
+ ```typescript
29
+ interface IconProps extends React.HTMLAttributes<HTMLSpanElement> {
30
+ name?: MaterialIconName;
31
+ size?: IconSize;
32
+ className?: string;
33
+ color?: IconColor;
34
+ }
35
+ ```
36
+
37
+ ### MaterialIconName
38
+ Icon names are typed as `MaterialIconName` (a union of all valid Material Symbols Outlined names). The package also exports `MATERIAL_ICON_NAMES` (array of all names) and `ICON_CATEGORIES` (icons grouped by purpose) from the Icon component’s generated `material-icon-names` module.
39
+
40
+ ## Icon names and categories
41
+
42
+ Icon names are sourced from the generated `material-icon-names` module. Icons are grouped into **categories** to make it easier to pick a name for the `name` prop. Use these when suggesting or choosing icons.
43
+
44
+ | Category | Description | Example icon names |
45
+ | --- | --- | --- |
46
+ | **navigation** | Back, forward, menu, home, close | `arrow_back`, `arrow_forward`, `home`, `menu`, `close` |
47
+ | **action** | Add, edit, delete, search, settings, refresh | `add`, `edit`, `delete`, `search`, `settings`, `refresh` |
48
+ | **communication** | Chat, email, message | `chat`, `chat_bubble`, `email`, `message` |
49
+ | **content** | Copy, cut, paste | `content_copy`, `content_cut`, `content_paste` |
50
+ | **device** | Phone, devices, thermostat | `phone`, `devices`, `device_thermostat`, `phonelink` |
51
+ | **editor** | Format, align, list, bold, italic | `format_bold`, `format_align_center`, `format_list_bulleted` |
52
+ | **file** | Folder, insert, drive | `folder`, `folder_open`, `insert_drive_file`, `insert_photo` |
53
+ | **hardware** | Keyboard, computer | `keyboard`, `computer`, `keyboard_arrow_down` |
54
+ | **image** | Photo, camera, image | `image`, `photo`, `photo_camera`, `photo_library` |
55
+ | **maps** | Map, place | `map`, `place`, `maps_ugc` |
56
+ | **notification** | Notifications, alerts | `notifications`, `notifications_active`, `notification_add` |
57
+ | **social** | Person, group, share | `person`, `person_add`, `group`, `share` |
58
+ | **toggle** | Check, checkbox, toggle | `check`, `check_circle`, `check_box`, `toggle_on` |
59
+ | **av** | Play, pause, volume | `play_arrow`, `pause`, `volume_up`, `volume_off` |
60
+ | **alert** | Error, warning | `error`, `error_outline`, `warning`, `warning_amber` |
61
+ | **other** | All remaining Material Symbols not in the above categories | Many additional names (e.g. `star`, `favorite`, `bookmark`, `progress_activity`) |
62
+
63
+ - Icon names are generated from the **Material Symbols Outlined** variable font (thousands of names). The `material-icon-names` module is generated by the project’s `generate-icons` script.
64
+ - For **full autocomplete** in TypeScript, use the `MaterialIconName` type or import `MATERIAL_ICON_NAMES` / `ICON_CATEGORIES` from `cleanplate` (or from the package’s icon module).
65
+ - Names use **underscores** (e.g. `cloud_upload`), not spaces.
66
+ - See [Google Fonts – Material Symbols & Icons](https://fonts.google.com/icons) for the full visual reference.
67
+
68
+ ## Installation
69
+
70
+ Before using the Icon component, you need to include the Material Symbols font in your project. Add the following link tag to the `<head>` of your `index.html`:
71
+
72
+ ```html
73
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
74
+ ```
75
+
76
+ ## Usage Examples
77
+
78
+ ### Basic icon
79
+
80
+ ```jsx
81
+ import { Icon } from "cleanplate";
82
+
83
+ export const Example = () => (
84
+ <Icon name="settings" />
85
+ );
86
+ ```
87
+
88
+ ### Different sizes
89
+
90
+ ```jsx
91
+ import { Icon } from "cleanplate";
92
+
93
+ export const Example = () => (
94
+ <>
95
+ <Icon name="home" size="small" />
96
+ <Icon name="home" size="medium" />
97
+ <Icon name="home" size="large" />
98
+ </>
99
+ );
100
+ ```
101
+
102
+ ### Different colors
103
+
104
+ ```jsx
105
+ import { Icon } from "cleanplate";
106
+
107
+ export const Example = () => (
108
+ <>
109
+ <Icon name="favorite" color="black" />
110
+ <Icon name="favorite" color="red" />
111
+ <Icon name="favorite" color="blue" />
112
+ <Icon name="favorite" color="green" />
113
+ </>
114
+ );
115
+ ```
116
+
117
+ ### Common icons
118
+
119
+ ```jsx
120
+ import { Icon } from "cleanplate";
121
+
122
+ export const Example = () => (
123
+ <>
124
+ <Icon name="home" />
125
+ <Icon name="settings" />
126
+ <Icon name="search" />
127
+ <Icon name="menu" />
128
+ <Icon name="close" />
129
+ <Icon name="add" />
130
+ <Icon name="delete" />
131
+ <Icon name="edit" />
132
+ <Icon name="download" />
133
+ <Icon name="cloud_upload" />
134
+ </>
135
+ );
136
+ ```
137
+
138
+ ### With custom className
139
+
140
+ ```jsx
141
+ import { Icon } from "cleanplate";
142
+
143
+ export const Example = () => (
144
+ <Icon
145
+ name="star"
146
+ className="custom-icon-class"
147
+ size="large"
148
+ color="yellow"
149
+ />
150
+ );
151
+ ```
152
+
153
+ ### With HTML attributes
154
+
155
+ ```jsx
156
+ import { Icon } from "cleanplate";
157
+
158
+ export const Example = () => (
159
+ <>
160
+ <Icon
161
+ name="info"
162
+ aria-label="Information icon"
163
+ data-testid="info-icon"
164
+ onClick={() => console.log("Icon clicked")}
165
+ />
166
+ <Icon
167
+ name="error"
168
+ id="error-icon"
169
+ title="Error occurred"
170
+ />
171
+ </>
172
+ );
173
+ ```
174
+
175
+ ### In buttons
176
+
177
+ ```jsx
178
+ import { Icon } from "cleanplate";
179
+ import { Button } from "cleanplate";
180
+
181
+ export const Example = () => (
182
+ <>
183
+ <Button>
184
+ <Icon name="save" size="small" />
185
+ Save
186
+ </Button>
187
+ <Button>
188
+ <Icon name="download" />
189
+ Download
190
+ </Button>
191
+ </>
192
+ );
193
+ ```
194
+
195
+ ### With Typography
196
+
197
+ ```jsx
198
+ import { Icon } from "cleanplate";
199
+ import { Typography } from "cleanplate";
200
+
201
+ export const Example = () => (
202
+ <Typography variant="p">
203
+ <Icon name="check_circle" color="green" size="small" />
204
+ {" "}Task completed
205
+ </Typography>
206
+ );
207
+ ```
208
+
209
+ ## Behavior Notes
210
+
211
+ - The component uses the **Material Symbols Outlined** font, which must be included in your project for icons to display correctly.
212
+ - Icon names must match the names from the [Material Symbols set](https://fonts.google.com/icons) (e.g. `progress_activity`, `cloud_upload`). Use underscores instead of spaces. Use the **Icon names and categories** table above to find names by purpose.
213
+ - The component renders as a `<span>` element, making it an inline element by default.
214
+ - If no `name` is provided, the icon will render as an empty span.
215
+ - The `color` prop applies predefined color classes. For custom colors, use the `className` prop with your own CSS.
216
+ - All standard HTML span attributes (like `onClick`, `aria-label`, `data-*`, etc.) are supported and passed through.
217
+ - Icons are scalable and will inherit the font size from their container if custom sizing is needed.
218
+ - The component is designed to work seamlessly with other CleanPlate components like Button, Typography, and Alert.
219
+
220
+ ## Related Components / Links
221
+
222
+ - Button (commonly uses icons for visual enhancement)
223
+ - Typography (often combined with icons for inline content)
224
+ - Alert (uses icons to indicate different alert types)
225
+ - [Material Symbols & Icons](https://fonts.google.com/icons) – Browse available icon names (Material Symbols Outlined)
@@ -0,0 +1,303 @@
1
+ # MediaObject Component
2
+
3
+ Purpose: A flexible layout pattern that combines media (icon, image, or avatar) with content (title and description). Perfect for displaying user profiles, product cards, notifications, and any content that needs a media element alongside text.
4
+
5
+ ## Props / Inputs
6
+
7
+ | Prop | Type | Required | Default | Description |
8
+ | --- | --- | --- | --- | --- |
9
+ | title | string | yes | — | The main title text displayed in the content area. |
10
+ | mediaIcon | string | no | "" | Icon name from Material Symbols to display as the media element. |
11
+ | mediaImage | string | no | "" | Image URL to display as the media element. |
12
+ | mediaAvatar | string | no | "" | Name used to generate an avatar with initials and background color. |
13
+ | description | string | no | — | Secondary text displayed below the title. |
14
+ | margin | string \| string[] | no | "0" | Spacing utility token(s) for outer margin, such as `m-0` or `["m-1", "m-b-2"]`. |
15
+ | padding | string \| string[] | no | "0" | Spacing utility token(s) for inner padding, such as `p-0` or `["p-1", "p-b-2"]`. |
16
+ | className | string | no | "media-object" | Additional class names for the root element. |
17
+ | onClick | function | no | — | Called with the click event when the media object is clicked. |
18
+ | ...rest | React.HTMLAttributes<HTMLDivElement> | no | — | All other standard HTML div attributes are supported and passed through to the rendered element. |
19
+
20
+ ## Types
21
+
22
+ ### MediaObjectMargin
23
+ ```typescript
24
+ type MediaObjectMargin = string | SpacingOption[];
25
+ ```
26
+
27
+ ### MediaObjectPadding
28
+ ```typescript
29
+ type MediaObjectPadding = string | SpacingOption[];
30
+ ```
31
+
32
+ ### SpacingOption
33
+ ```typescript
34
+ type SpacingOption = typeof SPACING_OPTIONS[number];
35
+ ```
36
+
37
+ ### MediaObjectProps
38
+ ```typescript
39
+ interface MediaObjectProps extends React.HTMLAttributes<HTMLDivElement> {
40
+ mediaIcon?: string;
41
+ mediaImage?: string;
42
+ mediaAvatar?: string;
43
+ title: string;
44
+ description?: string;
45
+ margin?: MediaObjectMargin;
46
+ padding?: MediaObjectPadding;
47
+ className?: string;
48
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
49
+ }
50
+ ```
51
+
52
+ ## Usage Examples
53
+
54
+ ### With icon
55
+
56
+ ```jsx
57
+ import { MediaObject } from "cleanplate";
58
+
59
+ export const Example = () => (
60
+ <MediaObject
61
+ mediaIcon="person"
62
+ title="User Profile"
63
+ description="Manage your account settings and preferences"
64
+ />
65
+ );
66
+ ```
67
+
68
+ ### With image
69
+
70
+ ```jsx
71
+ import { MediaObject } from "cleanplate";
72
+
73
+ export const Example = () => (
74
+ <MediaObject
75
+ mediaImage="https://example.com/avatar.jpg"
76
+ title="John Doe"
77
+ description="Senior Developer at Tech Corp"
78
+ />
79
+ );
80
+ ```
81
+
82
+ ### With avatar (initials)
83
+
84
+ ```jsx
85
+ import { MediaObject } from "cleanplate";
86
+
87
+ export const Example = () => (
88
+ <MediaObject
89
+ mediaAvatar="John Doe"
90
+ title="John Doe"
91
+ description="Senior Developer with 5+ years of experience"
92
+ />
93
+ );
94
+ ```
95
+
96
+ ### Title only
97
+
98
+ ```jsx
99
+ import { MediaObject } from "cleanplate";
100
+
101
+ export const Example = () => (
102
+ <MediaObject
103
+ mediaIcon="settings"
104
+ title="Settings"
105
+ />
106
+ );
107
+ ```
108
+
109
+ ### With margin and padding
110
+
111
+ ```jsx
112
+ import { MediaObject } from "cleanplate";
113
+
114
+ export const Example = () => (
115
+ <>
116
+ <MediaObject
117
+ mediaIcon="star"
118
+ title="Featured Item"
119
+ description="This item has custom spacing"
120
+ margin="m-3"
121
+ padding="p-2"
122
+ />
123
+ <MediaObject
124
+ mediaIcon="heart"
125
+ title="Another Item"
126
+ description="With multiple margin tokens"
127
+ margin={["m-1", "m-b-3"]}
128
+ padding={["p-1", "p-x-2"]}
129
+ />
130
+ </>
131
+ );
132
+ ```
133
+
134
+ ### Clickable media object
135
+
136
+ ```jsx
137
+ import { MediaObject } from "cleanplate";
138
+
139
+ export const Example = () => (
140
+ <MediaObject
141
+ mediaImage="https://example.com/product.jpg"
142
+ title="Wireless Headphones"
143
+ description="High-quality wireless headphones"
144
+ onClick={() => console.log("Media object clicked")}
145
+ />
146
+ );
147
+ ```
148
+
149
+ ### User profile card
150
+
151
+ ```jsx
152
+ import { MediaObject } from "cleanplate";
153
+ import { Button } from "cleanplate";
154
+
155
+ export const Example = () => (
156
+ <div style={{
157
+ border: "1px solid #e0e0e0",
158
+ borderRadius: "8px",
159
+ padding: "16px"
160
+ }}>
161
+ <MediaObject
162
+ mediaImage="https://example.com/avatar.jpg"
163
+ title="John Doe"
164
+ description="Senior Developer • john.doe@example.com"
165
+ />
166
+ <Button variant="outline" size="small" margin="m-t-3">
167
+ Edit Profile
168
+ </Button>
169
+ </div>
170
+ );
171
+ ```
172
+
173
+ ### Product card
174
+
175
+ ```jsx
176
+ import { MediaObject } from "cleanplate";
177
+ import { Typography } from "cleanplate";
178
+ import { Button } from "cleanplate";
179
+
180
+ export const Example = () => (
181
+ <div style={{
182
+ border: "1px solid #e0e0e0",
183
+ borderRadius: "8px",
184
+ padding: "16px"
185
+ }}>
186
+ <MediaObject
187
+ mediaImage="https://example.com/product.jpg"
188
+ title="Wireless Headphones"
189
+ description="High-quality wireless headphones with noise cancellation"
190
+ />
191
+ <div style={{ marginTop: "12px", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
192
+ <Typography variant="h5">$199.99</Typography>
193
+ <Button size="small" variant="outline">Add to Cart</Button>
194
+ </div>
195
+ </div>
196
+ );
197
+ ```
198
+
199
+ ### Notification list
200
+
201
+ ```jsx
202
+ import { MediaObject } from "cleanplate";
203
+
204
+ export const Example = () => (
205
+ <div>
206
+ <MediaObject
207
+ mediaIcon="notifications"
208
+ title="New Message"
209
+ description="You have received a new message from Jane Smith"
210
+ margin="m-b-2"
211
+ />
212
+ <MediaObject
213
+ mediaIcon="schedule"
214
+ title="Meeting Reminder"
215
+ description="Team standup in 30 minutes"
216
+ margin="m-b-2"
217
+ />
218
+ <MediaObject
219
+ mediaIcon="done"
220
+ title="Task Completed"
221
+ description="Your project 'Website Redesign' has been updated"
222
+ />
223
+ </div>
224
+ );
225
+ ```
226
+
227
+ ### Settings items
228
+
229
+ ```jsx
230
+ import { MediaObject } from "cleanplate";
231
+
232
+ export const Example = () => (
233
+ <div>
234
+ <MediaObject
235
+ mediaIcon="settings"
236
+ title="Account Settings"
237
+ description="Manage your account preferences and security settings"
238
+ margin="m-b-2"
239
+ />
240
+ <MediaObject
241
+ mediaIcon="lock"
242
+ title="Privacy & Security"
243
+ description="Control your privacy settings and security options"
244
+ margin="m-b-2"
245
+ />
246
+ <MediaObject
247
+ mediaIcon="notifications"
248
+ title="Notifications"
249
+ description="Configure how and when you receive notifications"
250
+ />
251
+ </div>
252
+ );
253
+ ```
254
+
255
+ ### List of users
256
+
257
+ ```jsx
258
+ import { MediaObject } from "cleanplate";
259
+
260
+ export const Example = () => {
261
+ const users = [
262
+ { name: "John Doe", role: "Developer", avatar: "https://example.com/avatar1.jpg" },
263
+ { name: "Jane Smith", role: "Designer", avatar: "https://example.com/avatar2.jpg" },
264
+ { name: "Mike Johnson", role: "Manager", avatar: "https://example.com/avatar3.jpg" }
265
+ ];
266
+
267
+ return (
268
+ <div>
269
+ {users.map((user, index) => (
270
+ <MediaObject
271
+ key={index}
272
+ mediaImage={user.avatar}
273
+ title={user.name}
274
+ description={user.role}
275
+ margin={index < users.length - 1 ? "m-b-2" : "m-0"}
276
+ />
277
+ ))}
278
+ </div>
279
+ );
280
+ };
281
+ ```
282
+
283
+ ## Behavior Notes
284
+
285
+ - The `title` prop is required and will always be displayed in bold text.
286
+ - The `description` prop is optional. If not provided, only the title will be displayed.
287
+ - You can provide one of `mediaIcon`, `mediaImage`, or `mediaAvatar` to display the media element. If multiple are provided, the component will prioritize in this order: `mediaAvatar` > `mediaImage` > `mediaIcon`.
288
+ - The component uses the `Avatar` component internally to render the media element, which supports icons, images, and generated avatars with initials.
289
+ - The component uses the `Typography` component internally for the title and description text.
290
+ - The title is rendered with `isBold={true}` by default.
291
+ - The description is rendered with `variant="small"`.
292
+ - The component renders as a `<div>` element with a flex layout structure.
293
+ - Margin and padding spacing accept either a single string token (e.g., `"m-2"`) or an array of tokens (e.g., `["m-1", "m-b-3"]`).
294
+ - The `onClick` handler makes the entire media object clickable, useful for interactive lists or cards.
295
+ - All standard HTML div attributes can be passed through, allowing for custom `id`, `data-*`, `aria-*`, and other attributes.
296
+ - The component is designed to be responsive and adapts to different screen sizes.
297
+
298
+ ## Related Components / Links
299
+
300
+ - Avatar (used internally for the media element)
301
+ - Typography (used internally for title and description)
302
+ - Button (often used alongside MediaObject in cards)
303
+ - Container (commonly used to wrap MediaObject components)
@@ -0,0 +1,113 @@
1
+ # MenuList Component
2
+
3
+ Purpose: Renders a list of navigational items with optional icons, active state highlighting, and customizable layout. Use for nav menus, sidebars, or link lists. 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
+
5
+ ## Props / Inputs
6
+
7
+ | Prop | Type | Required | Default | Description |
8
+ | --- | --- | --- | --- | --- |
9
+ | items | MenuListItem[] | yes | — | List of menu items; each has label, value, optional icon. |
10
+ | activeItem | string | no | — | Value of the currently active item (matches item.value). |
11
+ | size | "small" \| "medium" \| "large" | no | — | Size of menu items. |
12
+ | variant | "light" \| "dark" | no | — | Visual variant. |
13
+ | direction | "horizontal" \| "vertical" | no | "horizontal" | Layout direction of the list. |
14
+ | margin | string \| SpacingOption[] | no | — | Spacing suffix(s) for outer margin; component adds m- prefix. |
15
+ | className | string | no | "" | Additional class names for the root element. |
16
+ | onMenuClick | (item: MenuListItem) => void | no | — | Called when a menu item is clicked; receives the clicked item. |
17
+
18
+ ## Types
19
+
20
+ ### MenuListItem
21
+ ```typescript
22
+ interface MenuListItem {
23
+ label: string;
24
+ value: string;
25
+ icon?: MaterialIconName; // optional Material icon name
26
+ }
27
+ ```
28
+
29
+ ### MenuListSize
30
+ ```typescript
31
+ type MenuListSize = "small" | "medium" | "large";
32
+ ```
33
+
34
+ ### MenuListVariant
35
+ ```typescript
36
+ type MenuListVariant = "light" | "dark";
37
+ ```
38
+
39
+ ### MenuListDirection
40
+ ```typescript
41
+ type MenuListDirection = "horizontal" | "vertical";
42
+ ```
43
+
44
+ ### MenuListProps
45
+ ```typescript
46
+ interface MenuListProps {
47
+ items: MenuListItem[];
48
+ activeItem?: string;
49
+ size?: MenuListSize;
50
+ variant?: MenuListVariant;
51
+ direction?: MenuListDirection;
52
+ margin?: MenuListMargin;
53
+ className?: string;
54
+ onMenuClick?: (item: MenuListItem) => void;
55
+ }
56
+ ```
57
+
58
+ ## Usage Examples
59
+
60
+ ### Basic
61
+
62
+ ```jsx
63
+ import { useState } from "react";
64
+ import { MenuList } from "cleanplate";
65
+
66
+ const ITEMS = [
67
+ { label: "Dashboard", value: "/", icon: "speed" },
68
+ { label: "Projects", value: "/projects", icon: "receipt_long" },
69
+ ];
70
+
71
+ const Nav = () => {
72
+ const [activeItem, setActiveItem] = useState("/");
73
+ return (
74
+ <MenuList
75
+ items={ITEMS}
76
+ activeItem={activeItem}
77
+ onMenuClick={(item) => setActiveItem(item.value)}
78
+ />
79
+ );
80
+ };
81
+ ```
82
+
83
+ ### Directions and variants
84
+
85
+ ```jsx
86
+ <MenuList items={items} direction="horizontal" activeItem={activeItem} onMenuClick={handleClick} />
87
+ <MenuList items={items} direction="vertical" activeItem={activeItem} onMenuClick={handleClick} />
88
+ <MenuList items={items} variant="light" activeItem={activeItem} onMenuClick={handleClick} />
89
+ <MenuList items={items} variant="dark" activeItem={activeItem} onMenuClick={handleClick} />
90
+ ```
91
+
92
+ ### Sizes
93
+
94
+ ```jsx
95
+ <MenuList items={items} size="small" activeItem={activeItem} onMenuClick={handleClick} />
96
+ <MenuList items={items} size="medium" activeItem={activeItem} onMenuClick={handleClick} />
97
+ <MenuList items={items} size="large" activeItem={activeItem} onMenuClick={handleClick} />
98
+ ```
99
+
100
+ ## Behavior Notes
101
+
102
+ - **Items:** Each item must have `label` and `value`. `icon` is optional (Material icon name).
103
+ - **onMenuClick:** Called with the clicked item. Use it to update `activeItem` or navigate.
104
+ - **DOM:** A `div` wrapping a `ul` of `li` elements; each `li` contains an anchor.
105
+ - **Animated:** Each item is wrapped in Animated with `fade-in-left` and staggered delay.
106
+ - **Margin:** Uses the suffix API (e.g. `"0"` → m-0, `"b-2"` → m-b-2).
107
+
108
+ ## Related Components / Links
109
+
110
+ - Dropdown (often uses MenuList inside for menu items)
111
+ - Header (commonly uses MenuList for navigation)
112
+ - Container (layout around the menu)
113
+ - Typography, Icon, Animated (used internally)