sevatech-library 1.0.18 β 1.0.20
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 +111 -571
- package/dist/components/checkbox/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.constant.d.ts +1 -1
- package/dist/components/checkbox/checkbox.constant.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.component.d.ts +3 -0
- package/dist/components/checkbox-group/checkbox-group.component.d.ts.map +1 -0
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +44 -0
- package/dist/components/checkbox-group/checkbox-group.types.d.ts.map +1 -0
- package/dist/components/checkbox-group/index.d.ts +3 -0
- package/dist/components/checkbox-group/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-avatar/checkbox-item-avatar.component.d.ts +9 -0
- package/dist/components/checkbox-group-item/checkbox-item-avatar/checkbox-item-avatar.component.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-avatar/index.d.ts +2 -0
- package/dist/components/checkbox-group-item/checkbox-item-avatar/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.argtypes.d.ts +222 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.argtypes.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.component.d.ts +4 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.component.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.constant.d.ts +71 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.constant.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.types.d.ts +29 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/checkbox-item-base.types.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/index.d.ts +5 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/use-checkbox-styles.d.ts +11 -0
- package/dist/components/checkbox-group-item/checkbox-item-base/use-checkbox-styles.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-card/checkbox-item-card.component.d.ts +7 -0
- package/dist/components/checkbox-group-item/checkbox-item-card/checkbox-item-card.component.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-card/index.d.ts +2 -0
- package/dist/components/checkbox-group-item/checkbox-item-card/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-icon/checkbox-item-icon.component.d.ts +11 -0
- package/dist/components/checkbox-group-item/checkbox-item-icon/checkbox-item-icon.component.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-icon/index.d.ts +2 -0
- package/dist/components/checkbox-group-item/checkbox-item-icon/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-payment/checkbox-item-payment.component.d.ts +11 -0
- package/dist/components/checkbox-group-item/checkbox-item-payment/checkbox-item-payment.component.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/checkbox-item-payment/index.d.ts +2 -0
- package/dist/components/checkbox-group-item/checkbox-item-payment/index.d.ts.map +1 -0
- package/dist/components/checkbox-group-item/index.d.ts +6 -0
- package/dist/components/checkbox-group-item/index.d.ts.map +1 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +147 -147
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,49 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
# SevaTech Library
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/sevatech-library)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
|
-
[](https://core-sevago.github.io/sevatech-library)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
React component library with TypeScript and Material-UI.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
π **[View Storybook Documentation](https://core-sevago.github.io/sevatech-library)**
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## β¨ Features
|
|
15
|
-
|
|
16
|
-
- **TypeScript First**: Full TypeScript support with comprehensive type definitions.
|
|
17
|
-
- **Material-UI Integration**: Built on Material-UI v5 with enhanced theming capabilities.
|
|
18
|
-
- **Accessible**: WCAG 2.1 compliant components with keyboard navigation and screen reader support.
|
|
19
|
-
- **Responsive**: Mobile-first design with responsive breakpoints.
|
|
20
|
-
- **Customizable**: Extensive theming and styling options via Material-UI `sx` prop.
|
|
21
|
-
- **Tree-Shakable**: Optimized bundle size with ES modules and Rollup.
|
|
22
|
-
- **Well-Documented**: Comprehensive documentation with live examples.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## π Table of Contents
|
|
27
|
-
|
|
28
|
-
- **Installation**
|
|
29
|
-
- **Quick Start**
|
|
30
|
-
- **Components**
|
|
31
|
-
- **Form Components**
|
|
32
|
-
- **Layout Components**
|
|
33
|
-
- **Data Display Components**
|
|
34
|
-
- **Navigation Components**
|
|
35
|
-
- **Utility Components**
|
|
36
|
-
- **Development**
|
|
37
|
-
- **Theming**
|
|
38
|
-
- **API Reference**
|
|
39
|
-
- **Contributing**
|
|
40
|
-
- **License**
|
|
41
|
-
- **Support**
|
|
42
|
-
|
|
43
14
|
## π¦ Installation
|
|
44
15
|
|
|
45
16
|
```bash
|
|
46
|
-
npm
|
|
17
|
+
npm install sevatech-library --force
|
|
47
18
|
```
|
|
48
19
|
|
|
49
20
|
or
|
|
@@ -106,534 +77,100 @@ function App() {
|
|
|
106
77
|
</div>
|
|
107
78
|
);
|
|
108
79
|
}
|
|
109
|
-
|
|
110
|
-
export default App;
|
|
111
80
|
```
|
|
112
81
|
|
|
113
82
|
---
|
|
114
83
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
### Form Components
|
|
84
|
+
### Building Complex Forms
|
|
118
85
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
A versatile button component supporting multiple variants, colors, sizes, and icon integration.
|
|
86
|
+
Create forms with validation, error handling, and various input types:
|
|
122
87
|
|
|
123
88
|
```tsx
|
|
124
|
-
import {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
89
|
+
import {
|
|
90
|
+
TextFieldComponent,
|
|
91
|
+
DateFieldComponent,
|
|
92
|
+
DropdownFieldComponent,
|
|
93
|
+
CheckboxComponent,
|
|
94
|
+
ButtonComponent,
|
|
95
|
+
} from 'sevatech-library';
|
|
96
|
+
|
|
97
|
+
// Form with multiple input types
|
|
98
|
+
<TextFieldComponent label='Name' value={name} onChange={setName} />
|
|
99
|
+
<DateFieldComponent label='Birthday' value={date} onChange={setDate} />
|
|
100
|
+
<DropdownFieldComponent options={options} value={selected} onChange={setSelected} />
|
|
101
|
+
<CheckboxComponent label='Agree to terms' checked={agreed} onChange={setAgreed} />
|
|
102
|
+
<ButtonComponent variant='solid' color='brand' onClick={handleSubmit}>
|
|
103
|
+
Submit
|
|
134
104
|
</ButtonComponent>
|
|
135
105
|
```
|
|
136
106
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- `variant`: `'solid' | 'outline' | 'ghost' | 'text'`
|
|
140
|
-
- `color`: `'brand' | 'neutral' | 'success' | 'error' | 'warning' | 'info'`
|
|
141
|
-
- `size`: `'sm' | 'md' | 'lg'`
|
|
142
|
-
- `prefixIcon`: Icon name for left side.
|
|
143
|
-
- `suffixIcon`: Icon name for right side.
|
|
144
|
-
- `loading`: Boolean for loading state.
|
|
145
|
-
- `disabled`: Boolean to disable interaction.
|
|
146
|
-
|
|
147
|
-
#### Text Field Component
|
|
148
|
-
|
|
149
|
-
Advanced input field with validation states, icons, and accessibility features.
|
|
150
|
-
|
|
151
|
-
```tsx
|
|
152
|
-
import { TextFieldComponent } from 'sevatech-library';
|
|
153
|
-
|
|
154
|
-
const [value, setValue] = useState('');
|
|
155
|
-
|
|
156
|
-
<TextFieldComponent
|
|
157
|
-
label='Email Address'
|
|
158
|
-
placeholder='Enter your email'
|
|
159
|
-
value={value}
|
|
160
|
-
onChange={e => setValue(e.target.value)}
|
|
161
|
-
error={!isValidEmail(value)}
|
|
162
|
-
errorMessage='Please enter a valid email address'
|
|
163
|
-
success={isValidEmail(value) && value.length > 0}
|
|
164
|
-
successMessage='Email address is valid'
|
|
165
|
-
fullWidth
|
|
166
|
-
/>;
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
**Props:**
|
|
170
|
-
|
|
171
|
-
- `label`: Input label text.
|
|
172
|
-
- `placeholder`: Placeholder text.
|
|
173
|
-
- `value`: Controlled value.
|
|
174
|
-
- `onChange`: Change handler.
|
|
175
|
-
- `error`: Boolean for error state.
|
|
176
|
-
- `errorMessage`: Error message text.
|
|
177
|
-
- `success`: Boolean for success state.
|
|
178
|
-
- `successMessage`: Success message text.
|
|
179
|
-
- `disabled`: Boolean to disable input.
|
|
180
|
-
- `fullWidth`: Boolean for full width.
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
#### Text Area Component
|
|
185
|
-
|
|
186
|
-
Multi-line text input with customizable rows and validation.
|
|
187
|
-
|
|
188
|
-
```tsx
|
|
189
|
-
import { TextAreaComponent } from 'sevatech-library';
|
|
190
|
-
|
|
191
|
-
const [description, setDescription] = useState('');
|
|
192
|
-
|
|
193
|
-
<TextAreaComponent
|
|
194
|
-
label='Description'
|
|
195
|
-
placeholder='Enter detailed description...'
|
|
196
|
-
value={description}
|
|
197
|
-
onChange={e => setDescription(e.target.value)}
|
|
198
|
-
rows={4}
|
|
199
|
-
fullWidth
|
|
200
|
-
/>;
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
#### Checkbox Component
|
|
206
|
-
|
|
207
|
-
Custom-styled checkbox with label support.
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
import { CheckboxComponent } from 'sevatech-library';
|
|
211
|
-
|
|
212
|
-
const [agreed, setAgreed] = useState(false);
|
|
213
|
-
|
|
214
|
-
<CheckboxComponent
|
|
215
|
-
label='I agree to the Terms and Conditions'
|
|
216
|
-
checked={agreed}
|
|
217
|
-
onChange={e => setAgreed(e.target.checked)}
|
|
218
|
-
/>;
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
#### Switch Component
|
|
107
|
+
### Creating Beautiful UI Components
|
|
224
108
|
|
|
225
|
-
|
|
109
|
+
Use ready-made components to create professional interfaces:
|
|
226
110
|
|
|
227
111
|
```tsx
|
|
228
|
-
import {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
112
|
+
import {
|
|
113
|
+
AvatarComponent,
|
|
114
|
+
ChipComponent,
|
|
115
|
+
TypographyComponent,
|
|
116
|
+
TooltipComponent,
|
|
117
|
+
} from 'sevatech-library';
|
|
118
|
+
|
|
119
|
+
// Avatar with fallback
|
|
120
|
+
<AvatarComponent name='John Doe' size='lg' color='brand' />
|
|
121
|
+
|
|
122
|
+
// Chips with colors
|
|
123
|
+
<ChipComponent label='New' color='success' />
|
|
124
|
+
<ChipComponent label='Important' color='error' />
|
|
125
|
+
|
|
126
|
+
// Typography with variants
|
|
127
|
+
<TypographyComponent variant='h1'>Main Title</TypographyComponent>
|
|
128
|
+
<TypographyComponent variant='body1'>Body text</TypographyComponent>
|
|
129
|
+
|
|
130
|
+
// Tooltip
|
|
131
|
+
<TooltipComponent title='Delete item'>
|
|
132
|
+
<IconButton><DeleteIcon /></IconButton>
|
|
133
|
+
</TooltipComponent>
|
|
237
134
|
```
|
|
238
135
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
#### Dropdown Field Component
|
|
242
|
-
|
|
243
|
-
Select dropdown with search and multi-select capabilities.
|
|
244
|
-
|
|
245
|
-
```tsx
|
|
246
|
-
import { DropdownFieldComponent } from 'sevatech-library';
|
|
247
|
-
|
|
248
|
-
const options = [
|
|
249
|
-
{ label: 'Option 1', value: '1' },
|
|
250
|
-
{ label: 'Option 2', value: '2' },
|
|
251
|
-
{ label: 'Option 3', value: '3' },
|
|
252
|
-
];
|
|
253
|
-
|
|
254
|
-
<DropdownFieldComponent
|
|
255
|
-
label='Select Option'
|
|
256
|
-
options={options}
|
|
257
|
-
value={selectedValue}
|
|
258
|
-
onChange={setSelectedValue}
|
|
259
|
-
searchable
|
|
260
|
-
/>;
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
#### Search Field Component
|
|
266
|
-
|
|
267
|
-
Debounced search input with clear functionality.
|
|
268
|
-
|
|
269
|
-
```tsx
|
|
270
|
-
import { SearchFieldComponent } from 'sevatech-library';
|
|
271
|
-
|
|
272
|
-
const [searchTerm, setSearchTerm] = useState('');
|
|
273
|
-
|
|
274
|
-
<SearchFieldComponent
|
|
275
|
-
placeholder='Search...'
|
|
276
|
-
value={searchTerm}
|
|
277
|
-
onChange={e => setSearchTerm(e.target.value)}
|
|
278
|
-
onSearch={term => performSearch(term)}
|
|
279
|
-
debounceMs={300}
|
|
280
|
-
/>;
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
#### Date Field Component
|
|
286
|
-
|
|
287
|
-
Date picker with customizable format and locale support.
|
|
288
|
-
|
|
289
|
-
```tsx
|
|
290
|
-
import { DateFieldComponent } from 'sevatech-library';
|
|
291
|
-
import dayjs from 'dayjs';
|
|
292
|
-
|
|
293
|
-
const [selectedDate, setSelectedDate] = useState(dayjs());
|
|
294
|
-
|
|
295
|
-
<DateFieldComponent
|
|
296
|
-
label='Select Date'
|
|
297
|
-
value={selectedDate}
|
|
298
|
-
onChange={date => setSelectedDate(date)}
|
|
299
|
-
format='DD/MM/YYYY'
|
|
300
|
-
/>;
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
#### Money Field Component
|
|
306
|
-
|
|
307
|
-
Currency input with automatic formatting.
|
|
308
|
-
|
|
309
|
-
```tsx
|
|
310
|
-
import { MoneyFieldComponent } from 'sevatech-library';
|
|
311
|
-
|
|
312
|
-
const [price, setPrice] = useState('');
|
|
313
|
-
|
|
314
|
-
<MoneyFieldComponent label='Price' value={price} onChange={setPrice} currency='USD' locale='en-US' />;
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
### Layout Components
|
|
320
|
-
|
|
321
|
-
#### Modal Component
|
|
322
|
-
|
|
323
|
-
Flexible modal dialog with customizable actions and content.
|
|
324
|
-
|
|
325
|
-
```tsx
|
|
326
|
-
import { ModalComponent } from 'sevatech-library';
|
|
327
|
-
|
|
328
|
-
<ModalComponent
|
|
329
|
-
open={isOpen}
|
|
330
|
-
onClose={() => setIsOpen(false)}
|
|
331
|
-
title='Confirm Action'
|
|
332
|
-
buttonLeft={{ children: 'Cancel' }}
|
|
333
|
-
buttonRight={{
|
|
334
|
-
children: 'Confirm',
|
|
335
|
-
color: 'brand',
|
|
336
|
-
onClick: handleConfirm,
|
|
337
|
-
}}
|
|
338
|
-
>
|
|
339
|
-
<p>Are you sure you want to proceed with this action?</p>
|
|
340
|
-
</ModalComponent>;
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
#### Tabs Component
|
|
346
|
-
|
|
347
|
-
Animated tabbed interface with icon support.
|
|
348
|
-
|
|
349
|
-
```tsx
|
|
350
|
-
import { TabsComponent } from 'sevatech-library';
|
|
351
|
-
|
|
352
|
-
const tabs = [
|
|
353
|
-
{ id: 'tab1', name: 'Home', icon: 'home' },
|
|
354
|
-
{ id: 'tab2', name: 'Settings', icon: 'settings' },
|
|
355
|
-
{ id: 'tab3', name: 'Info', icon: 'info' },
|
|
356
|
-
];
|
|
357
|
-
|
|
358
|
-
<TabsComponent tabs={tabs} idSelect={activeTab} onChange={setActiveTab} />;
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
#### Grid Component
|
|
364
|
-
|
|
365
|
-
Responsive grid system based on Material-UI's Grid.
|
|
366
|
-
|
|
367
|
-
```tsx
|
|
368
|
-
import { Grid } from 'sevatech-library';
|
|
369
|
-
|
|
370
|
-
<Grid container spacing={2}>
|
|
371
|
-
<Grid item xs={12} sm={6} md={4}>
|
|
372
|
-
<div>Column 1</div>
|
|
373
|
-
</Grid>
|
|
374
|
-
<Grid item xs={12} sm={6} md={4}>
|
|
375
|
-
<div>Column 2</div>
|
|
376
|
-
</Grid>
|
|
377
|
-
<Grid item xs={12} sm={6} md={4}>
|
|
378
|
-
<div>Column 3</div>
|
|
379
|
-
</Grid>
|
|
380
|
-
</Grid>;
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
---
|
|
384
|
-
|
|
385
|
-
### Data Display Components
|
|
386
|
-
|
|
387
|
-
#### Avatar Component
|
|
388
|
-
|
|
389
|
-
User avatar with image and fallback support.
|
|
390
|
-
|
|
391
|
-
```tsx
|
|
392
|
-
import { AvatarComponent } from 'sevatech-library';
|
|
393
|
-
|
|
394
|
-
<AvatarComponent
|
|
395
|
-
url="https://example.com/avatar.jpg"
|
|
396
|
-
size="md"
|
|
397
|
-
border
|
|
398
|
-
/>
|
|
399
|
-
|
|
400
|
-
<AvatarComponent
|
|
401
|
-
name="John Doe"
|
|
402
|
-
size="lg"
|
|
403
|
-
color="brand"
|
|
404
|
-
/>
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
---
|
|
408
|
-
|
|
409
|
-
#### Avatar Group Component
|
|
410
|
-
|
|
411
|
-
Grouped avatars with overflow indicators.
|
|
412
|
-
|
|
413
|
-
```tsx
|
|
414
|
-
import { AvatarGroupComponent } from 'sevatech-library';
|
|
415
|
-
|
|
416
|
-
const avatars = [
|
|
417
|
-
{ id: '1', url: 'avatar1.jpg', name: 'User 1' },
|
|
418
|
-
{ id: '2', url: 'avatar2.jpg', name: 'User 2' },
|
|
419
|
-
{ id: '3', url: 'avatar3.jpg', name: 'User 3' },
|
|
420
|
-
];
|
|
421
|
-
|
|
422
|
-
<AvatarGroupComponent avatars={avatars} maxDisplay={3} />;
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
---
|
|
426
|
-
|
|
427
|
-
#### Chip Component
|
|
136
|
+
### Media Integration
|
|
428
137
|
|
|
429
|
-
|
|
138
|
+
Embed videos and handle file uploads:
|
|
430
139
|
|
|
431
140
|
```tsx
|
|
432
|
-
import {
|
|
141
|
+
import { VideoPlayerComponent, UploaderComponent } from 'sevatech-library';
|
|
433
142
|
|
|
434
|
-
|
|
435
|
-
<
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
143
|
+
// Video player with YouTube support
|
|
144
|
+
<VideoPlayerComponent
|
|
145
|
+
src='https://www.youtube.com/watch?v=VIDEO_ID'
|
|
146
|
+
width={600}
|
|
147
|
+
height={400}
|
|
439
148
|
/>
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
---
|
|
443
|
-
|
|
444
|
-
#### Typography Component
|
|
445
|
-
|
|
446
|
-
Text styling with semantic variants.
|
|
447
|
-
|
|
448
|
-
```tsx
|
|
449
|
-
import { TypographyComponent } from 'sevatech-library';
|
|
450
|
-
|
|
451
|
-
<TypographyComponent variant="h1">Main Heading</TypographyComponent>
|
|
452
|
-
<TypographyComponent variant="body1">
|
|
453
|
-
Regular body text with <strong>bold</strong> and <em>italic</em> formatting.
|
|
454
|
-
</TypographyComponent>
|
|
455
|
-
<TypographyComponent variant="caption" color="text.secondary">
|
|
456
|
-
Caption text
|
|
457
|
-
</TypographyComponent>
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
---
|
|
461
|
-
|
|
462
|
-
### Navigation Components
|
|
463
|
-
|
|
464
|
-
#### Breadcrumbs Component
|
|
465
|
-
|
|
466
|
-
Breadcrumb navigation with customizable separators.
|
|
467
|
-
|
|
468
|
-
```tsx
|
|
469
|
-
import { BreadCumbsComponent } from 'sevatech-library';
|
|
470
|
-
|
|
471
|
-
const breadcrumbs = [
|
|
472
|
-
{ label: 'Home', href: '/' },
|
|
473
|
-
{ label: 'Products', href: '/products' },
|
|
474
|
-
{ label: 'Category', href: '/products/category' },
|
|
475
|
-
];
|
|
476
|
-
|
|
477
|
-
<BreadCumbsComponent items={breadcrumbs} />;
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
---
|
|
481
|
-
|
|
482
|
-
#### Link Element
|
|
483
|
-
|
|
484
|
-
Styled navigation link with external link support.
|
|
485
|
-
|
|
486
|
-
```tsx
|
|
487
|
-
import { LinkElement } from 'sevatech-library';
|
|
488
|
-
|
|
489
|
-
<LinkElement href="/dashboard">Go to Dashboard</LinkElement>
|
|
490
|
-
<LinkElement href="https://example.com" external>
|
|
491
|
-
External Link
|
|
492
|
-
</LinkElement>
|
|
493
|
-
```
|
|
494
|
-
|
|
495
|
-
---
|
|
496
|
-
|
|
497
|
-
### Utility Components
|
|
498
|
-
|
|
499
|
-
#### Icon Element
|
|
500
|
-
|
|
501
|
-
Material Icons integration with size and color options.
|
|
502
|
-
|
|
503
|
-
```tsx
|
|
504
|
-
import { IconElement } from 'sevatech-library';
|
|
505
|
-
|
|
506
|
-
<IconElement icon="home" />
|
|
507
|
-
<IconElement icon="search" size="large" />
|
|
508
|
-
<IconElement icon="favorite" sx={{ color: 'red' }} />
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
---
|
|
512
|
-
|
|
513
|
-
#### Image Element
|
|
514
|
-
|
|
515
|
-
Optimized image component with lazy loading and fallbacks.
|
|
516
|
-
|
|
517
|
-
```tsx
|
|
518
|
-
import { ImageElement } from 'sevatech-library';
|
|
519
|
-
|
|
520
|
-
<ImageElement
|
|
521
|
-
url='https://example.com/image.jpg'
|
|
522
|
-
alt='Example image'
|
|
523
|
-
sx={{ borderRadius: 2, width: 200, height: 150 }}
|
|
524
|
-
/>;
|
|
525
|
-
```
|
|
526
|
-
|
|
527
|
-
---
|
|
528
|
-
|
|
529
|
-
#### Uploader Component
|
|
530
|
-
|
|
531
|
-
File upload with drag-and-drop and progress tracking.
|
|
532
|
-
|
|
533
|
-
```tsx
|
|
534
|
-
import { UploaderComponent } from 'sevatech-library';
|
|
535
149
|
|
|
150
|
+
// File upload with drag & drop
|
|
536
151
|
<UploaderComponent
|
|
537
|
-
onFilesSelected={files =>
|
|
538
|
-
console.log('Selected files:', files);
|
|
539
|
-
}}
|
|
152
|
+
onFilesSelected={files => console.log('Files:', files)}
|
|
540
153
|
accept='.jpg,.png,.pdf'
|
|
541
|
-
maxSize={5 * 1024 * 1024}
|
|
542
|
-
|
|
543
|
-
```
|
|
544
|
-
|
|
545
|
-
---
|
|
546
|
-
|
|
547
|
-
## π οΈ Development
|
|
548
|
-
|
|
549
|
-
### Prerequisites
|
|
550
|
-
|
|
551
|
-
- Node.js 18.0.0 or higher
|
|
552
|
-
- npm 8.0.0 or higher (or yarn 1.22.0+)
|
|
553
|
-
|
|
554
|
-
### Setup
|
|
555
|
-
|
|
556
|
-
1. Clone the repository:
|
|
557
|
-
|
|
558
|
-
```bash
|
|
559
|
-
git clone https://github.com/golden-lotus-core-web/sevatech-library.git
|
|
560
|
-
cd sevatech-library
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
2. Install dependencies:
|
|
564
|
-
|
|
565
|
-
```bash
|
|
566
|
-
npm install
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
### Available Scripts
|
|
570
|
-
|
|
571
|
-
```bash
|
|
572
|
-
# Start development server (Vite with fast HMR)
|
|
573
|
-
npm run dev
|
|
574
|
-
|
|
575
|
-
# Build for production (Vite)
|
|
576
|
-
npm run build
|
|
577
|
-
|
|
578
|
-
# Build with Rollup (legacy)
|
|
579
|
-
npm run build:rollup
|
|
580
|
-
|
|
581
|
-
# Run Storybook
|
|
582
|
-
npm run storybook
|
|
583
|
-
|
|
584
|
-
# Build Storybook
|
|
585
|
-
npm run build-storybook
|
|
586
|
-
|
|
587
|
-
# Run linting
|
|
588
|
-
npm run lint
|
|
589
|
-
|
|
590
|
-
# Format code
|
|
591
|
-
npm run format
|
|
592
|
-
npm run types
|
|
154
|
+
maxSize={5 * 1024 * 1024}
|
|
155
|
+
/>
|
|
593
156
|
```
|
|
594
157
|
|
|
595
|
-
###
|
|
596
|
-
|
|
597
|
-
1. **TypeScript**: All components must be written in TypeScript with proper type definitions.
|
|
598
|
-
2. **Accessibility**: Follow WCAG 2.1 guidelines and use semantic HTML.
|
|
599
|
-
3. **Responsive Design**: Ensure components work across all device sizes.
|
|
600
|
-
4. **Material-UI Integration**: Leverage Material-UI's theming and styling system.
|
|
601
|
-
5. **Performance**: Optimize for bundle size and runtime performance.
|
|
602
|
-
6. **Testing**: Include unit tests for all components.
|
|
603
|
-
7. **Documentation**: Maintain up-to-date documentation and examples.
|
|
604
|
-
|
|
605
|
-
---
|
|
606
|
-
|
|
607
|
-
## π¨ Theming
|
|
608
|
-
|
|
609
|
-
SevaTech Library uses Material-UI's powerful theming system. Customize the theme to match your brand:
|
|
158
|
+
### Customizing Theme
|
|
610
159
|
|
|
611
160
|
```tsx
|
|
612
|
-
import React from 'react';
|
|
613
161
|
import { ThemeProvider, createTheme } from '@mui/material';
|
|
614
162
|
import { ButtonComponent } from 'sevatech-library';
|
|
615
163
|
|
|
616
164
|
const theme = createTheme({
|
|
617
165
|
palette: {
|
|
618
|
-
primary: {
|
|
619
|
-
main: '#1976d2',
|
|
620
|
-
},
|
|
621
|
-
secondary: {
|
|
622
|
-
main: '#dc004e',
|
|
623
|
-
},
|
|
624
166
|
brand: {
|
|
625
167
|
main: '#your-brand-color',
|
|
168
|
+
light: '#lighter-shade',
|
|
169
|
+
dark: '#darker-shade',
|
|
626
170
|
},
|
|
627
171
|
},
|
|
628
172
|
typography: {
|
|
629
|
-
fontFamily: '"Inter", "Roboto",
|
|
630
|
-
h1: {
|
|
631
|
-
fontSize: '2.5rem',
|
|
632
|
-
fontWeight: 700,
|
|
633
|
-
},
|
|
634
|
-
},
|
|
635
|
-
shape: {
|
|
636
|
-
borderRadius: 8,
|
|
173
|
+
fontFamily: '"Inter", "Roboto", sans-serif',
|
|
637
174
|
},
|
|
638
175
|
});
|
|
639
176
|
|
|
@@ -648,77 +185,80 @@ function App() {
|
|
|
648
185
|
}
|
|
649
186
|
```
|
|
650
187
|
|
|
651
|
-
|
|
188
|
+
---
|
|
652
189
|
|
|
653
|
-
|
|
190
|
+
## π Components
|
|
654
191
|
|
|
655
|
-
|
|
656
|
-
const theme = createTheme({
|
|
657
|
-
palette: {
|
|
658
|
-
brand: {
|
|
659
|
-
main: '#your-brand-color',
|
|
660
|
-
light: '#lighter-shade',
|
|
661
|
-
dark: '#darker-shade',
|
|
662
|
-
contrastText: '#ffffff',
|
|
663
|
-
},
|
|
664
|
-
},
|
|
665
|
-
});
|
|
666
|
-
```
|
|
192
|
+
The library includes 30+ components organized into groups:
|
|
667
193
|
|
|
668
|
-
|
|
194
|
+
- **Form Components**: Button, TextField, TextArea, Checkbox, Switch, Dropdown, Search, Date, Money, Rating, Slider, Picker, CheckboxGroup
|
|
195
|
+
- **Layout Components**: Modal, Tabs, Grid
|
|
196
|
+
- **Data Display**: Avatar, AvatarGroup, Chip, Typography, Tooltip
|
|
197
|
+
- **Navigation**: Breadcrumbs, Link
|
|
198
|
+
- **Utility**: Icon, Image, Uploader
|
|
199
|
+
- **Media**: VideoPlayer
|
|
669
200
|
|
|
670
|
-
|
|
201
|
+
View all components and examples at [Storybook](https://core-sevago.github.io/sevatech-library).
|
|
671
202
|
|
|
672
|
-
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## π οΈ Development
|
|
673
206
|
|
|
674
|
-
|
|
207
|
+
### Setup
|
|
675
208
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
| `disabled` | `boolean` | Disable component interaction |
|
|
682
|
-
| `loading` | `boolean` | Show loading state |
|
|
209
|
+
```bash
|
|
210
|
+
git clone https://github.com/golden-lotus-core-web/sevatech-library.git
|
|
211
|
+
cd sevatech-library
|
|
212
|
+
npm install
|
|
213
|
+
```
|
|
683
214
|
|
|
684
|
-
###
|
|
215
|
+
### Scripts
|
|
685
216
|
|
|
686
|
-
|
|
217
|
+
```bash
|
|
218
|
+
npm run dev # Development server
|
|
219
|
+
npm run build # Build for production
|
|
220
|
+
npm run storybook # Run Storybook
|
|
221
|
+
npm run lint # Lint code
|
|
222
|
+
npm run format # Format code
|
|
223
|
+
```
|
|
687
224
|
|
|
688
225
|
---
|
|
689
226
|
|
|
690
|
-
##
|
|
227
|
+
## π API Reference
|
|
228
|
+
|
|
229
|
+
All components support these common props:
|
|
230
|
+
|
|
231
|
+
- `sx`: Material-UI sx prop for custom styling
|
|
232
|
+
- `className`: CSS class name
|
|
233
|
+
- `style`: Inline styles
|
|
234
|
+
- `disabled`: Disable component
|
|
235
|
+
- `loading`: Show loading state
|
|
691
236
|
|
|
692
|
-
|
|
237
|
+
For detailed props of each component, see [Storybook](https://core-sevago.github.io/sevatech-library).
|
|
693
238
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
4. Ensure all tests pass: `npm run test`
|
|
698
|
-
5. Commit your changes: `git commit -m 'Add amazing feature'`
|
|
699
|
-
6. Push to the branch: `git push origin feature/amazing-feature`
|
|
700
|
-
7. Open a Pull Request
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## π€ Contributing
|
|
701
242
|
|
|
702
|
-
|
|
243
|
+
We welcome contributions! Please:
|
|
703
244
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
245
|
+
1. Fork repository
|
|
246
|
+
2. TαΊ‘o feature branch (`git checkout -b feature/amazing-feature`)
|
|
247
|
+
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
|
248
|
+
4. Push to branch (`git push origin feature/amazing-feature`)
|
|
249
|
+
5. Mα» Pull Request
|
|
709
250
|
|
|
710
251
|
---
|
|
711
252
|
|
|
712
253
|
## π License
|
|
713
254
|
|
|
714
|
-
|
|
255
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
715
256
|
|
|
716
257
|
## π Support
|
|
717
258
|
|
|
718
|
-
- **
|
|
259
|
+
- **Documentation**: [Storybook](https://core-sevago.github.io/sevatech-library)
|
|
719
260
|
- **Issues**: [GitHub Issues](https://github.com/golden-lotus-core-web/sevatech-library/issues)
|
|
720
|
-
- **Documentation**: [Full Documentation](https://github.com/golden-lotus-core-web/sevatech-library)
|
|
721
261
|
|
|
722
262
|
---
|
|
723
263
|
|
|
724
|
-
Built with β€οΈ by
|
|
264
|
+
Built with β€οΈ by **SevaTech** team
|