@himakarinv/nativex 1.0.0
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/LICENSE +21 -0
- package/README.md +105 -0
- package/images.d.ts +14 -0
- package/index.js +8 -0
- package/nativewind-preset.js +18 -0
- package/package.json +120 -0
- package/src/assets/branding/logo.jpg +0 -0
- package/src/assets/branding/softech-logo.png +0 -0
- package/src/assets/icons/2-layers.svg +3 -0
- package/src/assets/icons/Forbidden.svg +211 -0
- package/src/assets/icons/Internal-server-error.svg +119 -0
- package/src/assets/icons/Log-out-nav.svg +4 -0
- package/src/assets/icons/Not-Found.svg +282 -0
- package/src/assets/icons/Unauthorized.svg +314 -0
- package/src/assets/icons/User-Frame.svg +5 -0
- package/src/assets/icons/alert.svg +4 -0
- package/src/assets/icons/arrow-right.svg +3 -0
- package/src/assets/icons/avatar-female.svg +10 -0
- package/src/assets/icons/avatar-male.svg +10 -0
- package/src/assets/icons/bell.svg +3 -0
- package/src/assets/icons/calendar-event.svg +11 -0
- package/src/assets/icons/calendar.svg +6 -0
- package/src/assets/icons/card.svg +4 -0
- package/src/assets/icons/caret-right.svg +3 -0
- package/src/assets/icons/chat.svg +11 -0
- package/src/assets/icons/check.svg +3 -0
- package/src/assets/icons/checkbox-minus.svg +3 -0
- package/src/assets/icons/checkmark.svg +3 -0
- package/src/assets/icons/chevron-down.svg +3 -0
- package/src/assets/icons/chevron-left.svg +9 -0
- package/src/assets/icons/chevron-right.svg +9 -0
- package/src/assets/icons/circle-radio-active.svg +10 -0
- package/src/assets/icons/circle-radio.svg +10 -0
- package/src/assets/icons/clock.svg +3 -0
- package/src/assets/icons/close.svg +3 -0
- package/src/assets/icons/code.svg +3 -0
- package/src/assets/icons/country.svg +20 -0
- package/src/assets/icons/dot.svg +3 -0
- package/src/assets/icons/download.svg +1 -0
- package/src/assets/icons/dropdown-arrow.svg +3 -0
- package/src/assets/icons/dropdown-avatar.svg +3 -0
- package/src/assets/icons/email.svg +3 -0
- package/src/assets/icons/error.svg +3 -0
- package/src/assets/icons/eye-off.svg +1 -0
- package/src/assets/icons/eye.svg +1 -0
- package/src/assets/icons/hashtag-icon.svg +3 -0
- package/src/assets/icons/help-circle.svg +10 -0
- package/src/assets/icons/help.svg +4 -0
- package/src/assets/icons/hide-checkbox.svg +3 -0
- package/src/assets/icons/home-smile.svg +3 -0
- package/src/assets/icons/home.svg +3 -0
- package/src/assets/icons/info.svg +5 -0
- package/src/assets/icons/left-arrow.svg +3 -0
- package/src/assets/icons/log-out.svg +3 -0
- package/src/assets/icons/notification-box.svg +4 -0
- package/src/assets/icons/pencil.svg +1 -0
- package/src/assets/icons/plus.svg +3 -0
- package/src/assets/icons/radio-dot.svg +3 -0
- package/src/assets/icons/right-arrow.svg +3 -0
- package/src/assets/icons/search.svg +3 -0
- package/src/assets/icons/settings.svg +11 -0
- package/src/assets/icons/slack.svg +17 -0
- package/src/assets/icons/slash.svg +3 -0
- package/src/assets/icons/success.svg +3 -0
- package/src/assets/icons/successicon.svg +5 -0
- package/src/assets/icons/three-dot-vertical.svg +5 -0
- package/src/assets/icons/trash.svg +1 -0
- package/src/assets/icons/trend-down-01.svg +3 -0
- package/src/assets/icons/trend-up-01.svg +3 -0
- package/src/assets/icons/up-arrow.svg +3 -0
- package/src/assets/icons/user-plus.svg +10 -0
- package/src/assets/icons/user.svg +3 -0
- package/src/assets/icons/users.svg +3 -0
- package/src/assets/icons/vertical-dots-true-icon.svg +5 -0
- package/src/assets/icons/vertical-line.svg +3 -0
- package/src/assets/icons/vertical-three-dots-icon.svg +5 -0
- package/src/assets/icons/warning.svg +3 -0
- package/src/assets/icons/zap.svg +3 -0
- package/src/components/ActionsMenu/ActionsMenu.tsx +314 -0
- package/src/components/ActionsMenu/index.ts +2 -0
- package/src/components/Alert/Alert.tsx +291 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Badge/Badge.tsx +230 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +364 -0
- package/src/components/Breadcrumb/index.ts +7 -0
- package/src/components/Button/Button.tsx +584 -0
- package/src/components/Button/index.ts +9 -0
- package/src/components/Checkbox/Checkbox.tsx +336 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/CreatePassword/CreatePassword.tsx +161 -0
- package/src/components/CreatePassword/index.ts +2 -0
- package/src/components/DataTable/DataTable.tsx +822 -0
- package/src/components/DataTable/index.ts +10 -0
- package/src/components/Datepicker/Datepicker.tsx +797 -0
- package/src/components/Datepicker/index.ts +2 -0
- package/src/components/Dropdown/Dropdown.tsx +277 -0
- package/src/components/Dropdown/index.ts +7 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +471 -0
- package/src/components/DropdownMenu/index.ts +11 -0
- package/src/components/DynamicForm/DynamicForm.tsx +741 -0
- package/src/components/DynamicForm/index.ts +13 -0
- package/src/components/ErrorPages/ErrorPages.tsx +135 -0
- package/src/components/ErrorPages/index.ts +2 -0
- package/src/components/ForgotPassword/ForgotPassword.tsx +121 -0
- package/src/components/ForgotPassword/index.ts +2 -0
- package/src/components/HintError/HintError.tsx +37 -0
- package/src/components/HintError/index.ts +2 -0
- package/src/components/Icon/Icon.tsx +43 -0
- package/src/components/Icon/icon-registry.ts +227 -0
- package/src/components/Icon/index.ts +3 -0
- package/src/components/InputDropdown/InputDropdown.tsx +662 -0
- package/src/components/InputDropdown/index.ts +9 -0
- package/src/components/InputField/InputField.tsx +527 -0
- package/src/components/InputField/index.ts +2 -0
- package/src/components/Label/Label.tsx +88 -0
- package/src/components/Label/index.ts +2 -0
- package/src/components/LoginForm/LoginForm.tsx +158 -0
- package/src/components/LoginForm/index.ts +2 -0
- package/src/components/LoginShell/LoginShell.tsx +97 -0
- package/src/components/LoginShell/RoleCard.tsx +24 -0
- package/src/components/LoginShell/SoftechLogo.tsx +24 -0
- package/src/components/LoginShell/branding-assets.ts +2 -0
- package/src/components/LoginShell/index.ts +20 -0
- package/src/components/LoginShell/login-copy.ts +45 -0
- package/src/components/LoginShell/loginPageStyles.ts +210 -0
- package/src/components/Modals/Modals.tsx +313 -0
- package/src/components/Modals/index.ts +2 -0
- package/src/components/Offcanvas/Offcanvas.tsx +404 -0
- package/src/components/Offcanvas/index.ts +13 -0
- package/src/components/PageHeader/PageHeader.tsx +128 -0
- package/src/components/PageHeader/index.ts +2 -0
- package/src/components/Pagination/Pagination.tsx +540 -0
- package/src/components/Pagination/index.ts +8 -0
- package/src/components/ResetPassword/ResetPassword.tsx +172 -0
- package/src/components/ResetPassword/index.ts +2 -0
- package/src/components/RoleSelection/RoleSelection.tsx +111 -0
- package/src/components/RoleSelection/index.ts +2 -0
- package/src/components/SendOtp/SendOtp.tsx +149 -0
- package/src/components/SendOtp/index.ts +2 -0
- package/src/components/Sidenavbar/Sidenavbar.tsx +358 -0
- package/src/components/Sidenavbar/index.ts +2 -0
- package/src/components/StatCard/StatCard.tsx +393 -0
- package/src/components/StatCard/index.ts +6 -0
- package/src/components/Tabs/Tabs.tsx +239 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/Textarea/Textarea.tsx +217 -0
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Timepicker/Timepicker.tsx +384 -0
- package/src/components/Timepicker/index.ts +2 -0
- package/src/components/Toast/Toast.tsx +278 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +296 -0
- package/src/components/Toggle/index.ts +2 -0
- package/src/components/Typeahead/Typeahead.tsx +521 -0
- package/src/components/Typeahead/index.ts +2 -0
- package/src/components/Verification/Verification.tsx +374 -0
- package/src/components/Verification/index.ts +2 -0
- package/src/index.ts +39 -0
- package/src/theme/borders.ts +19 -0
- package/src/theme/button.ts +41 -0
- package/src/theme/colors.ts +273 -0
- package/src/theme/index.ts +14 -0
- package/src/theme/nativewind-theme.js +182 -0
- package/src/theme/radius.ts +12 -0
- package/src/theme/shadows.ts +40 -0
- package/src/theme/spacing.ts +18 -0
- package/src/theme/typography.ts +35 -0
- package/src/utils/a11y.ts +21 -0
- package/svg.d.ts +7 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Platform,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
TextInput,
|
|
7
|
+
View,
|
|
8
|
+
type NativeSyntheticEvent,
|
|
9
|
+
type StyleProp,
|
|
10
|
+
type TextInputKeyPressEventData,
|
|
11
|
+
type ViewStyle,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
|
|
14
|
+
import { borders, colors, radius, shadows, spacing, typography } from '../../theme';
|
|
15
|
+
import { a11yHiddenProps } from '../../utils/a11y';
|
|
16
|
+
import { HintError } from '../HintError';
|
|
17
|
+
import { Label } from '../Label';
|
|
18
|
+
|
|
19
|
+
export const VerificationSize = {
|
|
20
|
+
Small: 'sm',
|
|
21
|
+
Medium: 'md',
|
|
22
|
+
Large: 'lg',
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
export type VerificationSize = (typeof VerificationSize)[keyof typeof VerificationSize];
|
|
26
|
+
|
|
27
|
+
export const VerificationDigits = {
|
|
28
|
+
Four: 4,
|
|
29
|
+
Six: 6,
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export type VerificationDigits = (typeof VerificationDigits)[keyof typeof VerificationDigits];
|
|
33
|
+
|
|
34
|
+
export type VerificationProps = {
|
|
35
|
+
digits?: VerificationDigits;
|
|
36
|
+
size?: VerificationSize;
|
|
37
|
+
label?: string;
|
|
38
|
+
hint?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
value?: string;
|
|
41
|
+
onValueChange?: (code: string) => void;
|
|
42
|
+
style?: StyleProp<ViewStyle>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const isNative = Platform.OS !== 'web';
|
|
46
|
+
|
|
47
|
+
const BOX = {
|
|
48
|
+
[VerificationSize.Small]: {
|
|
49
|
+
size: spacing['5xl'],
|
|
50
|
+
fontSize: typography.fontSize.xl,
|
|
51
|
+
gap: spacing.md,
|
|
52
|
+
},
|
|
53
|
+
[VerificationSize.Medium]: {
|
|
54
|
+
size: spacing['6xl'],
|
|
55
|
+
fontSize: typography.fontSize.xl,
|
|
56
|
+
gap: spacing.md,
|
|
57
|
+
},
|
|
58
|
+
[VerificationSize.Large]: {
|
|
59
|
+
size: spacing['7xl'],
|
|
60
|
+
fontSize: typography.fontSize['2xl'],
|
|
61
|
+
gap: spacing.sm + spacing.xs,
|
|
62
|
+
},
|
|
63
|
+
} as const;
|
|
64
|
+
|
|
65
|
+
function emptyValues(count: number) {
|
|
66
|
+
return Array.from({ length: count }, () => '');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function onlyDigits(text: string) {
|
|
70
|
+
return text.replace(/\D/g, '');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function webBoxShadow(): ViewStyle {
|
|
74
|
+
return {
|
|
75
|
+
boxShadow: `0 ${shadows.boxLight.offsetY}px ${shadows.boxLight.radius}px ${colors.boxShadowLight}`,
|
|
76
|
+
} as ViewStyle;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function Verification({
|
|
80
|
+
digits = VerificationDigits.Four,
|
|
81
|
+
size = VerificationSize.Medium,
|
|
82
|
+
label = '',
|
|
83
|
+
hint = '',
|
|
84
|
+
error = '',
|
|
85
|
+
value,
|
|
86
|
+
onValueChange,
|
|
87
|
+
style,
|
|
88
|
+
}: VerificationProps) {
|
|
89
|
+
const [values, setValues] = useState(() => emptyValues(digits));
|
|
90
|
+
const [focusedIndex, setFocusedIndex] = useState<number | null>(null);
|
|
91
|
+
const [caretOn, setCaretOn] = useState(true);
|
|
92
|
+
const inputRefs = useRef<Array<TextInput | null>>([]);
|
|
93
|
+
const metrics = BOX[size];
|
|
94
|
+
const showSeparator = digits === VerificationDigits.Six;
|
|
95
|
+
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (focusedIndex === null) {
|
|
98
|
+
setCaretOn(true);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
setCaretOn(true);
|
|
103
|
+
const blink = setInterval(() => {
|
|
104
|
+
setCaretOn((visible) => !visible);
|
|
105
|
+
}, 530);
|
|
106
|
+
|
|
107
|
+
return () => clearInterval(blink);
|
|
108
|
+
}, [focusedIndex, values]);
|
|
109
|
+
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
setValues(emptyValues(digits));
|
|
112
|
+
}, [digits]);
|
|
113
|
+
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (value === undefined) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const next = emptyValues(digits);
|
|
120
|
+
onlyDigits(value)
|
|
121
|
+
.slice(0, digits)
|
|
122
|
+
.split('')
|
|
123
|
+
.forEach((digit, index) => {
|
|
124
|
+
next[index] = digit;
|
|
125
|
+
});
|
|
126
|
+
setValues(next);
|
|
127
|
+
}, [value, digits]);
|
|
128
|
+
|
|
129
|
+
const emit = (next: string[]) => {
|
|
130
|
+
setValues(next);
|
|
131
|
+
onValueChange?.(next.join(''));
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const focusInput = (index: number) => {
|
|
135
|
+
const input = inputRefs.current[index];
|
|
136
|
+
if (!input) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
input.focus();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const fillFrom = (raw: string, startIndex = 0) => {
|
|
143
|
+
const pasted = onlyDigits(raw);
|
|
144
|
+
if (!pasted) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const next = [...values];
|
|
149
|
+
for (let offset = 0; offset < pasted.length && startIndex + offset < digits; offset += 1) {
|
|
150
|
+
next[startIndex + offset] = pasted[offset];
|
|
151
|
+
}
|
|
152
|
+
emit(next);
|
|
153
|
+
|
|
154
|
+
const nextEmpty = next.findIndex((digit) => !digit);
|
|
155
|
+
focusInput(nextEmpty === -1 ? digits - 1 : nextEmpty);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const onDigitChange = (index: number, text: string) => {
|
|
159
|
+
const cleaned = onlyDigits(text);
|
|
160
|
+
if (cleaned.length > 1) {
|
|
161
|
+
fillFrom(cleaned, index);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const digit = cleaned.slice(-1);
|
|
166
|
+
const next = [...values];
|
|
167
|
+
next[index] = digit;
|
|
168
|
+
emit(next);
|
|
169
|
+
|
|
170
|
+
if (digit && index < digits - 1) {
|
|
171
|
+
focusInput(index + 1);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const onKeyPress = (index: number, event: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
|
|
176
|
+
const key = event.nativeEvent.key;
|
|
177
|
+
|
|
178
|
+
if (key === 'Backspace') {
|
|
179
|
+
if (values[index]) {
|
|
180
|
+
const next = [...values];
|
|
181
|
+
next[index] = '';
|
|
182
|
+
emit(next);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (index > 0) {
|
|
186
|
+
const next = [...values];
|
|
187
|
+
next[index - 1] = '';
|
|
188
|
+
emit(next);
|
|
189
|
+
focusInput(index - 1);
|
|
190
|
+
}
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (key === 'ArrowLeft' && index > 0) {
|
|
195
|
+
focusInput(index - 1);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (key === 'ArrowRight' && index < digits - 1) {
|
|
200
|
+
focusInput(index + 1);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<View style={[styles.host, style]}>
|
|
206
|
+
{label ? <Label embedded text={label} labelStyle={styles.label} /> : null}
|
|
207
|
+
|
|
208
|
+
<View style={[styles.row, { gap: metrics.gap }]}>
|
|
209
|
+
{Array.from({ length: digits }, (_, index) => (
|
|
210
|
+
<View key={index} style={styles.cellGroup}>
|
|
211
|
+
{showSeparator && index === 3 ? (
|
|
212
|
+
<Text
|
|
213
|
+
{...a11yHiddenProps()}
|
|
214
|
+
style={[
|
|
215
|
+
styles.separator,
|
|
216
|
+
{
|
|
217
|
+
fontSize: metrics.fontSize + spacing.sm,
|
|
218
|
+
lineHeight: metrics.size,
|
|
219
|
+
width: spacing.base,
|
|
220
|
+
},
|
|
221
|
+
]}>
|
|
222
|
+
-
|
|
223
|
+
</Text>
|
|
224
|
+
) : null}
|
|
225
|
+
<View
|
|
226
|
+
style={[
|
|
227
|
+
styles.box,
|
|
228
|
+
{
|
|
229
|
+
width: metrics.size,
|
|
230
|
+
height: metrics.size,
|
|
231
|
+
},
|
|
232
|
+
!isNative && webBoxShadow(),
|
|
233
|
+
]}>
|
|
234
|
+
<View pointerEvents="none" style={styles.digitLayer}>
|
|
235
|
+
{values[index] ? (
|
|
236
|
+
<View style={styles.digitRow}>
|
|
237
|
+
<Text
|
|
238
|
+
style={[
|
|
239
|
+
styles.digit,
|
|
240
|
+
{
|
|
241
|
+
fontSize: metrics.fontSize,
|
|
242
|
+
lineHeight: metrics.size - borders.width.medium,
|
|
243
|
+
},
|
|
244
|
+
]}>
|
|
245
|
+
{values[index]}
|
|
246
|
+
</Text>
|
|
247
|
+
{focusedIndex === index && caretOn ? (
|
|
248
|
+
<View style={[styles.caret, { height: metrics.fontSize }]} />
|
|
249
|
+
) : null}
|
|
250
|
+
</View>
|
|
251
|
+
) : (
|
|
252
|
+
<>
|
|
253
|
+
<Text
|
|
254
|
+
style={[
|
|
255
|
+
styles.digit,
|
|
256
|
+
styles.placeholder,
|
|
257
|
+
{
|
|
258
|
+
fontSize: metrics.fontSize,
|
|
259
|
+
lineHeight: metrics.size - borders.width.medium,
|
|
260
|
+
},
|
|
261
|
+
]}>
|
|
262
|
+
0
|
|
263
|
+
</Text>
|
|
264
|
+
{focusedIndex === index && caretOn ? (
|
|
265
|
+
<View style={[styles.caret, styles.caretCenter, { height: metrics.fontSize }]} />
|
|
266
|
+
) : null}
|
|
267
|
+
</>
|
|
268
|
+
)}
|
|
269
|
+
</View>
|
|
270
|
+
<TextInput
|
|
271
|
+
ref={(node) => {
|
|
272
|
+
inputRefs.current[index] = node;
|
|
273
|
+
}}
|
|
274
|
+
value={values[index]}
|
|
275
|
+
caretHidden
|
|
276
|
+
keyboardType="number-pad"
|
|
277
|
+
inputMode="numeric"
|
|
278
|
+
maxLength={1}
|
|
279
|
+
selectTextOnFocus
|
|
280
|
+
autoComplete={index === 0 ? 'one-time-code' : 'off'}
|
|
281
|
+
textContentType={index === 0 ? 'oneTimeCode' : 'none'}
|
|
282
|
+
accessibilityLabel={`Digit ${index + 1} of ${digits}`}
|
|
283
|
+
onChangeText={(text) => onDigitChange(index, text)}
|
|
284
|
+
onKeyPress={(event) => onKeyPress(index, event)}
|
|
285
|
+
onFocus={() => setFocusedIndex(index)}
|
|
286
|
+
onBlur={() => setFocusedIndex((current) => (current === index ? null : current))}
|
|
287
|
+
style={styles.hiddenInput}
|
|
288
|
+
/>
|
|
289
|
+
</View>
|
|
290
|
+
</View>
|
|
291
|
+
))}
|
|
292
|
+
</View>
|
|
293
|
+
|
|
294
|
+
<HintError hint={hint} error={error} />
|
|
295
|
+
</View>
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const styles = StyleSheet.create({
|
|
300
|
+
host: {
|
|
301
|
+
flexDirection: 'column',
|
|
302
|
+
alignItems: 'flex-start',
|
|
303
|
+
alignSelf: 'center',
|
|
304
|
+
maxWidth: '100%',
|
|
305
|
+
gap: spacing.sm + spacing.xs,
|
|
306
|
+
},
|
|
307
|
+
label: {
|
|
308
|
+
color: colors.gray.darker,
|
|
309
|
+
fontWeight: typography.fontWeight.medium,
|
|
310
|
+
lineHeight: typography.fontSize.sm * typography.lineHeight.normal,
|
|
311
|
+
},
|
|
312
|
+
row: {
|
|
313
|
+
flexDirection: 'row',
|
|
314
|
+
alignItems: 'center',
|
|
315
|
+
flexWrap: 'nowrap',
|
|
316
|
+
maxWidth: '100%',
|
|
317
|
+
},
|
|
318
|
+
cellGroup: {
|
|
319
|
+
flexDirection: 'row',
|
|
320
|
+
alignItems: 'center',
|
|
321
|
+
},
|
|
322
|
+
box: {
|
|
323
|
+
borderWidth: borders.width.thin,
|
|
324
|
+
borderColor: colors.gray.base,
|
|
325
|
+
borderRadius: radius.md,
|
|
326
|
+
backgroundColor: colors.white,
|
|
327
|
+
alignItems: 'center',
|
|
328
|
+
justifyContent: 'center',
|
|
329
|
+
overflow: 'hidden',
|
|
330
|
+
},
|
|
331
|
+
digitLayer: {
|
|
332
|
+
...StyleSheet.absoluteFillObject,
|
|
333
|
+
alignItems: 'center',
|
|
334
|
+
justifyContent: 'center',
|
|
335
|
+
},
|
|
336
|
+
digitRow: {
|
|
337
|
+
flexDirection: 'row',
|
|
338
|
+
alignItems: 'center',
|
|
339
|
+
},
|
|
340
|
+
digit: {
|
|
341
|
+
fontFamily: typography.fontFamily.base,
|
|
342
|
+
fontWeight: typography.fontWeight.medium,
|
|
343
|
+
color: colors.blackSoft,
|
|
344
|
+
letterSpacing: -0.4,
|
|
345
|
+
textAlign: 'center',
|
|
346
|
+
includeFontPadding: false,
|
|
347
|
+
},
|
|
348
|
+
placeholder: {
|
|
349
|
+
color: colors.gray.base,
|
|
350
|
+
},
|
|
351
|
+
caret: {
|
|
352
|
+
width: borders.width.thin,
|
|
353
|
+
marginLeft: spacing.xs,
|
|
354
|
+
backgroundColor: colors.blackSoft,
|
|
355
|
+
borderRadius: borders.width.thin,
|
|
356
|
+
},
|
|
357
|
+
caretCenter: {
|
|
358
|
+
position: 'absolute',
|
|
359
|
+
left: '50%',
|
|
360
|
+
marginLeft: spacing.none,
|
|
361
|
+
},
|
|
362
|
+
hiddenInput: {
|
|
363
|
+
...StyleSheet.absoluteFillObject,
|
|
364
|
+
opacity: 0,
|
|
365
|
+
padding: spacing.none,
|
|
366
|
+
},
|
|
367
|
+
separator: {
|
|
368
|
+
fontFamily: typography.fontFamily.base,
|
|
369
|
+
fontWeight: typography.fontWeight.medium,
|
|
370
|
+
color: colors.gray.base,
|
|
371
|
+
textAlign: 'center',
|
|
372
|
+
letterSpacing: -0.4,
|
|
373
|
+
},
|
|
374
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export * from './theme';
|
|
2
|
+
|
|
3
|
+
export * from './components/ActionsMenu';
|
|
4
|
+
export * from './components/Alert';
|
|
5
|
+
export * from './components/Badge';
|
|
6
|
+
export * from './components/Breadcrumb';
|
|
7
|
+
export * from './components/Button';
|
|
8
|
+
export * from './components/Checkbox';
|
|
9
|
+
export * from './components/CreatePassword';
|
|
10
|
+
export * from './components/DataTable';
|
|
11
|
+
export * from './components/Datepicker';
|
|
12
|
+
export * from './components/Dropdown';
|
|
13
|
+
export * from './components/DropdownMenu';
|
|
14
|
+
export * from './components/DynamicForm';
|
|
15
|
+
export * from './components/ErrorPages';
|
|
16
|
+
export * from './components/ForgotPassword';
|
|
17
|
+
export * from './components/HintError';
|
|
18
|
+
export * from './components/Icon';
|
|
19
|
+
export * from './components/InputDropdown';
|
|
20
|
+
export * from './components/InputField';
|
|
21
|
+
export * from './components/Label';
|
|
22
|
+
export * from './components/LoginForm';
|
|
23
|
+
export * from './components/LoginShell';
|
|
24
|
+
export * from './components/Modals';
|
|
25
|
+
export * from './components/Offcanvas';
|
|
26
|
+
export * from './components/PageHeader';
|
|
27
|
+
export * from './components/Pagination';
|
|
28
|
+
export * from './components/ResetPassword';
|
|
29
|
+
export * from './components/RoleSelection';
|
|
30
|
+
export * from './components/SendOtp';
|
|
31
|
+
export * from './components/Sidenavbar';
|
|
32
|
+
export * from './components/StatCard';
|
|
33
|
+
export * from './components/Tabs';
|
|
34
|
+
export * from './components/Textarea';
|
|
35
|
+
export * from './components/Timepicker';
|
|
36
|
+
export * from './components/Toast';
|
|
37
|
+
export * from './components/Toggle';
|
|
38
|
+
export * from './components/Typeahead';
|
|
39
|
+
export * from './components/Verification';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const borders = {
|
|
2
|
+
width: {
|
|
3
|
+
none: 0,
|
|
4
|
+
thin: 1,
|
|
5
|
+
medium: 2,
|
|
6
|
+
thick: 4,
|
|
7
|
+
},
|
|
8
|
+
style: {
|
|
9
|
+
solid: 'solid' as const,
|
|
10
|
+
dashed: 'dashed' as const,
|
|
11
|
+
none: 'none' as const,
|
|
12
|
+
},
|
|
13
|
+
focusRing: {
|
|
14
|
+
width: 2,
|
|
15
|
+
offset: 0,
|
|
16
|
+
},
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export type Borders = typeof borders;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const button = {
|
|
2
|
+
height: {
|
|
3
|
+
sm: 36,
|
|
4
|
+
md: 44,
|
|
5
|
+
lg: 48,
|
|
6
|
+
xl: 56,
|
|
7
|
+
},
|
|
8
|
+
paddingY: {
|
|
9
|
+
sm: 4,
|
|
10
|
+
md: 6,
|
|
11
|
+
lg: 8,
|
|
12
|
+
xl: 10,
|
|
13
|
+
},
|
|
14
|
+
paddingX: {
|
|
15
|
+
sm: 8,
|
|
16
|
+
md: 12,
|
|
17
|
+
lg: 16,
|
|
18
|
+
xl: 20,
|
|
19
|
+
},
|
|
20
|
+
fontSize: {
|
|
21
|
+
sm: 14,
|
|
22
|
+
md: 15,
|
|
23
|
+
lg: 16,
|
|
24
|
+
xl: 18,
|
|
25
|
+
},
|
|
26
|
+
lineHeight: {
|
|
27
|
+
sm: 20,
|
|
28
|
+
md: 22,
|
|
29
|
+
lg: 24,
|
|
30
|
+
xl: 24,
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
sm: 16,
|
|
34
|
+
md: 18,
|
|
35
|
+
lg: 20,
|
|
36
|
+
xl: 22,
|
|
37
|
+
},
|
|
38
|
+
minTouch: 44,
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
export type Button = typeof button;
|