shekel-fe-shared-lib 1.0.15 → 1.0.16
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 +54 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ A modern React component library built with **React**, **TypeScript**, **Tailwin
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install shekel-fe-shared-lib
|
|
21
|
+
# or
|
|
22
|
+
yarn add shekel-fe-shared-lib
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
## Peer Dependencies
|
|
@@ -25,12 +27,16 @@ npm install shekel-fe-shared-lib
|
|
|
25
27
|
This package requires the following peer dependencies:
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
|
-
npm install react react-dom
|
|
30
|
+
npm install react react-dom antd
|
|
31
|
+
# or
|
|
32
|
+
yarn add react react-dom antd
|
|
29
33
|
```
|
|
30
34
|
|
|
31
35
|
## Usage
|
|
32
36
|
|
|
33
|
-
###
|
|
37
|
+
### Standard React/Vite Projects
|
|
38
|
+
|
|
39
|
+
Import components and styles in your main app file:
|
|
34
40
|
|
|
35
41
|
```tsx
|
|
36
42
|
import {
|
|
@@ -43,7 +49,6 @@ import {
|
|
|
43
49
|
NotificationDropdown
|
|
44
50
|
} from 'shekel-fe-shared-lib';
|
|
45
51
|
import 'shekel-fe-shared-lib/styles.css';
|
|
46
|
-
import 'antd/dist/reset.css'; // Required for Ant Design components
|
|
47
52
|
|
|
48
53
|
function App() {
|
|
49
54
|
return (
|
|
@@ -71,6 +76,49 @@ function App() {
|
|
|
71
76
|
}
|
|
72
77
|
```
|
|
73
78
|
|
|
79
|
+
### Next.js Projects
|
|
80
|
+
|
|
81
|
+
Due to PostCSS compatibility, Next.js projects need a slightly different setup:
|
|
82
|
+
|
|
83
|
+
1. **Create a postinstall script** (`scripts/copy-shared-lib-css.js`):
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const fs = require('fs');
|
|
87
|
+
const path = require('path');
|
|
88
|
+
|
|
89
|
+
const source = path.join(__dirname, '../node_modules/shekel-fe-shared-lib/dist/shekel-fe-shared-lib.css');
|
|
90
|
+
const dest = path.join(__dirname, '../styles/shekel-shared-lib.css');
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
if (fs.existsSync(source)) {
|
|
94
|
+
fs.copyFileSync(source, dest);
|
|
95
|
+
console.log('✓ Copied shekel-fe-shared-lib CSS successfully');
|
|
96
|
+
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.error('Warning: Could not copy shekel-fe-shared-lib CSS:', error.message);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
2. **Update your `package.json`**:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"scripts": {
|
|
107
|
+
"postinstall": "node scripts/copy-shared-lib-css.js"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
3. **Import in `_app.tsx`**:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import '@/styles/globals.scss';
|
|
116
|
+
import '@/styles/shekel-shared-lib.css'; // Import the copied CSS
|
|
117
|
+
import { ConfigProvider } from 'antd';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The postinstall script automatically copies the library's CSS to your local styles folder, avoiding PostCSS processing conflicts.
|
|
121
|
+
|
|
74
122
|
### Tailwind CSS Setup
|
|
75
123
|
|
|
76
124
|
If your project uses Tailwind CSS, add this library to your `tailwind.config.js` content array:
|
|
@@ -79,7 +127,9 @@ If your project uses Tailwind CSS, add this library to your `tailwind.config.js`
|
|
|
79
127
|
module.exports = {
|
|
80
128
|
content: [
|
|
81
129
|
"./src/**/*.{js,jsx,ts,tsx}",
|
|
82
|
-
"./
|
|
130
|
+
"./pages/**/*.{js,jsx,ts,tsx}", // for Next.js
|
|
131
|
+
"./components/**/*.{js,jsx,ts,tsx}", // for Next.js
|
|
132
|
+
"./node_modules/shekel-fe-shared-lib/dist/**/*.{js,mjs,cjs}",
|
|
83
133
|
],
|
|
84
134
|
// ... rest of your config
|
|
85
135
|
}
|