@aslam-dev/my-lib 1.0.0 β 1.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 +141 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# π¦ @aslam-dev/my-lib
|
|
2
|
+
|
|
3
|
+
Reusable **utility functions and React components** designed to accelerate frontend development with consistent formatting, validation, and UI helpers.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## π Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @aslam-dev/my-lib
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- π§° Utility Functions
|
|
16
|
+
|
|
17
|
+
- π
Date & time helpers
|
|
18
|
+
- π Phone number formatting and validation
|
|
19
|
+
- π Data transformation helpers
|
|
20
|
+
|
|
21
|
+
- π¨ React Components
|
|
22
|
+
- πΌοΈ Image components with lazy loading and placeholders
|
|
23
|
+
- π Chart components for data visualization
|
|
24
|
+
- π§© Form components with built-in validation
|
|
25
|
+
|
|
26
|
+
## π Usage
|
|
27
|
+
|
|
28
|
+
### π
Date Utilities
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import { getCurrentDate } from "@aslam-dev/my-lib";
|
|
32
|
+
|
|
33
|
+
const date = getCurrentDate();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### π Phone Utilities
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import { formatPhoneNumber, validatePhoneNumber } from "@aslam-dev/my-lib";
|
|
40
|
+
|
|
41
|
+
formatPhoneNumber("9876543210", "IN");
|
|
42
|
+
validatePhoneNumber("9876543210", "IN");
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### π Transformers
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
import { groupByProperty } from "@aslam-dev/my-lib";
|
|
49
|
+
|
|
50
|
+
const grouped = groupByProperty(products, "category");
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### π Note Component
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import { Note } from "@aslam-dev/my-lib";
|
|
57
|
+
|
|
58
|
+
<Note title="Important" content="This is a reusable note component." />;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### π BigNote Component
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
import { BigNote } from "@aslam-dev/my-lib";
|
|
65
|
+
|
|
66
|
+
<BigNote title="Large Content Viewer" />;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### π§± Library Structure
|
|
70
|
+
|
|
71
|
+
src/
|
|
72
|
+
βββ components/
|
|
73
|
+
β βββ Note
|
|
74
|
+
β βββ BigNote
|
|
75
|
+
βββ datetime
|
|
76
|
+
βββ phone
|
|
77
|
+
βββ transformers
|
|
78
|
+
βββ index.ts
|
|
79
|
+
|
|
80
|
+
## π― Design Goals
|
|
81
|
+
|
|
82
|
+
## Reusability
|
|
83
|
+
|
|
84
|
+
Encapsulates commonly used UI and utility logic.
|
|
85
|
+
|
|
86
|
+
## Performance
|
|
87
|
+
|
|
88
|
+
BigNote uses lazy chunk loading to avoid heavy DOM rendering.
|
|
89
|
+
|
|
90
|
+
## Type Safety
|
|
91
|
+
|
|
92
|
+
Fully written in TypeScript with exported type definitions.
|
|
93
|
+
|
|
94
|
+
## Lightweight
|
|
95
|
+
|
|
96
|
+
Minimal dependencies and optimized bundle output.
|
|
97
|
+
|
|
98
|
+
## π οΈ Development
|
|
99
|
+
|
|
100
|
+
### Build Library
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm run build
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Local Testing
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm pack
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Then install the generated tarball inside another project.
|
|
113
|
+
|
|
114
|
+
### π¦ Package Exports
|
|
115
|
+
|
|
116
|
+
Consumers should import from the root:
|
|
117
|
+
|
|
118
|
+
```javascript
|
|
119
|
+
import { Note, getCurrentDate } from "@aslam-dev/my-lib";
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### π§ Peer Dependencies
|
|
123
|
+
|
|
124
|
+
This library expects:
|
|
125
|
+
|
|
126
|
+
```javascript
|
|
127
|
+
react >= 18;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## πΊοΈ Roadmap
|
|
131
|
+
|
|
132
|
+
- Add more UI primitives
|
|
133
|
+
- Expand transformer utilities
|
|
134
|
+
- Add unit tests
|
|
135
|
+
- Add Storybook documentation
|
|
136
|
+
- Improve accessibility support
|
|
137
|
+
|
|
138
|
+
## π¨βπ» Author
|
|
139
|
+
|
|
140
|
+
Aslam Mohammed
|
|
141
|
+
[](https://www.linkedin.com/in/malaslam97/)
|