internhub-v2-mobile-ui-kit 1.1.4 → 1.1.6
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 +49 -0
- package/package.json +5 -3
- package/src/Alert/Alert.tsx +27 -19
- package/src/Card/Card.tsx +0 -1
- package/src/DatePicker/DatePicker.tsx +508 -326
- package/src/Divider/Divider.tsx +2 -2
- package/src/EmptyState/EmptyState.tsx +8 -6
- package/src/Header/Header.tsx +8 -38
- package/src/Input/Input.tsx +24 -68
- package/src/Modal/Modal.tsx +176 -330
- package/src/OTPInput/OTPInput.tsx +14 -11
- package/src/OrangeIcon/OrangeIcon.tsx +16 -0
- package/src/Select/AdvancedSelect.tsx +12 -8
- package/src/VectorIcons/VectorIcons.tsx +7 -178
- package/src/assets/icons/orange.svg +98 -0
- package/src/index.ts +30 -33
- package/src/tokens.ts +137 -146
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# InternHub Mobile UI Kit
|
|
2
|
+
|
|
3
|
+
React Native UI component library and design tokens for the InternHub mobile app. Use system default fonts; no custom font bundling required.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install internhub-v2-mobile-ui-kit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `react`, `react-native`. Optional: `react-native-linear-gradient`, `react-native-svg` for gradient and icon components.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Colors, Spacing, Button, Input, Card, Header } from 'internhub-v2-mobile-ui-kit';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Design tokens
|
|
20
|
+
|
|
21
|
+
- **Colors** – primary, background, text, borders, status (success, error, warning, info)
|
|
22
|
+
- **Spacing** – xs, sm, md, lg, xl, xxl
|
|
23
|
+
- **BorderRadius** – sm, md, lg, xl, xxl, full
|
|
24
|
+
- **FontSize** – xs, sm, md, lg, xl, xxl, xxxl
|
|
25
|
+
- **FontWeight** – regular, medium, semibold, bold
|
|
26
|
+
- **Shadow** – card, modal presets
|
|
27
|
+
|
|
28
|
+
### Components
|
|
29
|
+
|
|
30
|
+
| Category | Components |
|
|
31
|
+
|----------|------------|
|
|
32
|
+
| Inputs & forms | Button, Input, Select, AdvancedSelect, Checkbox, Switch, OTPInput, PasswordChecker, DatePicker, TimePicker |
|
|
33
|
+
| Feedback | Alert, Badge, Toast, Loading, EmptyState, Modal, BottomSheet, Skeleton |
|
|
34
|
+
| Layout | Card, Header, Divider, Avatar, Icon, GradientBackground |
|
|
35
|
+
| Icons | UploadIcon, TrashIcon, RetryIcon |
|
|
36
|
+
|
|
37
|
+
### Example
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button, Colors, Card } from 'internhub-v2-mobile-ui-kit';
|
|
41
|
+
|
|
42
|
+
<Card style={{ margin: 16 }}>
|
|
43
|
+
<Button title="Submit" onPress={() => {}} variant="primary" />
|
|
44
|
+
</Card>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "internhub-v2-mobile-ui-kit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Premium UI Kit for InternHub Mobile App",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "*",
|
|
20
|
-
"react-native": "*"
|
|
20
|
+
"react-native": "*",
|
|
21
|
+
"react-native-vector-icons": "*"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
24
|
"react-native-linear-gradient": "^2.8.3",
|
|
24
|
-
"react-native-svg": "^14.1.0"
|
|
25
|
+
"react-native-svg": "^14.1.0",
|
|
26
|
+
"react-native-vector-icons": "^10.2.0"
|
|
25
27
|
}
|
|
26
28
|
}
|
package/src/Alert/Alert.tsx
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
4
4
|
import { Spacing, FontSize, BorderRadius, Colors } from '../tokens';
|
|
5
5
|
|
|
6
|
+
const ALERT_ICON_SIZE = 20;
|
|
7
|
+
|
|
6
8
|
interface AlertProps {
|
|
7
9
|
type: 'success' | 'error' | 'warning' | 'info';
|
|
8
10
|
message: string;
|
|
9
11
|
subMessage?: string;
|
|
12
|
+
center?: boolean;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
const iconMap = {
|
|
16
|
+
success: { name: 'check-circle' as const, color: Colors.white },
|
|
17
|
+
error: { name: 'error' as const, color: Colors.white },
|
|
18
|
+
warning: { name: 'warning' as const, color: Colors.white },
|
|
19
|
+
info: { name: 'info' as const, color: Colors.white },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Alert = ({ type, message, subMessage, center }: AlertProps) => {
|
|
13
23
|
const getStyles = () => {
|
|
14
24
|
switch (type) {
|
|
15
25
|
case 'success':
|
|
16
26
|
return {
|
|
17
27
|
container: styles.successContainer,
|
|
18
|
-
icon: '✓',
|
|
19
28
|
iconStyle: styles.successIcon,
|
|
20
29
|
messageStyle: styles.successMessage,
|
|
21
30
|
subMessageStyle: styles.successSubMessage,
|
|
@@ -23,7 +32,6 @@ export const Alert = ({ type, message, subMessage }: AlertProps) => {
|
|
|
23
32
|
case 'error':
|
|
24
33
|
return {
|
|
25
34
|
container: styles.errorContainer,
|
|
26
|
-
icon: '!',
|
|
27
35
|
iconStyle: styles.errorIcon,
|
|
28
36
|
messageStyle: styles.errorMessage,
|
|
29
37
|
subMessageStyle: styles.errorSubMessage,
|
|
@@ -31,7 +39,6 @@ export const Alert = ({ type, message, subMessage }: AlertProps) => {
|
|
|
31
39
|
case 'warning':
|
|
32
40
|
return {
|
|
33
41
|
container: styles.warningContainer,
|
|
34
|
-
icon: '!',
|
|
35
42
|
iconStyle: styles.warningIcon,
|
|
36
43
|
messageStyle: styles.warningMessage,
|
|
37
44
|
subMessageStyle: styles.warningSubMessage,
|
|
@@ -40,7 +47,6 @@ export const Alert = ({ type, message, subMessage }: AlertProps) => {
|
|
|
40
47
|
default:
|
|
41
48
|
return {
|
|
42
49
|
container: styles.infoContainer,
|
|
43
|
-
icon: 'i',
|
|
44
50
|
iconStyle: styles.infoIcon,
|
|
45
51
|
messageStyle: styles.infoMessage,
|
|
46
52
|
subMessageStyle: styles.infoSubMessage,
|
|
@@ -49,11 +55,16 @@ export const Alert = ({ type, message, subMessage }: AlertProps) => {
|
|
|
49
55
|
};
|
|
50
56
|
|
|
51
57
|
const alertStyles = getStyles();
|
|
58
|
+
const icon = iconMap[type];
|
|
52
59
|
|
|
53
60
|
return (
|
|
54
61
|
<View style={[styles.container, alertStyles.container]}>
|
|
55
62
|
<View style={[styles.iconContainer, alertStyles.iconStyle]}>
|
|
56
|
-
<
|
|
63
|
+
<MaterialIcons
|
|
64
|
+
name={icon.name}
|
|
65
|
+
size={ALERT_ICON_SIZE}
|
|
66
|
+
color={icon.color}
|
|
67
|
+
/>
|
|
57
68
|
</View>
|
|
58
69
|
<View style={styles.textContainer}>
|
|
59
70
|
<Text style={[styles.message, alertStyles.messageStyle]}>{message}</Text>
|
|
@@ -76,20 +87,18 @@ const styles = StyleSheet.create({
|
|
|
76
87
|
marginBottom: Spacing.md,
|
|
77
88
|
marginTop: Spacing.sm,
|
|
78
89
|
},
|
|
90
|
+
containerCenter: {
|
|
91
|
+
alignItems: 'center',
|
|
92
|
+
},
|
|
79
93
|
iconContainer: {
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
82
|
-
borderRadius:
|
|
94
|
+
width: 24,
|
|
95
|
+
height: 24,
|
|
96
|
+
borderRadius: 12,
|
|
83
97
|
justifyContent: 'center',
|
|
84
98
|
alignItems: 'center',
|
|
85
99
|
marginRight: Spacing.sm,
|
|
86
100
|
marginTop: 2,
|
|
87
101
|
},
|
|
88
|
-
iconText: {
|
|
89
|
-
color: Colors.white,
|
|
90
|
-
fontSize: 12,
|
|
91
|
-
fontWeight: 'bold',
|
|
92
|
-
},
|
|
93
102
|
textContainer: {
|
|
94
103
|
flex: 1,
|
|
95
104
|
},
|
|
@@ -97,11 +106,13 @@ const styles = StyleSheet.create({
|
|
|
97
106
|
fontSize: FontSize.md,
|
|
98
107
|
fontWeight: '500',
|
|
99
108
|
},
|
|
109
|
+
messageCenter: {
|
|
110
|
+
textAlign: 'center',
|
|
111
|
+
},
|
|
100
112
|
subMessage: {
|
|
101
113
|
fontSize: FontSize.sm,
|
|
102
114
|
marginTop: 4,
|
|
103
115
|
},
|
|
104
|
-
// Success
|
|
105
116
|
successContainer: {
|
|
106
117
|
backgroundColor: Colors.successLight,
|
|
107
118
|
borderWidth: 1,
|
|
@@ -116,7 +127,6 @@ const styles = StyleSheet.create({
|
|
|
116
127
|
successSubMessage: {
|
|
117
128
|
color: Colors.successDark,
|
|
118
129
|
},
|
|
119
|
-
// Error - Pink/Red background like Figma
|
|
120
130
|
errorContainer: {
|
|
121
131
|
backgroundColor: Colors.errorPink,
|
|
122
132
|
borderWidth: 1,
|
|
@@ -131,7 +141,6 @@ const styles = StyleSheet.create({
|
|
|
131
141
|
errorSubMessage: {
|
|
132
142
|
color: Colors.errorDark,
|
|
133
143
|
},
|
|
134
|
-
// Warning
|
|
135
144
|
warningContainer: {
|
|
136
145
|
backgroundColor: Colors.warningLight,
|
|
137
146
|
borderWidth: 1,
|
|
@@ -146,7 +155,6 @@ const styles = StyleSheet.create({
|
|
|
146
155
|
warningSubMessage: {
|
|
147
156
|
color: Colors.primaryDark,
|
|
148
157
|
},
|
|
149
|
-
// Info
|
|
150
158
|
infoContainer: {
|
|
151
159
|
backgroundColor: Colors.infoLight,
|
|
152
160
|
borderWidth: 1,
|