@nhatdev94/common-ui 1.1.11 → 1.1.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.
- package/README.md +30 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,45 +17,60 @@ This package requires:
|
|
|
17
17
|
|
|
18
18
|
------------------------------------------------------------------------
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
🚀 Hướng dẫn tích hợp cho dự án mới
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Để sử dụng thư viện trong các dự án mới (Vite, Next.js, v.v.), vui lòng làm theo các bước hướng dẫn dưới đây.
|
|
23
|
+
|
|
24
|
+
1️⃣ Cài đặt
|
|
23
25
|
|
|
24
26
|
``` bash
|
|
25
27
|
npm install @nhatdev94/common-ui
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
2️⃣ Thiết lập Styles & Themes
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
Mở file CSS chính của bạn (ví dụ: src/index.css hoặc app/globals.css) và cấu hình như sau:
|
|
31
33
|
|
|
32
34
|
``` bash
|
|
33
|
-
/* Trong file CSS chính của bạn */
|
|
34
35
|
@import "tailwindcss";
|
|
35
|
-
@import "@nhatdev94/common-ui/themes/default.css";
|
|
36
36
|
|
|
37
|
-
/*
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
/* -----------------------------------------------------------
|
|
38
|
+
* IMPORT THEME
|
|
39
|
+
* Cung cấp màu sắc, biến CSS nền và thiết lập layout cơ bản.
|
|
40
|
+
* ----------------------------------------------------------- */
|
|
41
|
+
@import "@nhatdev94/common-ui/themes/default.css";
|
|
40
42
|
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
## Cấu hình Tailwind v4 (Nếu thiếu Style)
|
|
44
|
-
|
|
45
45
|
Nếu bạn nhận thấy các Component hiển thị nhưng bị mất các class tiện ích của Tailwind (như padding, margin, màu sắc động), đó là do Tailwind v4 chưa quét qua mã nguồn của thư viện.
|
|
46
46
|
|
|
47
47
|
Hãy thêm dòng @source bên dưới phần import trong file CSS:
|
|
48
48
|
|
|
49
49
|
``` bash
|
|
50
|
-
@import "tailwindcss";
|
|
51
|
-
@import "@nhatdev94/common-ui/themes/emerald.css";
|
|
52
|
-
|
|
53
|
-
/* Thêm dòng này nếu Component không hiển thị đúng Style */
|
|
54
50
|
@source "../node_modules/@nhatdev94/common-ui/dist/**/*.js";
|
|
55
51
|
```
|
|
56
52
|
|
|
57
53
|
------------------------------------------------------------------------
|
|
58
54
|
|
|
55
|
+
🛠 Cách sử dụng Component
|
|
56
|
+
|
|
57
|
+
Sau khi thiết lập xong, bạn có thể bắt đầu sử dụng các component trong dự án của mình:
|
|
58
|
+
|
|
59
|
+
``` bash
|
|
60
|
+
import { Button } from '@nhatdev94/common-ui';
|
|
61
|
+
|
|
62
|
+
export default function App() {
|
|
63
|
+
return (
|
|
64
|
+
<div className="flex gap-4 p-8">
|
|
65
|
+
<Button variant="primary">Click Me</Button>
|
|
66
|
+
<Button variant="outline">Cancel</Button>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
------------------------------------------------------------------------
|
|
73
|
+
|
|
59
74
|
# 1. Executive Summary
|
|
60
75
|
|
|
61
76
|
`@nhatdev94/common-ui` là thư viện UI component dùng chung cho toàn bộ hệ
|