@cere/cere-design-system 0.0.9 → 0.0.13

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.
@@ -0,0 +1,1353 @@
1
+ # Cere Design System - Component Reference
2
+
3
+ You are a senior UI developer with expertise in React, TypeScript, Material-UI, and the Cere Design System.
4
+ When building applications using this design system, follow these guidelines and use the components documented below.
5
+
6
+ ## Installation & Setup
7
+
8
+ ```typescript
9
+ import { ThemeProvider } from '@emotion/react';
10
+ import { theme } from '@cere/cere-design-system';
11
+
12
+ // Wrap your application with the theme provider
13
+ <ThemeProvider theme={theme}>
14
+ <YourApp />
15
+ </ThemeProvider>
16
+ ```
17
+
18
+ ## Theme & Colors
19
+
20
+ Import theme and colors from the package:
21
+
22
+ ```typescript
23
+ import { theme, colors } from '@cere/cere-design-system';
24
+ ```
25
+
26
+ **Theme Configuration:**
27
+ - Primary color: `#1976d2` (blue)
28
+ - Font family: Inter
29
+ - Border radius: 12px for inputs/buttons, 16px for cards/chips
30
+ - Breakpoints: xs, sm, md, lg, xl (standard Material-UI)
31
+
32
+ **Available Color Palettes:**
33
+ - `colors.primary` - main, light, dark, contrastText
34
+ - `colors.secondary` - main, light, dark, contrastText
35
+ - `colors.tertiary` - main (orange/amber)
36
+ - `colors.error`, `colors.warning`, `colors.info`, `colors.success`
37
+ - `colors.grey` - 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
38
+ - `colors.background` - default, paper, selected
39
+ - `colors.text` - primary, secondary, disabled
40
+
41
+ ## Responsive Hooks
42
+
43
+ ```typescript
44
+ import { useIsDesktop, useIsTablet, useIsMobile } from '@cere/cere-design-system';
45
+
46
+ const isDesktop = useIsDesktop(); // > 1024px
47
+ const isTablet = useIsTablet(); // 768px - 1024px
48
+ const isMobile = useIsMobile(); // < 768px
49
+ ```
50
+
51
+ ## Messaging System
52
+
53
+ ```typescript
54
+ import { MessagesProvider, useMessages } from '@cere/cere-design-system';
55
+
56
+ // Wrap app with MessagesProvider
57
+ <MessagesProvider><App /></MessagesProvider>
58
+
59
+ // Use in components
60
+ const { showMessage } = useMessages();
61
+ showMessage('Success!', { severity: 'success', duration: 3000 });
62
+ ```
63
+
64
+ ---
65
+
66
+ ## BUTTONS
67
+
68
+ ### Button
69
+ Primary, secondary, and tertiary button variants with icons.
70
+
71
+ ```typescript
72
+ import { Button } from '@cere/cere-design-system';
73
+ import type { ButtonProps } from '@cere/cere-design-system';
74
+
75
+ <Button variant="primary" size="medium" startIcon={<Icon />}>
76
+ Click Me
77
+ </Button>
78
+ ```
79
+
80
+ **Props:**
81
+ - `variant?: 'primary' | 'secondary' | 'tertiary'` - Button style (default: 'primary')
82
+ - `size?: 'small' | 'medium' | 'large'` - Button size
83
+ - `startIcon?: ReactNode` - Icon before text
84
+ - `endIcon?: ReactNode` - Icon after text
85
+ - `disabled?: boolean` - Disable button
86
+ - `onClick?: () => void` - Click handler
87
+ - `fullWidth?: boolean` - Full width button
88
+ - `type?: 'button' | 'submit' | 'reset'` - Button type
89
+ - All standard MUI Button props
90
+
91
+ ### IconButton
92
+ Button with only an icon, no text.
93
+
94
+ ```typescript
95
+ import { IconButton } from '@cere/cere-design-system';
96
+
97
+ <IconButton size="medium" aria-label="delete">
98
+ <DeleteIcon />
99
+ </IconButton>
100
+ ```
101
+
102
+ **Props:**
103
+ - `size?: 'small' | 'medium' | 'large'`
104
+ - `disabled?: boolean`
105
+ - `onClick?: () => void`
106
+ - `edge?: 'start' | 'end' | false`
107
+ - `color?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning'`
108
+
109
+ ### LoadingButton
110
+ Button with loading state and spinner.
111
+
112
+ ```typescript
113
+ import { LoadingButton } from '@cere/cere-design-system';
114
+
115
+ <LoadingButton loading={isLoading} variant="primary">
116
+ Submit
117
+ </LoadingButton>
118
+ ```
119
+
120
+ **Props:**
121
+ - Same as `Button` props
122
+ - `loading?: boolean` - Show loading spinner
123
+ - `loadingPosition?: 'start' | 'end' | 'center'` - Spinner position
124
+
125
+ ### ButtonGroup
126
+ Group related buttons together.
127
+
128
+ ```typescript
129
+ import { ButtonGroup, Button } from '@cere/cere-design-system';
130
+
131
+ <ButtonGroup variant="contained" size="medium">
132
+ <Button>One</Button>
133
+ <Button>Two</Button>
134
+ <Button>Three</Button>
135
+ </ButtonGroup>
136
+ ```
137
+
138
+ **Props:**
139
+ - `variant?: 'text' | 'outlined' | 'contained'`
140
+ - `size?: 'small' | 'medium' | 'large'`
141
+ - `orientation?: 'horizontal' | 'vertical'`
142
+ - `disabled?: boolean`
143
+ - `fullWidth?: boolean`
144
+
145
+ ---
146
+
147
+ ## INPUTS
148
+
149
+ ### TextField
150
+ Text input field with label and validation.
151
+
152
+ ```typescript
153
+ import { TextField } from '@cere/cere-design-system';
154
+
155
+ <TextField
156
+ label="Email"
157
+ value={email}
158
+ onChange={(e) => setEmail(e.target.value)}
159
+ error={!!error}
160
+ helperText={error}
161
+ required
162
+ />
163
+ ```
164
+
165
+ **Props:**
166
+ - `size?: 'small' | 'medium'`
167
+ - `label?: string` - Input label
168
+ - `value?: string` - Input value
169
+ - `onChange?: (e) => void` - Change handler
170
+ - `error?: boolean` - Show error state
171
+ - `helperText?: string` - Helper/error text below input
172
+ - `required?: boolean` - Required field indicator
173
+ - `disabled?: boolean`
174
+ - `multiline?: boolean` - Textarea mode
175
+ - `rows?: number` - Number of rows for multiline
176
+ - `type?: string` - Input type (text, password, email, etc.)
177
+ - `placeholder?: string`
178
+ - `fullWidth?: boolean`
179
+ - `InputProps?: object` - Custom input props (adornments, etc.)
180
+
181
+ ### SearchField
182
+ Search input with search icon.
183
+
184
+ ```typescript
185
+ import { SearchField } from '@cere/cere-design-system';
186
+
187
+ <SearchField
188
+ value={query}
189
+ onChange={(e) => setQuery(e.target.value)}
190
+ placeholder="Search..."
191
+ />
192
+ ```
193
+
194
+ **Props:**
195
+ - Same as `TextField` props
196
+ - Automatically includes search icon
197
+
198
+ ### Dropdown (Select/Autocomplete)
199
+ Two variants: input dropdown and navigation dropdown.
200
+
201
+ ```typescript
202
+ // Input variant (Select)
203
+ import { Dropdown } from '@cere/cere-design-system';
204
+
205
+ <Dropdown
206
+ label="Select Option"
207
+ value={value}
208
+ onChange={(e) => setValue(e.target.value)}
209
+ options={[
210
+ { value: '1', label: 'Option 1' },
211
+ { value: '2', label: 'Option 2' }
212
+ ]}
213
+ />
214
+
215
+ // Navigation variant (Popover)
216
+ <Dropdown
217
+ variant="button"
218
+ label="Menu"
219
+ open={open}
220
+ onToggle={(isOpen) => setOpen(isOpen)}
221
+ >
222
+ <MenuItem>Item 1</MenuItem>
223
+ <MenuItem>Item 2</MenuItem>
224
+ </Dropdown>
225
+ ```
226
+
227
+ **Props (Navigation Dropdown):**
228
+ - `variant: 'header' | 'button'` - Dropdown style (required)
229
+ - `open: boolean` - Open state (required)
230
+ - `onToggle?: (open: boolean) => void` - Toggle handler
231
+ - `label?: string` - Button label
232
+ - `leftElement?: ReactNode` - Icon/element before label
233
+ - `direction?: 'right' | 'left'` - Dropdown direction (default: 'left')
234
+ - `dense?: boolean` - Compact spacing
235
+ - `disableGutters?: boolean` - Remove horizontal padding
236
+ - `disablePaddings?: boolean` - Remove all padding
237
+ - `renderAnchor?: (options) => ReactNode` - Custom anchor renderer
238
+
239
+ ### Switch
240
+ Toggle switch component.
241
+
242
+ ```typescript
243
+ import { Switch } from '@cere/cere-design-system';
244
+
245
+ <Switch checked={enabled} onChange={(e) => setEnabled(e.target.checked)} />
246
+ ```
247
+
248
+ **Props:**
249
+ - `checked?: boolean` - Checked state
250
+ - `onChange?: (e) => void` - Change handler
251
+ - `disabled?: boolean`
252
+ - `size?: 'small' | 'medium'`
253
+ - `color?: 'primary' | 'secondary' | 'default'`
254
+
255
+ ### Checkbox
256
+ Checkbox input.
257
+
258
+ ```typescript
259
+ import { Checkbox } from '@cere/cere-design-system';
260
+
261
+ <Checkbox checked={agreed} onChange={(e) => setAgreed(e.target.checked)} />
262
+ ```
263
+
264
+ **Props:**
265
+ - `checked?: boolean`
266
+ - `onChange?: (e) => void`
267
+ - `disabled?: boolean`
268
+ - `indeterminate?: boolean` - Partially checked state
269
+ - `size?: 'small' | 'medium'`
270
+ - `color?: 'primary' | 'secondary' | 'default'`
271
+
272
+ ### Radio & RadioGroup
273
+ Radio button inputs.
274
+
275
+ ```typescript
276
+ import { Radio, RadioGroup, FormControlLabel } from '@cere/cere-design-system';
277
+
278
+ <RadioGroup value={value} onChange={(e) => setValue(e.target.value)}>
279
+ <FormControlLabel value="1" control={<Radio />} label="Option 1" />
280
+ <FormControlLabel value="2" control={<Radio />} label="Option 2" />
281
+ </RadioGroup>
282
+ ```
283
+
284
+ **Props:**
285
+ - `value?: string` - Selected value
286
+ - `onChange?: (e) => void` - Change handler
287
+ - `name?: string` - Group name
288
+ - `row?: boolean` - Horizontal layout
289
+
290
+ ### ToggleButton & ToggleButtonGroup
291
+ Toggle button for selecting options.
292
+
293
+ ```typescript
294
+ import { ToggleButton, ToggleButtonGroup } from '@cere/cere-design-system';
295
+
296
+ <ToggleButtonGroup value={alignment} exclusive onChange={(e, val) => setAlignment(val)}>
297
+ <ToggleButton value="left">Left</ToggleButton>
298
+ <ToggleButton value="center">Center</ToggleButton>
299
+ <ToggleButton value="right">Right</ToggleButton>
300
+ </ToggleButtonGroup>
301
+ ```
302
+
303
+ **Props:**
304
+ - `value?: any` - Selected value(s)
305
+ - `onChange?: (e, value) => void` - Change handler
306
+ - `exclusive?: boolean` - Single selection mode
307
+ - `size?: 'small' | 'medium' | 'large'`
308
+ - `disabled?: boolean`
309
+ - `orientation?: 'horizontal' | 'vertical'`
310
+
311
+ ### Form Components
312
+ Form control wrappers and labels.
313
+
314
+ ```typescript
315
+ import {
316
+ FormControl,
317
+ FormLabel,
318
+ FormHelperText,
319
+ FormControlLabel,
320
+ InputLabel,
321
+ InputAdornment
322
+ } from '@cere/cere-design-system';
323
+
324
+ <FormControl>
325
+ <FormLabel>Label</FormLabel>
326
+ <TextField />
327
+ <FormHelperText>Helper text</FormHelperText>
328
+ </FormControl>
329
+ ```
330
+
331
+ ---
332
+
333
+ ## NAVIGATION
334
+
335
+ ### Sidebar & SidebarItem
336
+ Application sidebar navigation.
337
+
338
+ ```typescript
339
+ import { Sidebar, SidebarItem } from '@cere/cere-design-system';
340
+
341
+ <Sidebar>
342
+ <SidebarItem icon={<HomeIcon />} label="Home" active />
343
+ <SidebarItem icon={<SettingsIcon />} label="Settings" />
344
+ </Sidebar>
345
+ ```
346
+
347
+ **Sidebar Props:**
348
+ - `width?: number` - Sidebar width in pixels
349
+ - `collapsed?: boolean` - Collapsed state
350
+
351
+ **SidebarItem Props:**
352
+ - `icon?: ReactNode` - Item icon
353
+ - `label: string` - Item label
354
+ - `active?: boolean` - Active/selected state
355
+ - `onClick?: () => void` - Click handler
356
+ - `disabled?: boolean`
357
+ - `badge?: string | number` - Badge content
358
+
359
+ ### Tab
360
+ Tab navigation component.
361
+
362
+ ```typescript
363
+ import { Tab } from '@cere/cere-design-system';
364
+
365
+ <Tab value={value} onChange={(e, val) => setValue(val)}>
366
+ <Tab label="Tab 1" value="1" />
367
+ <Tab label="Tab 2" value="2" />
368
+ </Tab>
369
+ ```
370
+
371
+ **Props:**
372
+ - `value?: any` - Active tab value
373
+ - `onChange?: (e, value) => void` - Change handler
374
+ - `variant?: 'standard' | 'scrollable' | 'fullWidth'`
375
+ - `orientation?: 'horizontal' | 'vertical'`
376
+
377
+ ### Menu & MenuItem
378
+ Context menu or dropdown menu.
379
+
380
+ ```typescript
381
+ import { Menu, MenuItem } from '@cere/cere-design-system';
382
+
383
+ <Menu open={open} onClose={() => setOpen(false)} anchorEl={anchorEl}>
384
+ <MenuItem onClick={handleEdit}>Edit</MenuItem>
385
+ <MenuItem onClick={handleDelete}>Delete</MenuItem>
386
+ </Menu>
387
+ ```
388
+
389
+ **Menu Props:**
390
+ - `open: boolean` - Open state
391
+ - `onClose?: () => void` - Close handler
392
+ - `anchorEl?: Element` - Anchor element
393
+
394
+ **MenuItem Props:**
395
+ - `onClick?: () => void` - Click handler
396
+ - `disabled?: boolean`
397
+ - `selected?: boolean`
398
+
399
+ ### Pagination
400
+ Pagination controls.
401
+
402
+ ```typescript
403
+ import { Pagination } from '@cere/cere-design-system';
404
+
405
+ <Pagination
406
+ count={10}
407
+ page={page}
408
+ onChange={(e, p) => setPage(p)}
409
+ />
410
+ ```
411
+
412
+ **Props:**
413
+ - `count: number` - Total pages
414
+ - `page?: number` - Current page (1-indexed)
415
+ - `onChange?: (e, page) => void` - Page change handler
416
+ - `size?: 'small' | 'medium' | 'large'`
417
+ - `variant?: 'text' | 'outlined'`
418
+ - `color?: 'primary' | 'secondary' | 'standard'`
419
+ - `showFirstButton?: boolean`
420
+ - `showLastButton?: boolean`
421
+
422
+ ### Selector
423
+ Option selector dropdown.
424
+
425
+ ```typescript
426
+ import { Selector } from '@cere/cere-design-system';
427
+ import type { SelectorOption } from '@cere/cere-design-system';
428
+
429
+ const options: SelectorOption[] = [
430
+ { id: '1', label: 'Option 1', value: 'val1' },
431
+ { id: '2', label: 'Option 2', value: 'val2' }
432
+ ];
433
+
434
+ <Selector
435
+ options={options}
436
+ value={selected}
437
+ onChange={(option) => setSelected(option)}
438
+ />
439
+ ```
440
+
441
+ **Props:**
442
+ - `options: SelectorOption[]` - Available options
443
+ - `value?: SelectorOption` - Selected option
444
+ - `onChange?: (option) => void` - Change handler
445
+ - `placeholder?: string`
446
+
447
+ ### Stepper
448
+ Step-by-step progress indicator.
449
+
450
+ ```typescript
451
+ import { Stepper, Step, StepLabel, StepContent, StepButton } from '@cere/cere-design-system';
452
+
453
+ <Stepper activeStep={activeStep} orientation="vertical">
454
+ <Step>
455
+ <StepLabel>Step 1</StepLabel>
456
+ <StepContent>Content 1</StepContent>
457
+ </Step>
458
+ <Step>
459
+ <StepLabel>Step 2</StepLabel>
460
+ <StepContent>Content 2</StepContent>
461
+ </Step>
462
+ </Stepper>
463
+ ```
464
+
465
+ **Props:**
466
+ - `activeStep?: number` - Current step index
467
+ - `orientation?: 'horizontal' | 'vertical'`
468
+ - `alternativeLabel?: boolean`
469
+ - `nonLinear?: boolean` - Allow non-sequential navigation
470
+
471
+ ### Service & Workspace Selectors
472
+ Special navigation components for selecting services/workspaces.
473
+
474
+ ```typescript
475
+ import { ServiceSelectorButton, WorkspaceSelectorButton } from '@cere/cere-design-system';
476
+ import type { Service, Workspace } from '@cere/cere-design-system';
477
+
478
+ <ServiceSelectorButton
479
+ services={services}
480
+ selected={currentService}
481
+ onSelect={(service) => setCurrentService(service)}
482
+ />
483
+
484
+ <WorkspaceSelectorButton
485
+ workspaces={workspaces}
486
+ selected={currentWorkspace}
487
+ onSelect={(workspace) => setCurrentWorkspace(workspace)}
488
+ />
489
+ ```
490
+
491
+ ### Breadcrumbs
492
+ Breadcrumb navigation.
493
+
494
+ ```typescript
495
+ import { Breadcrumbs } from '@cere/cere-design-system';
496
+ import type { BreadcrumbItem } from '@cere/cere-design-system';
497
+
498
+ const items: BreadcrumbItem[] = [
499
+ { label: 'Home', href: '/' },
500
+ { label: 'Category', href: '/category' },
501
+ { label: 'Current Page' }
502
+ ];
503
+
504
+ <Breadcrumbs items={items} />
505
+ ```
506
+
507
+ **Props:**
508
+ - `items: BreadcrumbItem[]` - Breadcrumb items
509
+ - `maxItems?: number` - Max items to display before collapsing
510
+ - `separator?: ReactNode` - Custom separator
511
+
512
+ ---
513
+
514
+ ## LAYOUT
515
+
516
+ ### Card
517
+ Container card with header, content, and actions.
518
+
519
+ ```typescript
520
+ import { Card, CardHeader, CardContent, CardActions, Button } from '@cere/cere-design-system';
521
+
522
+ <Card hoverable clickable onClick={handleClick}>
523
+ <CardHeader title="Card Title" subheader="Subtitle" />
524
+ <CardContent>Card content here</CardContent>
525
+ <CardActions>
526
+ <Button>Action</Button>
527
+ </CardActions>
528
+ </Card>
529
+ ```
530
+
531
+ **Card Props:**
532
+ - `hoverable?: boolean` - Lift on hover effect
533
+ - `clickable?: boolean` - Cursor pointer, click effect
534
+ - `elevation?: number` - Shadow elevation (0-24)
535
+ - All standard MUI Card props
536
+
537
+ ### Dialog
538
+ Modal dialog/popup.
539
+
540
+ ```typescript
541
+ import { Dialog, Button } from '@cere/cere-design-system';
542
+
543
+ <Dialog
544
+ open={open}
545
+ onClose={() => setOpen(false)}
546
+ title="Dialog Title"
547
+ maxWidth="sm"
548
+ fullWidth
549
+ >
550
+ <div>Dialog content</div>
551
+ </Dialog>
552
+ ```
553
+
554
+ **Props:**
555
+ - `open: boolean` - Open state
556
+ - `onClose?: () => void` - Close handler
557
+ - `title?: string` - Dialog title
558
+ - `maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false`
559
+ - `fullWidth?: boolean`
560
+ - `fullScreen?: boolean`
561
+
562
+ ### Drawer
563
+ Side drawer panel.
564
+
565
+ ```typescript
566
+ import { Drawer } from '@cere/cere-design-system';
567
+
568
+ <Drawer
569
+ open={open}
570
+ onClose={() => setOpen(false)}
571
+ anchor="right"
572
+ >
573
+ <div>Drawer content</div>
574
+ </Drawer>
575
+ ```
576
+
577
+ **Props:**
578
+ - `open: boolean` - Open state
579
+ - `onClose?: () => void` - Close handler
580
+ - `anchor?: 'left' | 'right' | 'top' | 'bottom'`
581
+ - `variant?: 'permanent' | 'persistent' | 'temporary'`
582
+
583
+ ### List & ListItem
584
+ Lists with items.
585
+
586
+ ```typescript
587
+ import { List, ListItem, ListItemText, ListItemIcon, ListItemSecondaryAction } from '@cere/cere-design-system';
588
+
589
+ <List>
590
+ <ListItem button onClick={handleClick}>
591
+ <ListItemIcon><Icon /></ListItemIcon>
592
+ <ListItemText primary="Primary Text" secondary="Secondary Text" />
593
+ <ListItemSecondaryAction>
594
+ <IconButton><MoreIcon /></IconButton>
595
+ </ListItemSecondaryAction>
596
+ </ListItem>
597
+ </List>
598
+ ```
599
+
600
+ **Props:**
601
+ - `dense?: boolean` - Compact spacing
602
+ - `disablePadding?: boolean`
603
+ - `button?: boolean` - Make item clickable (ListItem prop)
604
+ - `divider?: boolean` - Show divider (ListItem prop)
605
+
606
+ ### Table
607
+ Data table with headers.
608
+
609
+ ```typescript
610
+ import { Table, TableHeader } from '@cere/cere-design-system';
611
+
612
+ const columns = [
613
+ { id: 'name', label: 'Name' },
614
+ { id: 'email', label: 'Email' }
615
+ ];
616
+
617
+ <Table
618
+ columns={columns}
619
+ data={rows}
620
+ onSort={(column) => handleSort(column)}
621
+ />
622
+ ```
623
+
624
+ **Props:**
625
+ - `columns: TableColumn[]` - Column definitions
626
+ - `data: any[]` - Table data rows
627
+ - `onSort?: (column) => void` - Sort handler
628
+ - `stickyHeader?: boolean`
629
+ - `size?: 'small' | 'medium'`
630
+
631
+ ### Avatar
632
+ User avatar image or initials.
633
+
634
+ ```typescript
635
+ import { Avatar } from '@cere/cere-design-system';
636
+
637
+ <Avatar src="/avatar.jpg" alt="User" />
638
+ <Avatar>JD</Avatar>
639
+ ```
640
+
641
+ **Props:**
642
+ - `src?: string` - Image source
643
+ - `alt?: string` - Alt text
644
+ - `size?: 'small' | 'medium' | 'large'` | number
645
+ - `variant?: 'circular' | 'rounded' | 'square'`
646
+ - `children?: ReactNode` - Text/initials
647
+
648
+ ### Grid
649
+ Responsive grid layout.
650
+
651
+ ```typescript
652
+ import { Grid } from '@cere/cere-design-system';
653
+
654
+ <Grid container spacing={2}>
655
+ <Grid item xs={12} md={6}>Column 1</Grid>
656
+ <Grid item xs={12} md={6}>Column 2</Grid>
657
+ </Grid>
658
+ ```
659
+
660
+ **Props:**
661
+ - `container?: boolean` - Grid container
662
+ - `item?: boolean` - Grid item
663
+ - `spacing?: number` - Gap between items (0-10)
664
+ - `xs?: number | 'auto'` - Mobile columns (1-12)
665
+ - `sm?: number | 'auto'` - Tablet columns
666
+ - `md?: number | 'auto'` - Desktop columns
667
+ - `lg?: number | 'auto'` - Large desktop columns
668
+ - `xl?: number | 'auto'` - XL desktop columns
669
+
670
+ ### Box, Stack, Container
671
+ Layout utilities.
672
+
673
+ ```typescript
674
+ import { Box, Stack, Container } from '@cere/cere-design-system';
675
+
676
+ <Container maxWidth="lg">
677
+ <Stack spacing={2} direction="row">
678
+ <Box sx={{ p: 2, bgcolor: 'primary.main' }}>Box 1</Box>
679
+ <Box sx={{ p: 2, bgcolor: 'secondary.main' }}>Box 2</Box>
680
+ </Stack>
681
+ </Container>
682
+ ```
683
+
684
+ **Stack Props:**
685
+ - `spacing?: number` - Gap between children
686
+ - `direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'`
687
+ - `divider?: ReactNode` - Divider between items
688
+ - `alignItems?: string` - CSS align-items
689
+ - `justifyContent?: string` - CSS justify-content
690
+
691
+ **Container Props:**
692
+ - `maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false`
693
+ - `disableGutters?: boolean`
694
+ - `fixed?: boolean`
695
+
696
+ ### Paper
697
+ Elevated surface.
698
+
699
+ ```typescript
700
+ import { Paper } from '@cere/cere-design-system';
701
+
702
+ <Paper elevation={3} sx={{ p: 2 }}>
703
+ Content
704
+ </Paper>
705
+ ```
706
+
707
+ **Props:**
708
+ - `elevation?: number` - Shadow depth (0-24)
709
+ - `variant?: 'elevation' | 'outlined'`
710
+ - `square?: boolean` - Sharp corners
711
+
712
+ ### Typography
713
+ Text component with semantic variants.
714
+
715
+ ```typescript
716
+ import { Typography } from '@cere/cere-design-system';
717
+
718
+ <Typography variant="h1" color="primary">
719
+ Heading
720
+ </Typography>
721
+ ```
722
+
723
+ **Props:**
724
+ - `variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'button' | 'overline'`
725
+ - `color?: string` - Text color
726
+ - `align?: 'left' | 'center' | 'right' | 'justify'`
727
+ - `gutterBottom?: boolean` - Bottom margin
728
+ - `noWrap?: boolean` - Prevent wrapping
729
+
730
+ ### Link
731
+ Styled link component.
732
+
733
+ ```typescript
734
+ import { Link } from '@cere/cere-design-system';
735
+
736
+ <Link href="/path" underline="hover">
737
+ Link Text
738
+ </Link>
739
+ ```
740
+
741
+ **Props:**
742
+ - `href?: string` - Link URL
743
+ - `underline?: 'none' | 'hover' | 'always'`
744
+ - `color?: string`
745
+ - `target?: string`
746
+
747
+ ### AppBar & Toolbar
748
+ Application header bar.
749
+
750
+ ```typescript
751
+ import { AppBar, Toolbar, Typography } from '@cere/cere-design-system';
752
+
753
+ <AppBar position="fixed">
754
+ <Toolbar>
755
+ <Typography variant="h6">App Title</Typography>
756
+ </Toolbar>
757
+ </AppBar>
758
+ ```
759
+
760
+ **AppBar Props:**
761
+ - `position?: 'fixed' | 'absolute' | 'sticky' | 'static' | 'relative'`
762
+ - `color?: 'default' | 'primary' | 'secondary' | 'transparent'`
763
+ - `elevation?: number`
764
+
765
+ ### Accordion
766
+ Collapsible content panels.
767
+
768
+ ```typescript
769
+ import { Accordion } from '@cere/cere-design-system';
770
+
771
+ <Accordion expanded={expanded} onChange={() => setExpanded(!expanded)}>
772
+ <AccordionSummary>Header</AccordionSummary>
773
+ <AccordionDetails>Content</AccordionDetails>
774
+ </Accordion>
775
+ ```
776
+
777
+ **Props:**
778
+ - `expanded?: boolean` - Expanded state
779
+ - `onChange?: () => void` - Toggle handler
780
+ - `disabled?: boolean`
781
+ - `defaultExpanded?: boolean`
782
+
783
+ ### Collapse
784
+ Animated expand/collapse wrapper.
785
+
786
+ ```typescript
787
+ import { Collapse } from '@cere/cere-design-system';
788
+
789
+ <Collapse in={show}>
790
+ <div>Collapsible content</div>
791
+ </Collapse>
792
+ ```
793
+
794
+ **Props:**
795
+ - `in: boolean` - Show/hide state
796
+ - `timeout?: number | 'auto'` - Animation duration
797
+ - `unmountOnExit?: boolean`
798
+
799
+ ### Divider
800
+ Visual separator line.
801
+
802
+ ```typescript
803
+ import { Divider } from '@cere/cere-design-system';
804
+
805
+ <Divider />
806
+ <Divider orientation="vertical" />
807
+ ```
808
+
809
+ **Props:**
810
+ - `orientation?: 'horizontal' | 'vertical'`
811
+ - `variant?: 'fullWidth' | 'inset' | 'middle'`
812
+ - `flexItem?: boolean`
813
+
814
+ ### Logo
815
+ Cere Network logo component.
816
+
817
+ ```typescript
818
+ import { Logo } from '@cere/cere-design-system';
819
+
820
+ <Logo size="medium" variant="full" />
821
+ ```
822
+
823
+ **Props:**
824
+ - `size?: 'small' | 'medium' | 'large'` | number
825
+ - `variant?: 'full' | 'icon'`
826
+
827
+ ---
828
+
829
+ ## FEEDBACK
830
+
831
+ ### Alert & Snackbar
832
+ Alert messages and toast notifications.
833
+
834
+ ```typescript
835
+ import { Alert, Snackbar } from '@cere/cere-design-system';
836
+
837
+ <Alert severity="success" title="Success!">
838
+ Operation completed
839
+ </Alert>
840
+
841
+ <Snackbar
842
+ open={open}
843
+ message="Saved successfully"
844
+ severity="success"
845
+ onClose={() => setOpen(false)}
846
+ autoHideDuration={6000}
847
+ />
848
+ ```
849
+
850
+ **Alert Props:**
851
+ - `severity?: 'success' | 'error' | 'warning' | 'info'` (default: 'info')
852
+ - `title?: string` - Alert title
853
+ - `variant?: 'filled' | 'standard' | 'outlined'`
854
+ - `onClose?: () => void` - Close button handler
855
+
856
+ **Snackbar Props:**
857
+ - `open: boolean` - Open state
858
+ - `message?: string` - Message text
859
+ - `severity?: 'success' | 'error' | 'warning' | 'info'` (default: 'info')
860
+ - `title?: string` - Alert title
861
+ - `variant?: 'filled' | 'standard' | 'outlined'` (default: 'filled')
862
+ - `onClose?: () => void` - Close handler
863
+ - `autoHideDuration?: number` (default: 6000ms)
864
+ - `anchorOrigin?: { vertical, horizontal }` - Position
865
+
866
+ ### Badge
867
+ Small badge indicator.
868
+
869
+ ```typescript
870
+ import { Badge } from '@cere/cere-design-system';
871
+
872
+ <Badge badgeContent={4} color="primary">
873
+ <MailIcon />
874
+ </Badge>
875
+ ```
876
+
877
+ **Props:**
878
+ - `badgeContent?: ReactNode` - Badge content
879
+ - `color?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning'`
880
+ - `variant?: 'standard' | 'dot'`
881
+ - `max?: number` - Max number before showing "+"
882
+ - `invisible?: boolean`
883
+
884
+ ### Chip
885
+ Compact element representing an input, attribute, or action.
886
+
887
+ ```typescript
888
+ import { Chip } from '@cere/cere-design-system';
889
+
890
+ <Chip
891
+ label="Tag"
892
+ onDelete={handleDelete}
893
+ color="primary"
894
+ icon={<Icon />}
895
+ />
896
+ ```
897
+
898
+ **Props:**
899
+ - `label: string` - Chip text
900
+ - `variant?: 'filled' | 'outlined'`
901
+ - `color?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning'`
902
+ - `size?: 'small' | 'medium'`
903
+ - `icon?: ReactNode` - Icon before label
904
+ - `avatar?: ReactNode` - Avatar before label
905
+ - `onDelete?: () => void` - Delete handler (shows X button)
906
+ - `onClick?: () => void` - Click handler
907
+ - `disabled?: boolean`
908
+ - `clickable?: boolean`
909
+
910
+ ### Tooltip
911
+ Informative tooltip on hover.
912
+
913
+ ```typescript
914
+ import { Tooltip } from '@cere/cere-design-system';
915
+
916
+ <Tooltip title="Helpful information" placement="top">
917
+ <IconButton><HelpIcon /></IconButton>
918
+ </Tooltip>
919
+ ```
920
+
921
+ **Props:**
922
+ - `title: string | ReactNode` - Tooltip content
923
+ - `placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | etc.`
924
+ - `arrow?: boolean` - Show arrow pointer
925
+ - `open?: boolean` - Controlled open state
926
+ - `onOpen?: () => void`
927
+ - `onClose?: () => void`
928
+
929
+ ### Progress
930
+ Linear progress bar.
931
+
932
+ ```typescript
933
+ import { Progress } from '@cere/cere-design-system';
934
+
935
+ <Progress value={75} variant="determinate" />
936
+ <Progress variant="indeterminate" />
937
+ ```
938
+
939
+ **Props:**
940
+ - `variant?: 'determinate' | 'indeterminate'`
941
+ - `value?: number` - Progress value (0-100) for determinate
942
+ - `color?: 'primary' | 'secondary'`
943
+ - `valueBuffer?: number` - Buffer value for buffer variant
944
+
945
+ ### CircularProgress
946
+ Circular loading spinner.
947
+
948
+ ```typescript
949
+ import { CircularProgress } from '@cere/cere-design-system';
950
+
951
+ <CircularProgress size={40} />
952
+ <CircularProgress variant="determinate" value={75} />
953
+ ```
954
+
955
+ **Props:**
956
+ - `variant?: 'determinate' | 'indeterminate'` (default: 'indeterminate')
957
+ - `value?: number` - Progress value (0-100)
958
+ - `size?: number | string` - Spinner size
959
+ - `thickness?: number` - Stroke thickness
960
+ - `color?: 'primary' | 'secondary' | 'inherit'`
961
+
962
+ ### EmptyState
963
+ Empty state placeholder.
964
+
965
+ ```typescript
966
+ import { EmptyState } from '@cere/cere-design-system';
967
+
968
+ <EmptyState
969
+ title="No data"
970
+ description="There are no items to display"
971
+ icon={<InboxIcon />}
972
+ action={<Button>Add Item</Button>}
973
+ />
974
+ ```
975
+
976
+ **Props:**
977
+ - `title: string` - Empty state title
978
+ - `description?: string` - Description text
979
+ - `icon?: ReactNode` - Icon to display
980
+ - `action?: ReactNode` - Action button/component
981
+
982
+ ### Loading
983
+ Loading state indicator.
984
+
985
+ ```typescript
986
+ import { Loading } from '@cere/cere-design-system';
987
+
988
+ <Loading message="Loading data..." />
989
+ ```
990
+
991
+ **Props:**
992
+ - `message?: string` - Loading message
993
+ - `size?: 'small' | 'medium' | 'large'`
994
+
995
+ ### AppLoading
996
+ Full-screen app loading state.
997
+
998
+ ```typescript
999
+ import { AppLoading } from '@cere/cere-design-system';
1000
+
1001
+ <AppLoading />
1002
+ ```
1003
+
1004
+ **Props:**
1005
+ - Minimal props - displays animated Cere logo
1006
+
1007
+ ---
1008
+
1009
+ ## UTILITIES
1010
+
1011
+ ### Markdown
1012
+ Render markdown content with syntax highlighting.
1013
+
1014
+ ```typescript
1015
+ import { Markdown } from '@cere/cere-design-system';
1016
+
1017
+ <Markdown content={markdownString} />
1018
+ ```
1019
+
1020
+ **Props:**
1021
+ - `content: string` - Markdown content to render
1022
+ - Uses `react-markdown` with `rehype-highlight` for code blocks
1023
+ - Supports GitHub-flavored markdown
1024
+
1025
+ ### Truncate
1026
+ Truncate long text with ellipsis.
1027
+
1028
+ ```typescript
1029
+ import { Truncate } from '@cere/cere-design-system';
1030
+
1031
+ <Truncate lines={2}>
1032
+ Very long text that will be truncated...
1033
+ </Truncate>
1034
+ ```
1035
+
1036
+ **Props:**
1037
+ - `lines?: number` - Number of lines to show (default: 1)
1038
+ - `children: string` - Text to truncate
1039
+
1040
+ ### BytesSize
1041
+ Format bytes to human-readable size.
1042
+
1043
+ ```typescript
1044
+ import { BytesSize } from '@cere/cere-design-system';
1045
+
1046
+ <BytesSize bytes={1024000} />
1047
+ // Displays: "1.02 MB"
1048
+ ```
1049
+
1050
+ **Props:**
1051
+ - `bytes: number` - Bytes to format
1052
+
1053
+ ### QRCode
1054
+ Display QR code.
1055
+
1056
+ ```typescript
1057
+ import { QRCode } from '@cere/cere-design-system';
1058
+
1059
+ <QRCode value="https://example.com" size={256} />
1060
+ ```
1061
+
1062
+ **Props:**
1063
+ - `value: string` - Data to encode
1064
+ - `size?: number` - QR code size in pixels (default: 128)
1065
+ - `level?: 'L' | 'M' | 'Q' | 'H'` - Error correction level
1066
+ - `bgColor?: string` - Background color
1067
+ - `fgColor?: string` - Foreground color
1068
+
1069
+ ### OnboardingProvider
1070
+ Onboarding/tour provider.
1071
+
1072
+ ```typescript
1073
+ import { OnboardingProvider, useOnboarding } from '@cere/cere-design-system';
1074
+
1075
+ <OnboardingProvider>
1076
+ <App />
1077
+ </OnboardingProvider>
1078
+
1079
+ // In component:
1080
+ const { startTour, currentStep } = useOnboarding();
1081
+ ```
1082
+
1083
+ ---
1084
+
1085
+ ## CHARTS
1086
+
1087
+ ### ChartWidget
1088
+ Chart container with title and controls.
1089
+
1090
+ ```typescript
1091
+ import { ChartWidget } from '@cere/cere-design-system';
1092
+
1093
+ <ChartWidget
1094
+ title="Sales Data"
1095
+ description="Monthly sales overview"
1096
+ action={<Button>Export</Button>}
1097
+ >
1098
+ <YourChart />
1099
+ </ChartWidget>
1100
+ ```
1101
+
1102
+ **Props:**
1103
+ - `title?: string` - Widget title
1104
+ - `description?: string` - Widget description
1105
+ - `action?: ReactNode` - Action button/component
1106
+ - `children: ReactNode` - Chart content
1107
+
1108
+ ### MetricsChart
1109
+ Pre-built metrics chart with period selector.
1110
+
1111
+ ```typescript
1112
+ import { MetricsChart, PeriodSelect } from '@cere/cere-design-system';
1113
+ import type { MetricsPeriod } from '@cere/cere-design-system';
1114
+
1115
+ <MetricsChart
1116
+ data={chartData}
1117
+ period="7d"
1118
+ onPeriodChange={(period) => setPeriod(period)}
1119
+ title="Metrics"
1120
+ />
1121
+ ```
1122
+
1123
+ **Props:**
1124
+ - `data: any[]` - Chart data
1125
+ - `period?: MetricsPeriod` - Selected time period
1126
+ - `onPeriodChange?: (period) => void` - Period change handler
1127
+ - `title?: string` - Chart title
1128
+ - Uses MUI X-Charts internally
1129
+
1130
+ **MetricsPeriod:** `'24h' | '7d' | '30d' | '90d' | '1y'`
1131
+
1132
+ ---
1133
+
1134
+ ## THIRD-PARTY COMPONENTS
1135
+
1136
+ ### FlowEditor
1137
+ Visual flow/graph editor (ReactFlow wrapper).
1138
+
1139
+ ```typescript
1140
+ import { FlowEditor } from '@cere/cere-design-system';
1141
+ import type { Node, Edge, NodeTypes, ReactFlowInstance } from '@cere/cere-design-system';
1142
+
1143
+ const nodes: Node[] = [
1144
+ { id: '1', position: { x: 0, y: 0 }, data: { label: 'Node 1' } }
1145
+ ];
1146
+ const edges: Edge[] = [
1147
+ { id: 'e1-2', source: '1', target: '2' }
1148
+ ];
1149
+
1150
+ <FlowEditor
1151
+ nodes={nodes}
1152
+ edges={edges}
1153
+ onNodesChange={handleNodesChange}
1154
+ onEdgesChange={handleEdgesChange}
1155
+ height="600px"
1156
+ showBackground
1157
+ showControls
1158
+ showMinimap
1159
+ nodeTypes={customNodeTypes}
1160
+ />
1161
+ ```
1162
+
1163
+ **Props:**
1164
+ - `nodes: Node[]` - Flow nodes (required)
1165
+ - `edges: Edge[]` - Flow edges (required)
1166
+ - `onNodesChange?: OnNodesChange` - Nodes change handler
1167
+ - `onEdgesChange?: OnEdgesChange` - Edges change handler
1168
+ - `nodeTypes?: NodeTypes` - Custom node components
1169
+ - `edgeTypes?: EdgeTypes` - Custom edge components
1170
+ - `height?: string | number` (default: '600px')
1171
+ - `showBackground?: boolean` (default: true)
1172
+ - `backgroundVariant?: BackgroundVariant` (default: 'dots')
1173
+ - `showControls?: boolean` (default: true)
1174
+ - `showMinimap?: boolean` (default: false)
1175
+ - `containerProps?: BoxProps` - Container styling
1176
+ - `onInit?: (instance: ReactFlowInstance) => void` - Initialization callback
1177
+ - All ReactFlow props supported
1178
+
1179
+ **Re-exported from ReactFlow:**
1180
+ - `Background`, `Controls`, `MiniMap`, `Panel` components
1181
+ - `BackgroundVariant`, `ConnectionLineType` enums
1182
+ - `Node`, `Edge`, `NodeTypes`, `EdgeTypes`, `ReactFlowInstance` types
1183
+ - `OnNodesChange`, `OnEdgesChange` types
1184
+
1185
+ ### CodeEditor
1186
+ Code editor with syntax highlighting (Monaco Editor wrapper).
1187
+
1188
+ ```typescript
1189
+ import { CodeEditor } from '@cere/cere-design-system';
1190
+ import type { CodeEditorLanguage } from '@cere/cere-design-system';
1191
+
1192
+ <CodeEditor
1193
+ value={code}
1194
+ onChange={setCode}
1195
+ language="typescript"
1196
+ height="500px"
1197
+ onValidate={(markers) => console.log('Errors:', markers)}
1198
+ typeDefinitions={`
1199
+ declare interface CustomType {
1200
+ id: string;
1201
+ name: string;
1202
+ }
1203
+ `}
1204
+ />
1205
+ ```
1206
+
1207
+ **Props:**
1208
+ - `value: string` - Editor content (required)
1209
+ - `onChange: (value: string) => void` - Change handler (required)
1210
+ - `language?: CodeEditorLanguage` (default: 'typescript')
1211
+ - Options: `'typescript' | 'javascript' | 'json' | 'html' | 'css' | 'python' | 'yaml' | 'markdown' | 'sql' | 'xml' | 'plaintext'`
1212
+ - `height?: string | number` (default: '400px')
1213
+ - `minHeight?: string | number` - Minimum height
1214
+ - `theme?: string` - Monaco theme ('light' | 'dark' | 'vs-dark' | 'hc-black')
1215
+ - `lineNumbers?: 'on' | 'off' | 'relative' | 'interval'` (default: 'on')
1216
+ - `options?: editor.IStandaloneEditorConstructionOptions` - Monaco editor options
1217
+ - `onMount?: (editor, monaco) => void` - Editor mounted callback
1218
+ - `onValidate?: (markers: editor.IMarker[]) => void` - Validation errors callback
1219
+ - `editorRef?: React.MutableRefObject<editor.IStandaloneCodeEditor | null>` - Editor instance ref
1220
+ - `monacoRef?: React.MutableRefObject<Monaco | null>` - Monaco instance ref
1221
+ - `onFullscreenChange?: (isFullscreen: boolean) => void` - Fullscreen state callback
1222
+ - `containerProps?: BoxProps` - Container styling
1223
+ - `typeDefinitions?: string | string[]` - Additional TypeScript type definitions
1224
+
1225
+ **Features:**
1226
+ - Fullscreen mode support
1227
+ - TypeScript validation and IntelliSense
1228
+ - Custom type definitions injection
1229
+ - Syntax highlighting for multiple languages
1230
+ - Error/warning markers display
1231
+ - Collapsible problems panel
1232
+
1233
+ ---
1234
+
1235
+ ## ICONS
1236
+
1237
+ The design system includes custom Cere-branded icons:
1238
+
1239
+ ```typescript
1240
+ import {
1241
+ CereIcon,
1242
+ ActivityAppIcon,
1243
+ StorageAppIcon,
1244
+ DecentralizedServerIcon,
1245
+ CloudFlashIcon,
1246
+ BarTrackingIcon,
1247
+ GithubLogoIcon,
1248
+ DiscordIcon,
1249
+ ClockIcon,
1250
+ AvatarIcon,
1251
+ ShareIcon,
1252
+ DownloadIcon,
1253
+ UploadFileIcon,
1254
+ UploadFolderIcon,
1255
+ FolderIcon,
1256
+ FilledFolderIcon,
1257
+ ArrowLeft,
1258
+ ArrowRight
1259
+ } from '@cere/cere-design-system';
1260
+
1261
+ <CereIcon />
1262
+ <ActivityAppIcon />
1263
+ ```
1264
+
1265
+ All icons are React components that accept standard SVG props (width, height, color, etc.).
1266
+
1267
+ ---
1268
+
1269
+ ## BEST PRACTICES
1270
+
1271
+ ### Component Usage Guidelines
1272
+
1273
+ 1. **Always wrap with ThemeProvider**: Ensure all components are wrapped with the Cere theme provider for consistent styling.
1274
+
1275
+ 2. **Use TypeScript types**: Import and use the exported TypeScript types for better IDE support and type safety.
1276
+ ```typescript
1277
+ import type { ButtonProps, TextFieldProps } from '@cere/cere-design-system';
1278
+ ```
1279
+
1280
+ 3. **Responsive Design**: Use the responsive hooks (`useIsDesktop`, `useIsTablet`, `useIsMobile`) or Grid component for responsive layouts.
1281
+
1282
+ 4. **Form Validation**: Use TextField's `error` and `helperText` props for inline validation feedback.
1283
+
1284
+ 5. **Loading States**: Use LoadingButton for async actions and Loading/CircularProgress for data fetching.
1285
+
1286
+ 6. **Accessibility**:
1287
+ - Always provide `aria-label` for IconButtons
1288
+ - Use semantic HTML and proper heading hierarchy
1289
+ - Ensure sufficient color contrast
1290
+ - Support keyboard navigation
1291
+
1292
+ 7. **Consistent Spacing**: Use the theme's spacing system (`theme.spacing(n)`) or sx prop for consistent spacing.
1293
+
1294
+ 8. **Icon Usage**: Prefer custom Cere icons when available, otherwise use Material-UI icons.
1295
+
1296
+ 9. **Error Handling**: Use Alert/Snackbar for user-facing error messages.
1297
+
1298
+ 10. **Code Editing**: For any code input, use CodeEditor with appropriate language and type definitions.
1299
+
1300
+ ### Common Patterns
1301
+
1302
+ **Form with Validation:**
1303
+ ```typescript
1304
+ <form onSubmit={handleSubmit}>
1305
+ <Stack spacing={2}>
1306
+ <TextField
1307
+ label="Email"
1308
+ value={email}
1309
+ onChange={(e) => setEmail(e.target.value)}
1310
+ error={!!errors.email}
1311
+ helperText={errors.email}
1312
+ required
1313
+ />
1314
+ <LoadingButton
1315
+ type="submit"
1316
+ variant="primary"
1317
+ loading={isSubmitting}
1318
+ >
1319
+ Submit
1320
+ </LoadingButton>
1321
+ </Stack>
1322
+ </form>
1323
+ ```
1324
+
1325
+ **Data Table with Actions:**
1326
+ ```typescript
1327
+ <Card>
1328
+ <CardHeader title="Users" />
1329
+ <Table
1330
+ columns={columns}
1331
+ data={users}
1332
+ onSort={handleSort}
1333
+ />
1334
+ </Card>
1335
+ ```
1336
+
1337
+ **Dashboard Layout:**
1338
+ ```typescript
1339
+ <Container maxWidth="lg">
1340
+ <Grid container spacing={3}>
1341
+ <Grid item xs={12} md={6}>
1342
+ <ChartWidget title="Metrics">
1343
+ <MetricsChart data={data} />
1344
+ </ChartWidget>
1345
+ </Grid>
1346
+ <Grid item xs={12} md={6}>
1347
+ <Card>
1348
+ <CardContent>...</CardContent>
1349
+ </Card>
1350
+ </Grid>
1351
+ </Grid>
1352
+ </Container>
1353
+ ```