@bigbinary/neetoui-rn 1.0.0 → 2.0.1
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/assets/fonts/SFProText-Bold.ttf +0 -0
- package/assets/fonts/SFProText-Medium.ttf +0 -0
- package/assets/fonts/SFProText-Regular.ttf +0 -0
- package/assets/fonts/SFProText-Semibold.ttf +0 -0
- package/assets/icons/apple-logo.svg +3 -0
- package/assets/icons/error.svg +4 -0
- package/assets/icons/expand.svg +5 -0
- package/assets/icons/google-logo.svg +6 -0
- package/assets/icons/info.svg +7 -0
- package/assets/icons/minimize.svg +6 -0
- package/assets/icons/reply.svg +5 -0
- package/assets/icons/success.svg +3 -0
- package/assets/icons/warning.svg +5 -0
- package/assets/images/image-placeholder.svg +4 -0
- package/components/Accordion.js +1 -0
- package/components/ActionIcon.js +1 -0
- package/components/Alert.js +1 -0
- package/components/AnimatedImage.js +1 -0
- package/components/Avatar.js +1 -0
- package/components/Badge.js +1 -0
- package/components/BottomSheet.js +1 -0
- package/components/BottomTabBar.js +1 -0
- package/components/Button.js +1 -0
- package/components/ButtonGroup.js +1 -0
- package/components/Calendar.js +1 -0
- package/components/Card.js +1 -0
- package/components/Carousel.js +1 -0
- package/components/ChatInput/AttachmentsView.js +1 -0
- package/components/ChatInput/Badge.js +1 -0
- package/components/ChatInput/ChatInput.js +1 -0
- package/components/ChatInput/EmailFields.js +1 -0
- package/components/ChatInput/IconButton.js +1 -0
- package/components/ChatInput/MentionsInputWrapper.js +1 -0
- package/components/CheckBox.js +1 -0
- package/components/Chip.js +1 -0
- package/components/Container.js +1 -0
- package/components/Divider.js +1 -0
- package/components/FAB.js +1 -0
- package/components/FlashList.js +1 -0
- package/components/FlatList.js +1 -0
- package/components/Input.js +1 -0
- package/components/InputEmailChip.js +1 -0
- package/components/LineLoader.js +1 -0
- package/components/ListItem.js +1 -0
- package/components/Loader.js +1 -0
- package/components/MultiSelect.js +1 -0
- package/components/NotificationIcon.js +1 -0
- package/components/NotificationPreferenceList.js +1 -0
- package/components/OnBoarding.js +1 -0
- package/components/OrganizationItem.js +1 -0
- package/components/OtpInputs.js +1 -0
- package/components/ParentView.js +1 -0
- package/components/Popover.js +1 -0
- package/components/RadioButton.js +1 -0
- package/components/RichTextEditor.js +1 -0
- package/components/Ripple.js +1 -0
- package/components/ScrollView.js +1 -0
- package/components/SearchBar.js +1 -0
- package/components/SegmentedTopBar/Indicator.js +1 -0
- package/components/SegmentedTopBar/Tab.js +1 -0
- package/components/SegmentedTopBar/index.js +1 -0
- package/components/SocialButton.js +1 -0
- package/components/Toast.js +1 -0
- package/components/ToggleSwitch.js +1 -0
- package/components/TopBar.js +1 -0
- package/components/Touchable.js +1 -0
- package/components/TouchableWithoutFeedback.js +1 -0
- package/components/Typography.js +1 -0
- package/components/index.js +1 -0
- package/config/index.js +1 -0
- package/config/toasterConfig.js +1 -0
- package/contexts/index.js +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useDebounce.js +1 -0
- package/hooks/useKeyboard.js +1 -0
- package/hooks/useRefreshByUser.js +1 -0
- package/index.d.ts +630 -0
- package/index.js +1 -0
- package/package.json +2 -8
- package/react-native.config.js +10 -0
- package/theme/index.js +1 -0
- package/utils/index.js +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Carousel from "react-native-snap-carousel";
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
|
+
import RNPopover from "react-native-popover-view";
|
|
5
|
+
import {
|
|
6
|
+
FlexboxProps,
|
|
7
|
+
SpaceProps,
|
|
8
|
+
BorderProps,
|
|
9
|
+
ColorProps,
|
|
10
|
+
LayoutProps,
|
|
11
|
+
PositionProps,
|
|
12
|
+
ButtonStyleProps,
|
|
13
|
+
TypographyProps as SSTypographyProps,
|
|
14
|
+
} from "styled-system";
|
|
15
|
+
import {
|
|
16
|
+
ImageProps as RNImageProps,
|
|
17
|
+
ViewProps as RNViewProps,
|
|
18
|
+
TextInputProps as RNTextInputProps,
|
|
19
|
+
ScrollViewProps as RNScrollViewProps,
|
|
20
|
+
FlatListProps as RNFlatListProps,
|
|
21
|
+
TextProps as RNTextProps,
|
|
22
|
+
TextInputAndroidProps as RNTextInputAndroidProps,
|
|
23
|
+
TextInputIOSProps as RNTextInputIOSProps,
|
|
24
|
+
ViewStyle,
|
|
25
|
+
TextStyle,
|
|
26
|
+
TouchableOpacityProps as RNTouchableOpacityProps,
|
|
27
|
+
} from "react-native";
|
|
28
|
+
import { ModalProps } from "react-native-modal";
|
|
29
|
+
import { BottomTabBarProps } from "@react-navigation/bottom-tabs";
|
|
30
|
+
import { CalendarProps as RNCalendarProps } from "react-native-calendars";
|
|
31
|
+
import { FlashListProps as RNFlashListProps } from "@shopify/flash-list";
|
|
32
|
+
import {
|
|
33
|
+
RichEditorProps,
|
|
34
|
+
RichToolbarProps,
|
|
35
|
+
} from "react-native-pell-rich-editor";
|
|
36
|
+
import { MaterialTopTabBarProps } from "@react-navigation/material-top-tabs";
|
|
37
|
+
import {
|
|
38
|
+
ToastProps as RNToastProps,
|
|
39
|
+
ToastHideParams,
|
|
40
|
+
ToastShowParams,
|
|
41
|
+
ToastConfig,
|
|
42
|
+
} from "react-native-toast-message";
|
|
43
|
+
import { FastImageProps } from "react-native-fast-image";
|
|
44
|
+
|
|
45
|
+
import { theme as themeDef } from "./src/theme";
|
|
46
|
+
import { BUTTON_VARIANTS } from "./src/components/Button";
|
|
47
|
+
|
|
48
|
+
type addPrefixToObject<
|
|
49
|
+
TObject extends object,
|
|
50
|
+
TPrefix extends string
|
|
51
|
+
> = `${TPrefix}${keyof TObject}`;
|
|
52
|
+
|
|
53
|
+
const theme: {
|
|
54
|
+
colors: {
|
|
55
|
+
font: addPrefixToObject<typeof themeDef.colors.font, "font.">;
|
|
56
|
+
background: addPrefixToObject<
|
|
57
|
+
typeof themeDef.colors.background,
|
|
58
|
+
"background."
|
|
59
|
+
>;
|
|
60
|
+
border: addPrefixToObject<typeof themeDef.colors.border, "border.">;
|
|
61
|
+
toast: addPrefixToObject<typeof themeDef.colors.toast, "toast.">;
|
|
62
|
+
};
|
|
63
|
+
fonts: keyof typeof themeDef.fonts;
|
|
64
|
+
fontSizes: keyof typeof themeDef.fontSizes;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
interface StyleProps
|
|
68
|
+
extends FlexboxProps,
|
|
69
|
+
SpaceProps,
|
|
70
|
+
BorderProps,
|
|
71
|
+
ColorProps,
|
|
72
|
+
LayoutProps,
|
|
73
|
+
PositionProps {
|
|
74
|
+
borderColor?: typeof theme.colors.border;
|
|
75
|
+
borderTopColor?: typeof theme.colors.border;
|
|
76
|
+
borderBottomColor?: typeof theme.colors.border;
|
|
77
|
+
borderLeftColor?: typeof theme.colors.border;
|
|
78
|
+
borderRightColor?: typeof theme.colors.border;
|
|
79
|
+
backgroundColor?: typeof theme.colors.background;
|
|
80
|
+
bg?: typeof theme.colors.background;
|
|
81
|
+
color?: typeof theme.colors.font;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface TypographyProps extends SSTypographyProps {
|
|
85
|
+
fontFamily?: typeof theme.fonts;
|
|
86
|
+
fontSize?: typeof theme.fontSizes;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface ViewProps extends RNViewProps, StyleProps {
|
|
90
|
+
children?: React.ReactNode;
|
|
91
|
+
}
|
|
92
|
+
interface TextProps extends RNTextProps, StyleProps, TypographyProps {
|
|
93
|
+
children?: React.ReactNode;
|
|
94
|
+
}
|
|
95
|
+
interface TextInputProps
|
|
96
|
+
extends RNTextInputAndroidProps,
|
|
97
|
+
RNTextInputIOSProps,
|
|
98
|
+
StyleProps,
|
|
99
|
+
TypographyProps {}
|
|
100
|
+
interface FlatListProps extends RNFlatListProps, StyleProps {}
|
|
101
|
+
interface ScrollViewProps extends RNScrollViewProps, StyleProps {}
|
|
102
|
+
interface TouchableOpacityProps
|
|
103
|
+
extends RNTouchableOpacityProps,
|
|
104
|
+
StyleProps,
|
|
105
|
+
ButtonStyleProps {
|
|
106
|
+
children?: React.ReactNode;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface RipplePropTypes {
|
|
110
|
+
isCentered?: boolean;
|
|
111
|
+
isSequential?: boolean;
|
|
112
|
+
shouldFade?: boolean;
|
|
113
|
+
shouldOverflowContainer?: boolean;
|
|
114
|
+
color?: string;
|
|
115
|
+
opacity?: number;
|
|
116
|
+
duration?: number;
|
|
117
|
+
size?: number;
|
|
118
|
+
containerBorderRadius?: number;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface TouchableProps extends StyleProps, ButtonStyleProps {
|
|
122
|
+
children?: React.ReactNode;
|
|
123
|
+
rippleConfig?: RipplePropTypes;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface AccordionProps extends ViewProps {
|
|
127
|
+
header?: () => React.ReactNode;
|
|
128
|
+
headerContainerProps?: TouchableOpacityProps;
|
|
129
|
+
noBorder?: boolean;
|
|
130
|
+
onStateChanged?: (isExpanded: boolean) => void;
|
|
131
|
+
iconProp?: {
|
|
132
|
+
Label?: () => React.ReactNode;
|
|
133
|
+
size?: number;
|
|
134
|
+
color?: string;
|
|
135
|
+
};
|
|
136
|
+
position?: "top" | "bottom";
|
|
137
|
+
shouldShowToggle?: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type AlertProps = {};
|
|
141
|
+
type AlertButton = {
|
|
142
|
+
label: string;
|
|
143
|
+
onPress?: () => void;
|
|
144
|
+
variant?: typeof BUTTON_VARIANTS[keyof typeof BUTTON_VARIANTS];
|
|
145
|
+
};
|
|
146
|
+
type AlertShowParams = {
|
|
147
|
+
title?: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
isCancelable?: boolean;
|
|
150
|
+
onDismiss?: () => void;
|
|
151
|
+
buttons?: Array<AlertButton>;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
interface AnimatedImageProps extends RNImageProps, FastImageProps {
|
|
155
|
+
imageHeight?: number;
|
|
156
|
+
imageWidth?: number;
|
|
157
|
+
imageUrl: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface AvatarProps extends ViewProps {
|
|
161
|
+
name?: string;
|
|
162
|
+
variant?: "extra-small" | "small" | "medium";
|
|
163
|
+
bgColor?: typeof theme.colors.background;
|
|
164
|
+
fontColor?: typeof theme.colors.font;
|
|
165
|
+
imageUrl?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface BadgeProps extends ViewProps {
|
|
169
|
+
badgeColor?: typeof theme.colors.background;
|
|
170
|
+
content?: string | number;
|
|
171
|
+
size?: number;
|
|
172
|
+
fontSize?: typeof theme.fontSizes;
|
|
173
|
+
fontFamily?: typeof theme.fonts;
|
|
174
|
+
color?: typeof theme.colors.font;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface BottomSheetProps extends ViewProps {
|
|
178
|
+
showCreateOption?: boolean;
|
|
179
|
+
CreateItemComponent?: React.FC;
|
|
180
|
+
showCreateOptionLoader?: boolean;
|
|
181
|
+
createSearchedOptionLabelStyle?: TextProps;
|
|
182
|
+
createOptionLabel?: string;
|
|
183
|
+
onPressCreateOption?: (searchText: string) => void;
|
|
184
|
+
createSearchedOptionContainerStyle?: TouchableProps;
|
|
185
|
+
data?: Array<any>;
|
|
186
|
+
title?: string;
|
|
187
|
+
hide?: () => void;
|
|
188
|
+
isVisible?: boolean;
|
|
189
|
+
onItemPress?: ({ index, item }: { index: number; item: any }) => void;
|
|
190
|
+
selectedItem?: object | string;
|
|
191
|
+
bg?: typeof theme.colors.background;
|
|
192
|
+
titleContainerStyle?: ViewProps;
|
|
193
|
+
titleTextStyle?: TextProps;
|
|
194
|
+
modalParams?: ModalProps;
|
|
195
|
+
HeaderComponent?: () => React.ReactNode;
|
|
196
|
+
ContentRow?: () => React.ReactNode;
|
|
197
|
+
contentType?: "checkbox" | null;
|
|
198
|
+
canSearch?: boolean;
|
|
199
|
+
onDonePress?: () => void;
|
|
200
|
+
valueExtractor?: () => {};
|
|
201
|
+
labelExtractor?: () => {};
|
|
202
|
+
searchBarProps?: SearchBarProps;
|
|
203
|
+
onBackdropPress?: () => void;
|
|
204
|
+
disabled?: boolean;
|
|
205
|
+
noResultsLabelContainerStyle?: ViewProps;
|
|
206
|
+
noResultsLabelStyle?: TextProps;
|
|
207
|
+
noResultsLabel?: string;
|
|
208
|
+
NoResultsComponent?: () => React.ReactNode;
|
|
209
|
+
shouldHideKeyboardOnScrollBegin?: boolean;
|
|
210
|
+
shouldShowItemSeparator?: boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface ButtonProps extends TouchableProps {
|
|
214
|
+
variant?: typeof BUTTON_VARIANTS[keyof typeof BUTTON_VARIANTS];
|
|
215
|
+
label: string;
|
|
216
|
+
labelStyle?: TextProps;
|
|
217
|
+
RightIcon?: () => React.ReactNode;
|
|
218
|
+
LeftIcon?: () => React.ReactNode;
|
|
219
|
+
disabled?: boolean;
|
|
220
|
+
isLoading?: boolean;
|
|
221
|
+
loadingText?: string;
|
|
222
|
+
fontFamily?: typeof theme.fonts;
|
|
223
|
+
color?: typeof theme.colors;
|
|
224
|
+
fontSize?: typeof theme.fontSizes;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
type ButtonGroupProps = {
|
|
228
|
+
activeColor?: typeof theme.colors[keyof typeof theme.colors];
|
|
229
|
+
inActiveColor?: typeof theme.colors[keyof typeof theme.colors];
|
|
230
|
+
buttonItems: Array<string>;
|
|
231
|
+
onPress: () => void;
|
|
232
|
+
currentActiveBtn: string;
|
|
233
|
+
wrapperStyle?: ViewProps;
|
|
234
|
+
buttonTextStyle?: TextProps;
|
|
235
|
+
buttonStyle?: TouchableProps;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
interface CalendarProps extends RNCalendarProps {
|
|
239
|
+
selectedDate?: string | typeof dayjs;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface CardProps extends TouchableOpacityProps, StyleProps {
|
|
243
|
+
elevation?: number;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
type CarouselProps = {
|
|
247
|
+
itemArray: Array<any>;
|
|
248
|
+
renderItem: () => React.ReactNode;
|
|
249
|
+
carouselRef?: React.RefObject<Carousel>;
|
|
250
|
+
onSnapToItem?: (index: number) => void;
|
|
251
|
+
containerStyle: ViewProps;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
interface CheckBoxProps extends TouchableProps {
|
|
255
|
+
checked: boolean;
|
|
256
|
+
onSelect: () => void;
|
|
257
|
+
disabled?: boolean;
|
|
258
|
+
label?: string;
|
|
259
|
+
checkIconStyle?: any;
|
|
260
|
+
labelStyle?: TextProps;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
type ChipProps = {
|
|
264
|
+
label: string;
|
|
265
|
+
LeftIcon?: React.FC;
|
|
266
|
+
variant?: "outlined" | "solid";
|
|
267
|
+
labelColor?: typeof theme.colors.font;
|
|
268
|
+
closeIconBackground?: typeof theme.colors.background;
|
|
269
|
+
closeIconColor?: string;
|
|
270
|
+
onClose?: () => void;
|
|
271
|
+
onChipPress?: () => void;
|
|
272
|
+
isDisabled?: disabled;
|
|
273
|
+
closeIconSize?: number;
|
|
274
|
+
closeIcon?: string;
|
|
275
|
+
containerStyle?: TouchableProps;
|
|
276
|
+
closeIconContainerStyle?: TouchableProps;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
interface DividerProps extends ViewProps {
|
|
280
|
+
thickness?: number | string;
|
|
281
|
+
orientation?: "horizontal" | "vertical";
|
|
282
|
+
bg?: typeof theme.colors.background;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface FabProps extends TouchableProps {
|
|
286
|
+
Icon: React.FC;
|
|
287
|
+
bg: typeof theme.colors.background;
|
|
288
|
+
disabled?: boolean;
|
|
289
|
+
variant?: "solid" | "inverse";
|
|
290
|
+
onPress: () => void;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
interface FlashListProps extends RNFlashListProps {
|
|
294
|
+
SkeletonComponent?: React.FC;
|
|
295
|
+
animationDuration?: number;
|
|
296
|
+
data: Array<any>;
|
|
297
|
+
isLoading?: boolean;
|
|
298
|
+
placeHolderItemCount?: number;
|
|
299
|
+
onRefresh?: () => void;
|
|
300
|
+
onEndReached?: () => void;
|
|
301
|
+
keyExtractor?: (item: any, index: number) => string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
type InputProps = {
|
|
305
|
+
label?: string;
|
|
306
|
+
value: string;
|
|
307
|
+
onChangeText: (val: string) => void;
|
|
308
|
+
onBlur?: () => void;
|
|
309
|
+
errorMessage?: string;
|
|
310
|
+
PrefixIcon?: React.FC;
|
|
311
|
+
SuffixIcon?: React.FC;
|
|
312
|
+
autoFocus?: boolean;
|
|
313
|
+
disabled?: boolean;
|
|
314
|
+
noBorder?: boolean;
|
|
315
|
+
showInputAccessoryView?: boolean;
|
|
316
|
+
inputProps?: RNTextInputProps;
|
|
317
|
+
textAlignVertical?: string;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
type ChatInputProps = {
|
|
321
|
+
isLoading?: boolean;
|
|
322
|
+
shouldShowEmailFields?: boolean;
|
|
323
|
+
value: string;
|
|
324
|
+
initialSelectedOption?: "REPLY" | "NOTE" | "FORWARD";
|
|
325
|
+
onOptionChange?: (option: string) => void;
|
|
326
|
+
onChangeText: (text: string) => void;
|
|
327
|
+
onForward?: () => void;
|
|
328
|
+
onCannedResponse?: () => void;
|
|
329
|
+
toEmails?: string;
|
|
330
|
+
onReply?: () => void;
|
|
331
|
+
onAddNote?: () => void;
|
|
332
|
+
onAttachment?: () => void;
|
|
333
|
+
attachmentsCount?: number;
|
|
334
|
+
Attachments?: React.FC;
|
|
335
|
+
showCannedResponsesFor?: Array<"REPLY" | "NOTE" | "FORWARD">;
|
|
336
|
+
showSuggestionsFor?: Array<"REPLY" | "NOTE" | "FORWARD">;
|
|
337
|
+
disabled?: boolean;
|
|
338
|
+
suggestions: Array<{
|
|
339
|
+
name: string;
|
|
340
|
+
imageUrl: string;
|
|
341
|
+
id: string;
|
|
342
|
+
}>;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
type LineLoaderProps = {
|
|
346
|
+
backgroundColor?: string;
|
|
347
|
+
foregroundColor?: string;
|
|
348
|
+
height?: number;
|
|
349
|
+
isLoading?: boolean;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
type InputEmailChipProps = {
|
|
353
|
+
disabled?: boolean;
|
|
354
|
+
label?: string;
|
|
355
|
+
emails?: Array<string>;
|
|
356
|
+
delimiters?: Array<string>;
|
|
357
|
+
onUpdate?: (emails: Array<string>) => void;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
interface ListItemProps extends ViewProps {
|
|
361
|
+
LeftComponent?: React.FC;
|
|
362
|
+
label: string;
|
|
363
|
+
RightComponent: React.FC;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
interface LoaderProps extends ViewProps {
|
|
367
|
+
size?: "s" | "m" | "l";
|
|
368
|
+
color: typeof theme.colors.background;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
type NotificationPreferenceListItem = {
|
|
372
|
+
label: string;
|
|
373
|
+
enabled: boolean;
|
|
374
|
+
onSwitch: (item: any, index: number) => void;
|
|
375
|
+
LeftIcon?: React.FC;
|
|
376
|
+
};
|
|
377
|
+
interface NotificationPreferenceListProps extends ViewProps {
|
|
378
|
+
data: Array<NotificationPreferenceListItem>;
|
|
379
|
+
itemWrapperProps?: ViewProps;
|
|
380
|
+
itemContainerProps?: ViewProps;
|
|
381
|
+
labelContainerProps?: ViewProps;
|
|
382
|
+
labelProps?: TypographyProps;
|
|
383
|
+
title?: string;
|
|
384
|
+
titleProps?: TypographyProps;
|
|
385
|
+
isLoading?: boolean;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
interface MultiSelectConfirmationAlertObjProps {
|
|
389
|
+
alertTitle?: string;
|
|
390
|
+
alertDescription?: string;
|
|
391
|
+
alertConfirmButtonLabel?: string;
|
|
392
|
+
showDeleteAlertConfirmation?: boolean;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
interface MultiSelectProps extends ViewProps {
|
|
396
|
+
options?: Array<any>;
|
|
397
|
+
label?: string;
|
|
398
|
+
value?: string | Array<any>;
|
|
399
|
+
labelExtractor?: (item: any, index: number) => string;
|
|
400
|
+
valueExtractor?: (item: any, index: number) => string;
|
|
401
|
+
onSelect?: (selectedData: Array<any>) => void;
|
|
402
|
+
deletedValue?: (deletedOption: any) => void;
|
|
403
|
+
isLoading?: boolean;
|
|
404
|
+
isSearchable?: boolean;
|
|
405
|
+
showCreateOption?: boolean;
|
|
406
|
+
labelStyle?: TextProps;
|
|
407
|
+
containerStyle?: ViewProps;
|
|
408
|
+
inputContainerStyle?: ViewProps;
|
|
409
|
+
dropdownContainerStyle?: ViewProps;
|
|
410
|
+
itemContainerStyle?: ViewProps;
|
|
411
|
+
multiSelectedItemContainerStyle?: ViewProps;
|
|
412
|
+
multiSelectedItemLabelStyle?: TextProps;
|
|
413
|
+
selectedValue?: (selectedOption: any) => void;
|
|
414
|
+
CreateItemComponent?: React.FC;
|
|
415
|
+
showCreateOptionLoader?: boolean;
|
|
416
|
+
createSearchedOptionLabelStyle?: TextProps;
|
|
417
|
+
onPressCreateOption?: (searchText: string) => void;
|
|
418
|
+
createSearchedOptionContainerStyle?: ViewProps;
|
|
419
|
+
onDonePress?: () => void;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
noResultsLabelContainerStyle?: ViewStyle;
|
|
422
|
+
noResultsLabelStyle?: TextStyle;
|
|
423
|
+
noResultsLabel?: TypographyProps;
|
|
424
|
+
NoResultsComponent?: React.ReactNode;
|
|
425
|
+
maxItemSize?: number;
|
|
426
|
+
moreItemLabelContainerStyle?: ViewStyle;
|
|
427
|
+
moreItemLabelStyle?: TextStyle;
|
|
428
|
+
MoreItemComponent?: () => React.ReactNode;
|
|
429
|
+
onBackdropPress?: () => void;
|
|
430
|
+
searchbarProps?: SearchBarProps;
|
|
431
|
+
confirmationAlertObj?: MultiSelectConfirmationAlertObjProps;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
type OnBoardingProps = {
|
|
435
|
+
appLogo: React.FC;
|
|
436
|
+
slides: Array<any>;
|
|
437
|
+
onComplete: () => void;
|
|
438
|
+
logoWidth?: number;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
interface OrganizationItemProps extends ViewProps {
|
|
442
|
+
label?: string;
|
|
443
|
+
labelContainerProps?: ViewProps;
|
|
444
|
+
iconContainerProps?: ViewProps;
|
|
445
|
+
iconProps?: { size: number; color: typeof theme.colors.font; name: string };
|
|
446
|
+
labelProps?: TypographyProps;
|
|
447
|
+
name: string;
|
|
448
|
+
nameProps?: TypographyProps;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
type OtpInputsProps = {
|
|
452
|
+
handleChange: (value: string) => void;
|
|
453
|
+
numberOfInputs: number;
|
|
454
|
+
error?: boolean;
|
|
455
|
+
code: string;
|
|
456
|
+
containerStyles?: ViewProps;
|
|
457
|
+
textStyles?: TextProps;
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
interface ParentViewProps extends ViewProps {
|
|
461
|
+
barStyle?: "light-content" | "dark-content";
|
|
462
|
+
topInset?: boolean;
|
|
463
|
+
rightInset?: boolean;
|
|
464
|
+
leftInset?: boolean;
|
|
465
|
+
bottomInset?: boolean;
|
|
466
|
+
shouldDismissKeyboardOnTap?: boolean;
|
|
467
|
+
backgroundColor?: string;
|
|
468
|
+
bg?: string;
|
|
469
|
+
}
|
|
470
|
+
interface PopOverItemNestedItemProps {
|
|
471
|
+
Icon?: React.FC;
|
|
472
|
+
label?: string;
|
|
473
|
+
labelProps?: TypographyProps;
|
|
474
|
+
}
|
|
475
|
+
interface PopoverItemProps {
|
|
476
|
+
item?: PopOverItemNestedItemProps;
|
|
477
|
+
onPress?: () => void;
|
|
478
|
+
fontFamily?: typeof theme.fonts;
|
|
479
|
+
fontSize?: typeof theme.fontSizes;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
type RNPopoverProps = typeof RNPopover.propTypes;
|
|
483
|
+
interface PopoverProps extends RNPopoverProps {
|
|
484
|
+
children?: React.ReactNode;
|
|
485
|
+
data?: Array<PopoverItemProps>;
|
|
486
|
+
fontFamily?: typeof theme.fonts;
|
|
487
|
+
fontSize?: typeof theme.fontSizes;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface RadioButtonProps extends TouchableProps {
|
|
491
|
+
selected: boolean;
|
|
492
|
+
onSelect: () => void;
|
|
493
|
+
disabled?: boolean;
|
|
494
|
+
label?: string;
|
|
495
|
+
radioButtonStyle?: ViewProps;
|
|
496
|
+
labelStyle?: TextProps;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
type RichTextEditorProps = {
|
|
500
|
+
onChange: (val: string) => void;
|
|
501
|
+
placeholderText?: string;
|
|
502
|
+
children?: React.ReactNode;
|
|
503
|
+
toolbarActions: Array<string>;
|
|
504
|
+
editorProps?: RichEditorProps;
|
|
505
|
+
toolBarProps?: RichToolbarProps;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
interface SearchBarProps extends ViewProps {
|
|
509
|
+
placeholder?: string;
|
|
510
|
+
onChangeText: (val: string) => void;
|
|
511
|
+
onCancel?: () => void;
|
|
512
|
+
debounceDelay?: number | string;
|
|
513
|
+
showCancelButton?: boolean;
|
|
514
|
+
containerProps?: ViewProps;
|
|
515
|
+
searchbarProps?: TextInputProps;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
interface SegmentedTopBarStateProps {
|
|
519
|
+
routes?: Array<any>;
|
|
520
|
+
index?: number;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
interface NavigationProps {
|
|
524
|
+
navigation: NavigationScreenProp<NavigationState, NavigationParams>;
|
|
525
|
+
}
|
|
526
|
+
interface SegmentedTopBarProps extends MaterialTopTabBarProps {
|
|
527
|
+
state?: SegmentedTopBarStateProps;
|
|
528
|
+
navigation?: NavigationProps;
|
|
529
|
+
height?: number;
|
|
530
|
+
descriptors?: object;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
interface SocialButtonProps extends TouchableProps {
|
|
534
|
+
variant: "apple" | "google";
|
|
535
|
+
disabled?: boolean;
|
|
536
|
+
labelStyle?: TextProps;
|
|
537
|
+
isLoading?: boolean;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
interface ToastProps extends Omit<RNToastProps, "config" | "position"> {
|
|
541
|
+
toasterConfig: ToastConfig;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
type ToggleSwitchProps = {
|
|
545
|
+
value: boolean;
|
|
546
|
+
onValueChange?: () => void;
|
|
547
|
+
disabled?: boolean;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
type TopBarProps = {
|
|
551
|
+
data: Array<any>;
|
|
552
|
+
activeIndex?: number;
|
|
553
|
+
onActiveTabChange: () => void;
|
|
554
|
+
activeTabTextStyle?: TextStyle;
|
|
555
|
+
activeTabContainerStyle?: ViewStyle;
|
|
556
|
+
inActiveTabTextStyle?: TextStyle;
|
|
557
|
+
inActiveTabContainerStyle?: ViewStyle;
|
|
558
|
+
tabContainerStyle?: ViewStyle;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
type NotificationIconProps = {
|
|
562
|
+
unreadCount: number;
|
|
563
|
+
onPress: () => void;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
type ActionIconProps = {
|
|
567
|
+
isLoading: boolean;
|
|
568
|
+
icon: () => React.ReactNode;
|
|
569
|
+
onPress: () => void;
|
|
570
|
+
size: number;
|
|
571
|
+
color: typeof theme.colors.font;
|
|
572
|
+
disabled: boolean;
|
|
573
|
+
label?: string;
|
|
574
|
+
iconProps: {
|
|
575
|
+
size?: number;
|
|
576
|
+
color?: typeof theme.colors.font;
|
|
577
|
+
viewBox: string;
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
export const Accordion: React.FC<AccordionProps>;
|
|
582
|
+
export const ActionIcon: React.FC<ActionIconProps>;
|
|
583
|
+
export const Alert: React.FC<AlertProps> & {
|
|
584
|
+
show?: (params: AlertShowParams) => void;
|
|
585
|
+
};
|
|
586
|
+
export const AnimatedImage: React.FC<AnimatedImageProps>;
|
|
587
|
+
export const Avatar: React.FC<AvatarProps>;
|
|
588
|
+
export const Badge: React.FC<BadgeProps>;
|
|
589
|
+
export const BottomSheet: React.FC<BottomSheetProps>;
|
|
590
|
+
export const BottomTabBar: React.FC<BottomTabBarProps>;
|
|
591
|
+
export const Button: React.FC<ButtonProps>;
|
|
592
|
+
export const ButtonGroup: React.FC<ButtonGroupProps>;
|
|
593
|
+
export const Calendar: React.FC<CalendarProps>;
|
|
594
|
+
export const Card: React.FC<CardProps>;
|
|
595
|
+
export const Carousel: React.FC<CarouselProps>;
|
|
596
|
+
export const CheckBox: React.FC<CheckBoxProps>;
|
|
597
|
+
export const Chip: React.FC<ChipProps>;
|
|
598
|
+
export const Container: React.FC<ViewProps>;
|
|
599
|
+
export const Divider: React.FC<DividerProps>;
|
|
600
|
+
export const FAB: React.FC<FabProps>;
|
|
601
|
+
export const FlashList: React.FC<FlashListProps>;
|
|
602
|
+
export const FlatList: React.FC<FlatListProps>;
|
|
603
|
+
export const Input: React.FC<InputProps>;
|
|
604
|
+
export const InputEmailChip: React.FC<InputEmailChipProps>;
|
|
605
|
+
export const ChatInput: React.FC<ChatInputProps>;
|
|
606
|
+
export const LineLoader: React.FC<LineLoaderProps>;
|
|
607
|
+
export const ListItem: React.FC<ListItemProps>;
|
|
608
|
+
export const Loader: React.FC<LoaderProps>;
|
|
609
|
+
export const NotificationPreferenceList: React.FC<NotificationPreferenceListProps>;
|
|
610
|
+
export const NotificationIcon: React.FC<NotificationIconProps>;
|
|
611
|
+
export const MultiSelect: React.FC<MultiSelectProps>;
|
|
612
|
+
export const OnBoarding: React.FC<OnBoardingProps>;
|
|
613
|
+
export const OrganizationItem: React.FC<OrganizationItemProps>;
|
|
614
|
+
export const OtpInputs: React.FC<OtpInputsProps>;
|
|
615
|
+
export const ParentView: React.FC<ParentViewProps>;
|
|
616
|
+
export const Popover: React.FC<PopoverProps>;
|
|
617
|
+
export const RadioButton: React.FC<RadioButtonProps>;
|
|
618
|
+
export const RichTextEditor: React.FC<RichTextEditorProps>;
|
|
619
|
+
export const ScrollView: React.FC<ScrollViewProps>;
|
|
620
|
+
export const SearchBar: React.FC<SearchBarProps>;
|
|
621
|
+
export const SegmentedTopBar: React.FC<SegmentedTopBarProps>;
|
|
622
|
+
export const SocialButton: React.FC<SocialButtonProps>;
|
|
623
|
+
export const Toast: React.FC<ToastProps> & {
|
|
624
|
+
show?: (params: ToastShowParams) => void;
|
|
625
|
+
hide?: (params: ToastHideParams) => void;
|
|
626
|
+
};
|
|
627
|
+
export const ToggleSwitch: React.FC<ToggleSwitchProps>;
|
|
628
|
+
export const TopBar: React.FC<TopBarProps>;
|
|
629
|
+
export const Touchable: React.FC<TouchableProps>;
|
|
630
|
+
export const Typography: React.FC<TextProps>;
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _components=require("./components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _components[key];}});});var _theme=require("./theme");Object.keys(_theme).forEach(function(key){if(key==="default"||key==="__esModule")return;if(key in exports&&exports[key]===_theme[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _theme[key];}});});
|
package/package.json
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neetoui-rn",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"main": ".",
|
|
5
5
|
"author": "BigBinary",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The neetoUI-RN library drives the experience in all neeto product's React Native applications built at BigBinary.",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"react-native.config.js",
|
|
11
|
-
"index.d.ts",
|
|
12
|
-
"assets"
|
|
13
|
-
],
|
|
14
8
|
"peerDependencies": {
|
|
15
9
|
"react-native-device-info": "^10.3.0",
|
|
16
10
|
"react-native-reanimated": "3.6.0",
|
package/theme/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.theme=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _reactNativeSizeMatters=require("react-native-size-matters");var defaultColors={white:"#ffffff",base:"#008068",danger:"#D7373F",success:"#018d6d",menubackground:"#F6F6FA"};var toastBorderColors={success:"#00BA88",error:"#F56A58",info:"#276EF1",warning:"#F3CD82"};var greyVariants={grey:"#828282",grey100:"#f8f9f9",grey200:"#e9ebed",grey300:"#d8dcde",grey400:"#c2c8cc",grey500:"#87929d",grey600:"#68737d",grey700:"#2f3941",grey800:"#1f1f1f"};var darkBlueVariant={darkBlue100:"#0B4885"};var lightBlueVariants={lightBlue100:"#EAF3FC",lightBlue400:"#4558F9"};var purpleVariants={purple100:"#F2F4FF",purple200:"#ECF4FF",purple500:"#4557F8",purple700:"#342DF4"};var greenVariants={green500:"#34C759",green600:"#33C8A0",green700:"#00BA88",green800:"#00956D"};var colors={font:(0,_extends2.default)({primary:"#2F3941",secondary:"#49545C"},defaultColors,greyVariants,lightBlueVariants,darkBlueVariant,purpleVariants,greenVariants),background:(0,_extends2.default)({parentView:"#ffffff",primary:"#ffffff",secondary:"#F6F6FA",oldLace:"#FDF6E5"},defaultColors,greyVariants,lightBlueVariants,darkBlueVariant,purpleVariants,greenVariants),border:(0,_extends2.default)({primary:"#E9EBED",secondary:"#C2C8CC"},greyVariants,lightBlueVariants,darkBlueVariant,defaultColors,purpleVariants),toast:(0,_extends2.default)({},toastBorderColors)};var baseTheme={colors:colors,fonts:{sf400:"SFProText-Regular",sf500:"SFProText-Medium",sf600:"SFProText-Semibold",sf700:"SFProText-Bold"},lineHeights:[24],text:{primaryColor:colors.font.base,color:colors.font.base},fontSizes:{"4xs":(0,_reactNativeSizeMatters.moderateScale)(10),"3xs":(0,_reactNativeSizeMatters.moderateScale)(11),"2xs":(0,_reactNativeSizeMatters.moderateScale)(12),xs:(0,_reactNativeSizeMatters.moderateScale)(13),s:(0,_reactNativeSizeMatters.moderateScale)(14),m:(0,_reactNativeSizeMatters.moderateScale)(15),l:(0,_reactNativeSizeMatters.moderateScale)(16),xl:(0,_reactNativeSizeMatters.moderateScale)(17),"2xl":(0,_reactNativeSizeMatters.moderateScale)(18),"3xl":(0,_reactNativeSizeMatters.moderateScale)(20),"4xl":(0,_reactNativeSizeMatters.moderateScale)(22),"5xl":(0,_reactNativeSizeMatters.moderateScale)(30)},space:new Array(100).fill(0).map(function(_,index){return index+1;})};baseTheme.lineHeights.note=baseTheme.lineHeights[0]+"px";var theme=exports.theme=(0,_extends2.default)({},baseTheme,{textStyles:{defaultTextStyle:{color:baseTheme.colors.font.grey800,fontSize:baseTheme.fontSizes.s,fontFamily:baseTheme.fonts.sf400},header:{color:baseTheme.colors.font.primary,fontSize:baseTheme.fontSizes["3xl"],fontFamily:baseTheme.fonts.sf600},modalHeader:{color:baseTheme.colors.font.primary,fontSize:baseTheme.fontSizes["xl"],fontFamily:baseTheme.fonts.sf600},body:{color:baseTheme.colors.font.grey500,fontSize:baseTheme.fontSizes.s},subtext:{color:baseTheme.colors.font.primary,fontSize:baseTheme.fontSizes["2xs"]},solid:{color:baseTheme.colors.font.white},inverse:{color:baseTheme.colors.font.base},text:{primaryColor:baseTheme.colors.font.base,color:baseTheme.colors.font.base}},buttons:{solid:{border:2,borderColor:baseTheme.colors.background.base,backgroundColor:baseTheme.colors.background.base},inverse:{border:2,borderColor:baseTheme.colors.border.base,backgroundColor:baseTheme.colors.background.white},text:{color:baseTheme.colors.font.grey800,backgroundColor:baseTheme.colors.background.white}}});
|
package/utils/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.trimChars=exports.isValidEmail=exports.isAndroid=exports.getShadowStyles=exports.endsWithChars=exports.charsForRegex=void 0;var _reactNative=require("react-native");var shadowRadiusList=[1,1.41,2.22,2.62,3.84,4.65,4.65,4.65,5.46,6.27,6.68,7.49,8.3,9.11,9.51,10.32,11.14,11.95,12.35,13.16,13.97,14.78,15.19,16];var shadowOpacityList=[0.18,0.2,0.22,0.23,0.25,0.27,0.29,0.3,0.32,0.34,0.36,0.37,0.39,0.41,0.43,0.44,0.46,0.48,0.5,0.51,0.53,0.55,0.57,0.58];var getShadowStyles=exports.getShadowStyles=function getShadowStyles(){var elevation=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(elevation>24)elevation=24;return{shadowOffset:{width:0,height:Math.floor(elevation/2)},shadowRadius:shadowRadiusList[elevation-1],shadowOpacity:shadowOpacityList[elevation-1],elevation:elevation};};var isAndroid=exports.isAndroid=function isAndroid(){return _reactNative.Platform.OS==="android";};var isValidEmail=exports.isValidEmail=function isValidEmail(email){return String(email).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);};var charsForRegex=exports.charsForRegex=function charsForRegex(chars){return(chars==null?void 0:chars.join("|"))||"";};var endsWithChars=exports.endsWithChars=function endsWithChars(text,chars){var regex="("+charsForRegex(chars)+")$";return text.match(regex);};var trimChars=exports.trimChars=function trimChars(text,chars){var charsRegex=charsForRegex(chars);var startRegexPattern="^("+charsRegex+")+";var endRegexPattern="("+charsRegex+")+$";var startRegex=new RegExp(startRegexPattern);var endRegex=new RegExp(endRegexPattern);var trimmedText=text.replace(startRegex,"").replace(endRegex,"");return trimmedText;};
|