internhub-v2-mobile-ui-kit 0.0.3 → 0.0.5
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 +61 -61
- package/package.json +1 -1
- package/src/index.ts +20 -13
package/README.md
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# InternHub v2 Mobile UI Kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Được xây dựng trên React Native, hỗ trợ TypeScript và Dark Mode (future proof).
|
|
3
|
+
This repository contains the official design system and UI components for the InternHub v2 Mobile Application. It provides a standardized set of React Native components and design tokens (colors, typography, spacing) to ensure consistency across the application ecosystem.
|
|
5
4
|
|
|
6
|
-
##
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To integrate the UI kit into your project, install it via npm or yarn:
|
|
7
8
|
|
|
8
9
|
```bash
|
|
9
10
|
npm install internhub-v2-mobile-ui-kit
|
|
10
|
-
# Hoặc
|
|
11
|
-
yarn add internhub-v2-mobile-ui-kit
|
|
12
11
|
```
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
### Peer Dependencies
|
|
14
|
+
Ensure the following peer dependencies are installed in your project root:
|
|
15
|
+
- `react`
|
|
16
|
+
- `react-native`
|
|
17
|
+
- `react-native-linear-gradient`
|
|
18
|
+
- `react-native-svg`
|
|
18
19
|
|
|
19
|
-
##
|
|
20
|
+
## Usage
|
|
20
21
|
|
|
21
|
-
### 1.
|
|
22
|
-
|
|
22
|
+
### 1. Design Tokens
|
|
23
|
+
The UI kit exposes a comprehensive set of design tokens tailored for the application's theme.
|
|
23
24
|
|
|
24
25
|
```tsx
|
|
25
26
|
import { Colors, Spacing } from 'internhub-v2-mobile-ui-kit';
|
|
26
27
|
|
|
27
28
|
const styles = StyleSheet.create({
|
|
28
29
|
container: {
|
|
29
|
-
backgroundColor: Colors.background,
|
|
30
|
+
backgroundColor: Colors.background,
|
|
30
31
|
padding: Spacing.md,
|
|
31
32
|
},
|
|
32
|
-
|
|
33
|
-
color: Colors.primary,
|
|
33
|
+
primaryText: {
|
|
34
|
+
color: Colors.primary,
|
|
35
|
+
fontWeight: '600',
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
### 2. Components
|
|
40
|
+
### 2. Components
|
|
41
|
+
Import components directly from the package. All components adhere to the project's design guidelines.
|
|
39
42
|
|
|
40
43
|
#### Button
|
|
41
|
-
|
|
44
|
+
Supported variants: `primary`, `secondary`, `outline`, `ghost`.
|
|
42
45
|
|
|
43
46
|
```tsx
|
|
44
47
|
import { Button } from 'internhub-v2-mobile-ui-kit';
|
|
45
48
|
|
|
46
49
|
<Button
|
|
47
|
-
title="
|
|
48
|
-
onPress={
|
|
49
|
-
variant="primary"
|
|
50
|
-
loading={
|
|
50
|
+
title="Submit Application"
|
|
51
|
+
onPress={handleSubmit}
|
|
52
|
+
variant="primary"
|
|
53
|
+
loading={isSubmitting}
|
|
51
54
|
/>
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
#### Input
|
|
55
|
-
|
|
57
|
+
#### Input Field
|
|
58
|
+
Standard input field with integrated label and error handling.
|
|
56
59
|
|
|
57
60
|
```tsx
|
|
58
61
|
import { Input } from 'internhub-v2-mobile-ui-kit';
|
|
59
62
|
|
|
60
63
|
<Input
|
|
61
|
-
label="
|
|
62
|
-
placeholder="
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
label="Full Name"
|
|
65
|
+
placeholder="Enter your full name"
|
|
66
|
+
value={name}
|
|
67
|
+
onChangeText={setName}
|
|
68
|
+
error={errors.name}
|
|
65
69
|
/>
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
####
|
|
69
|
-
|
|
72
|
+
#### Selection Controls (Checkbox & Switch)
|
|
73
|
+
New in v0.0.4.
|
|
70
74
|
|
|
71
75
|
```tsx
|
|
72
|
-
import {
|
|
76
|
+
import { Checkbox, Switch } from 'internhub-v2-mobile-ui-kit';
|
|
73
77
|
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
<Checkbox
|
|
79
|
+
label="I agree to the terms"
|
|
80
|
+
checked={agreed}
|
|
81
|
+
onChange={setAgreed}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
<Switch
|
|
85
|
+
value={isEnabled}
|
|
86
|
+
onValueChange={toggleSwitch}
|
|
87
|
+
/>
|
|
77
88
|
```
|
|
78
89
|
|
|
79
|
-
|
|
80
|
-
Dùng cho status và ảnh đại diện.
|
|
90
|
+
## Component Library
|
|
81
91
|
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
| Category | Components | Status |
|
|
93
|
+
|----------|------------|--------|
|
|
94
|
+
| **Inputs** | Button, Input, Select, Checkbox, Switch, OTPInput, DatePicker, TimePicker | Stable |
|
|
95
|
+
| **Feedback** | Alert, Badge, Toast, Loading, EmptyState, Modal | Stable |
|
|
96
|
+
| **Data Display** | Card, Avatar, Divider, Header | Stable |
|
|
97
|
+
| **Layout** | GradientBackground | Stable |
|
|
84
98
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
## Versioning
|
|
100
|
+
|
|
101
|
+
We use Semantic Versioning (SemVer) for versioning. For the versions available, see the tags on this repository.
|
|
102
|
+
|
|
103
|
+
## Authors
|
|
104
|
+
|
|
105
|
+
**Nguyen Thanh Nhan**
|
|
106
|
+
Mobile Application Developer - InternHub Team
|
|
88
107
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| Component | Trạng Thái | Mô Tả |
|
|
92
|
-
|-----------|------------|-------|
|
|
93
|
-
| `Alert` | ✅ Ready | Hiển thị thông báo warning/info |
|
|
94
|
-
| `Avatar` | ✅ Ready | Ảnh đại diện tròn hoặc chữ cái đầu |
|
|
95
|
-
| `Badge` | ✅ Ready | Nhãn trạng thái (Success, Error...) |
|
|
96
|
-
| `Button` | ✅ Ready | Nút bấm chính/phụ |
|
|
97
|
-
| `Card` | ✅ Ready | Khung chứa nội dung container |
|
|
98
|
-
| `Divider` | ✅ Ready | Đường kẻ phân cách (mới) |
|
|
99
|
-
| `EmptyState`| ✅ Ready | Màn hình hiển thị khi không có dữ liệu (mới)|
|
|
100
|
-
| `Header` | ✅ Ready | Thanh tiêu đề điều hướng (mới) |
|
|
101
|
-
| `Input` | ✅ Ready | Ô nhập liệu văn bản |
|
|
102
|
-
| `Loading` | ✅ Ready | Vòng xoay chờ tải trang (mới) |
|
|
103
|
-
| `Modal` | ✅ Ready | Hộp thoại popup |
|
|
104
|
-
| `Select` | ✅ Ready | Dropdown chọn options |
|
|
105
|
-
| `Toast` | 🚧 W.I.P | Thông báo nổi tự tắt |
|
|
106
|
-
|
|
107
|
-
## 👨💻 Tác Giả
|
|
108
|
-
**Nguyen Thanh Nhan** - InternHub Team
|
|
108
|
+
This project is proprietary software. Unauthorized copying of files via any medium is strictly prohibited.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
// Design Tokens
|
|
2
2
|
export * from './tokens';
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// Inputs & Forms
|
|
5
5
|
export { Button } from './Button/Button';
|
|
6
6
|
export { Input } from './Input/Input';
|
|
7
|
-
export {
|
|
7
|
+
export { Select } from './Select/Select';
|
|
8
|
+
export { Checkbox } from './Checkbox/Checkbox';
|
|
9
|
+
export { Switch } from './Switch/Switch';
|
|
8
10
|
export { OTPInput } from './OTPInput/OTPInput';
|
|
9
|
-
export { Alert } from './Alert/Alert';
|
|
10
|
-
export { GradientBackground } from './GradientBackground/GradientBackground';
|
|
11
|
-
export { Modal } from './Modal/Modal';
|
|
12
11
|
export { PasswordChecker } from './PasswordChecker/PasswordChecker';
|
|
12
|
+
export { DatePicker } from './DatePicker/DatePicker';
|
|
13
|
+
export { TimePicker } from './TimePicker/TimePicker';
|
|
13
14
|
|
|
14
|
-
//
|
|
15
|
-
export {
|
|
15
|
+
// Feedback & Status
|
|
16
|
+
export { Alert } from './Alert/Alert';
|
|
16
17
|
export { Badge } from './Badge/Badge';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
18
|
+
export { Toast } from './Toast/Toast';
|
|
19
|
+
export { Loading } from './Loading/Loading';
|
|
19
20
|
export { EmptyState } from './EmptyState/EmptyState';
|
|
21
|
+
export { Modal } from './Modal/Modal';
|
|
22
|
+
export { BottomSheet } from './BottomSheet/BottomSheet';
|
|
23
|
+
export { Skeleton } from './Skeleton/Skeleton';
|
|
24
|
+
|
|
25
|
+
// Layout & Container
|
|
26
|
+
export { Card } from './Card/Card';
|
|
20
27
|
export { Header } from './Header/Header';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
28
|
+
export { Divider } from './Divider/Divider';
|
|
29
|
+
export { Avatar } from './Avatar/Avatar';
|
|
30
|
+
export { Icon } from './Icon/Icon';
|
|
31
|
+
export { GradientBackground } from './GradientBackground/GradientBackground';
|