@cere/cere-design-system 0.0.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/README.md ADDED
@@ -0,0 +1,264 @@
1
+ # Cere Design System
2
+
3
+ Cere Network Design System built with Material UI and React.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @cere-network/cere-design-system
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Basic Setup
14
+
15
+ Wrap your application with the ThemeProvider:
16
+
17
+ ```tsx
18
+ import { ThemeProvider } from '@mui/material';
19
+ import CssBaseline from '@mui/material/CssBaseline';
20
+ import { theme } from '@cere-network/cere-design-system';
21
+ import { Button, TextField } from '@cere-network/cere-design-system';
22
+
23
+ function App() {
24
+ return (
25
+ <ThemeProvider theme={theme}>
26
+ <CssBaseline />
27
+ <Button variant="primary">Click me</Button>
28
+ <TextField label="Enter text" />
29
+ </ThemeProvider>
30
+ );
31
+ }
32
+ ```
33
+
34
+ ### Using Components
35
+
36
+ ```tsx
37
+ import {
38
+ // Buttons
39
+ Button,
40
+ IconButton,
41
+ // Inputs
42
+ TextField,
43
+ SearchField,
44
+ Dropdown,
45
+ Switch,
46
+ Checkbox,
47
+ Radio,
48
+ ToggleButton,
49
+ ToggleButtonGroup,
50
+ // Navigation
51
+ Sidebar,
52
+ SidebarItem,
53
+ Tab,
54
+ Menu,
55
+ MenuItem,
56
+ Pagination,
57
+ Selector,
58
+ // Layout
59
+ Dialog,
60
+ Card,
61
+ CardContent,
62
+ List,
63
+ ListItem,
64
+ Avatar,
65
+ Table,
66
+ TableHeader,
67
+ AppBar,
68
+ Toolbar,
69
+ Breadcrumbs,
70
+ Accordion,
71
+ Paper,
72
+ Divider,
73
+ Stack,
74
+ Box,
75
+ Typography,
76
+ Link,
77
+ Container,
78
+ // Feedback
79
+ Badge,
80
+ Chip,
81
+ Tooltip,
82
+ Progress,
83
+ Alert,
84
+ Snackbar,
85
+ EmptyState,
86
+ Loading
87
+ } from '@cere-network/cere-design-system';
88
+
89
+ // Buttons
90
+ <Button variant="primary">Save</Button>
91
+ <IconButton variant="primary"><SettingsIcon /></IconButton>
92
+
93
+ // Inputs
94
+ <TextField label="Name" />
95
+ <SearchField placeholder="Search..." onSearch={(v) => console.log(v)} />
96
+ <Dropdown label="Select" options={[{ value: '1', label: 'Option 1' }]} />
97
+
98
+ // Navigation
99
+ <Sidebar items={[
100
+ { label: 'Dashboard', icon: <DashboardIcon />, selected: true }
101
+ ]} />
102
+ <Selector
103
+ options={[{ id: '1', name: 'Service 1' }]}
104
+ selectedId="1"
105
+ onSelect={(id) => console.log(id)}
106
+ />
107
+
108
+ // Layout
109
+ <Dialog open={true} title="Dialog" onClose={() => {}}>
110
+ Content
111
+ </Dialog>
112
+ <Card hoverable clickable>
113
+ <CardContent>Card content</CardContent>
114
+ </Card>
115
+ <AppBar>
116
+ <Toolbar>Navigation</Toolbar>
117
+ </AppBar>
118
+
119
+ // Feedback
120
+ <Badge variant="primary" badgeContent={5}>Notifications</Badge>
121
+ <Alert severity="success">Success message</Alert>
122
+ <EmptyState title="No items" description="Create your first item" />
123
+ ```
124
+
125
+ ## Development
126
+
127
+ ```bash
128
+ # Install dependencies
129
+ npm install
130
+
131
+ # Run Storybook
132
+ npm run storybook
133
+
134
+ # Build package
135
+ npm run build
136
+
137
+ # Type checking
138
+ npm run type-check
139
+
140
+ # Linting
141
+ npm run lint
142
+ ```
143
+
144
+ ## Components
145
+
146
+ ### Buttons (2)
147
+ - **Button** - Primary, Secondary, Tertiary variants
148
+ - Sizes: small, medium, large
149
+ - Support for icons (start/end)
150
+ - **IconButton** - Icon-only button with variants (default, primary, secondary)
151
+
152
+ ### Inputs (9)
153
+ - **TextField** - Text input with validation states
154
+ - **SearchField** - Search input with search icon
155
+ - **Dropdown** - Select dropdown with options
156
+ - **Switch** - Toggle switch with label positioning
157
+ - **Checkbox** - Checkbox with label positioning and indeterminate state
158
+ - **Radio** - Radio button with RadioGroup support
159
+ - **ToggleButton/ToggleButtonGroup** - Toggle buttons for view modes
160
+ - **FormControl/FormLabel/FormHelperText** - Form field wrappers
161
+
162
+ ### Navigation (6)
163
+ - **Sidebar/SidebarItem** - Navigation sidebar with items (different sizes)
164
+ - **Tab** - Tab component with badge support
165
+ - **Menu/MenuItem** - Dropdown menu with icons and dividers
166
+ - **Pagination** - Pagination controls
167
+ - **Selector** - Universal selector with search, compact mode, and custom rendering
168
+
169
+ ### Layout (16)
170
+ - **Dialog** - Modal dialog with actions and loading states
171
+ - **Card/CardContent/CardHeader/CardActions** - Card container (hoverable, clickable)
172
+ - **List/ListItem** - List with icons and actions
173
+ - **Avatar** - Avatar with sizes (small, medium, large, custom)
174
+ - **Table/TableHeader** - Table with sorting support
175
+ - **Grid** - Grid layout system
176
+ - **AppBar/Toolbar** - Top navigation bar
177
+ - **Breadcrumbs** - Navigation breadcrumbs
178
+ - **Accordion** - Expandable sections
179
+ - **Paper** - Container with elevation or outline
180
+ - **Divider** - Section divider
181
+ - **Stack** - Flexbox layout component
182
+ - **Box** - Universal container component
183
+ - **Typography** - Text component
184
+ - **Link** - Styled link component
185
+ - **Container** - Centered container
186
+
187
+ ### Feedback (8)
188
+ - **Badge** - Badge indicators (default, primary, success, error)
189
+ - **Chip** - Chip component (default, active) with icons
190
+ - **Tooltip** - Tooltip component
191
+ - **Progress** - Linear and circular progress indicators
192
+ - **Alert/Snackbar** - Alert messages and notifications
193
+ - **EmptyState** - Empty state with icon and action
194
+ - **Loading** - Loading spinner (fullScreen or inline)
195
+
196
+ ## Color Scheme
197
+
198
+ - **Primary**: Purple (#7B2CBF)
199
+ - **Success**: Green (#10B981)
200
+ - **Error**: Red (#EF4444)
201
+ - **Warning**: Orange/Yellow (#F59E0B)
202
+ - **Tertiary**: Orange/Yellow (#F59E0B)
203
+
204
+ ## Documentation
205
+
206
+ - [Full Components Reference](./COMPONENTS.md) - Complete API documentation
207
+ - [Integration Guide](./INTEGRATION.md) - Step-by-step integration instructions
208
+
209
+ ## Integration with Existing Projects
210
+
211
+ To use this package in `dynamic-indexer-client` or other projects:
212
+
213
+ 1. Build the package:
214
+ ```bash
215
+ cd cere-design-system
216
+ npm run build
217
+ ```
218
+
219
+ 2. Install locally (or publish to npm):
220
+ ```bash
221
+ # From the project root
222
+ npm install ../cere-design-system
223
+ ```
224
+
225
+ 3. Use in your app:
226
+ ```tsx
227
+ import { theme } from '@cere-network/cere-design-system';
228
+ import { Button, Dialog, Sidebar } from '@cere-network/cere-design-system';
229
+ ```
230
+
231
+ See [INTEGRATION.md](./INTEGRATION.md) for detailed migration guide.
232
+
233
+ ## Testing
234
+
235
+ This design system includes comprehensive testing:
236
+
237
+ - **Jest + React Testing Library**: Unit tests for component logic
238
+ - **Storybook Interaction Tests**: Browser-based interaction tests
239
+ - **Accessibility Tests**: Automated a11y checks with Storybook Test Runner
240
+
241
+ ```bash
242
+ # Run Jest unit tests
243
+ npm test
244
+
245
+ # Run tests in watch mode
246
+ npm run test:watch
247
+
248
+ # Generate coverage report
249
+ npm run test:coverage
250
+
251
+ # Run Storybook interaction tests
252
+ npm run test:storybook
253
+ ```
254
+
255
+ See [TESTING.md](./TESTING.md) for detailed testing guide.
256
+
257
+ ## Component Count
258
+
259
+ - **40+** components
260
+ - **30** Storybook stories
261
+ - **Full TypeScript** support
262
+ - **Material UI** based
263
+ - **Comprehensive testing** with Jest and Storybook
264
+