@holper/react-native-holper-storybook 0.6.101 → 0.7.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/.expo/README.md +8 -0
- package/.nvmrc +1 -0
- package/.prettierignore +5 -0
- package/.storybook/index.jsx +11 -0
- package/.storybook/main.js +8 -0
- package/.storybook/preview.jsx +51 -0
- package/.storybook/storybook.requires.js +43 -0
- package/.yarn/releases/yarn-4.5.0.cjs +925 -0
- package/.yarnrc.yml +3 -0
- package/App.jsx +29 -0
- package/LICENSE +21 -0
- package/{readme.md → README.md} +18 -19
- package/app.config.js +77 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/fonts/Poppins-Bold.ttf +0 -0
- package/assets/fonts/Poppins-Regular.ttf +0 -0
- package/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +7 -0
- package/build.sh +11 -0
- package/components/Button/index.tsx +66 -0
- package/{lib/components/Button/style.js → components/Button/style.ts} +8 -7
- package/components/Card/index.tsx +33 -0
- package/{lib/components/Card/style.js → components/Card/style.ts} +5 -4
- package/{lib/components/ConfirmationModal/index.js → components/ConfirmationModal/index.tsx} +25 -79
- package/{lib/components/ConfirmationModal/style.js → components/ConfirmationModal/style.tsx} +14 -13
- package/{lib/components/Container/index.js → components/Container/index.tsx} +7 -28
- package/{lib/components/Container/style.js → components/Container/style.ts} +6 -5
- package/{lib/components/CustomChatView/index.js → components/CustomChatView/index.tsx} +22 -30
- package/{lib/components/CustomChatView/style.js → components/CustomChatView/style.ts} +1 -1
- package/components/DeckSwiper/index.tsx +90 -0
- package/{lib/components/DeckSwiper/style.js → components/DeckSwiper/style.ts} +13 -12
- package/components/DonutCountdown/index.tsx +86 -0
- package/components/DonutCountdown/style.ts +8 -0
- package/components/FloatingContainer/index.tsx +35 -0
- package/{lib/components/FloatingContainer/style.js → components/FloatingContainer/style.ts} +7 -6
- package/components/Footer/index.tsx +35 -0
- package/{lib/components/Footer/style.js → components/Footer/style.ts} +4 -3
- package/components/Header/index.tsx +21 -0
- package/{lib/components/Header/style.js → components/Header/style.ts} +4 -3
- package/{lib/components/ImagePicker/index.js → components/ImagePicker/index.tsx} +3 -12
- package/components/ImageResponsive/index.tsx +24 -0
- package/components/ImageResponsive/style.ts +9 -0
- package/components/ImageViewer/index.tsx +36 -0
- package/{lib/components/ImageViewer/style.js → components/ImageViewer/style.ts} +11 -10
- package/{lib/components/Input/index.js → components/Input/index.tsx} +6 -33
- package/{lib/components/Input/style.js → components/Input/style.ts} +7 -18
- package/{lib/components/InputPin/index.js → components/InputPin/index.tsx} +6 -13
- package/{lib/components/InputPin/style.js → components/InputPin/style.ts} +7 -6
- package/components/MenuItem/index.tsx +25 -0
- package/{lib/components/MenuItem/style.js → components/MenuItem/style.ts} +9 -7
- package/{lib/components/NavigationTitle/index.js → components/NavigationTitle/index.tsx} +9 -30
- package/{lib/components/NavigationTitle/style.js → components/NavigationTitle/style.ts} +12 -11
- package/components/Notification/index.tsx +44 -0
- package/{lib/components/Notification/style.js → components/Notification/style.ts} +13 -11
- package/components/PreventDoubleClick/index.tsx +28 -0
- package/components/Select/index.tsx +51 -0
- package/components/Select/style.ts +64 -0
- package/{lib/components/SwipeablePanel/index.js → components/SwipeablePanel/index.tsx} +58 -85
- package/{lib/components/SwipeablePanel/style.js → components/SwipeablePanel/style.ts} +15 -14
- package/components/Switch/index.tsx +30 -0
- package/components/TakePicture/confirmPictureModal.tsx +37 -0
- package/components/TakePicture/index.tsx +148 -0
- package/{lib/components/TakePicture/style.js → components/TakePicture/style.ts} +4 -4
- package/components/Text/index.tsx +33 -0
- package/{lib/components/Text/style.js → components/Text/style.ts} +4 -2
- package/{lib/components/Textarea/index.js → components/Textarea/index.tsx} +5 -24
- package/{lib/components/Textarea/style.js → components/Textarea/style.ts} +5 -4
- package/components/TimeOutButton/index.tsx +67 -0
- package/{lib/components/TimeOutButton/style.js → components/TimeOutButton/style.ts} +4 -3
- package/components/Toast/index.tsx +34 -0
- package/components/Toast/style.ts +12 -0
- package/{lib/components/UploadDocument/index.js → components/UploadDocument/index.tsx} +49 -105
- package/{lib/components/UploadDocument/style.js → components/UploadDocument/style.ts} +16 -15
- package/components/VirtualKeyboard/index.tsx +75 -0
- package/{lib/components/VirtualKeyboard/style.js → components/VirtualKeyboard/style.ts} +9 -8
- package/components/index.ts +29 -0
- package/{lib/configs/constants.js → configs/constants.ts} +50 -48
- package/configs/types.ts +326 -0
- package/eas.json +27 -0
- package/eslint.config.mjs +205 -0
- package/hooks/index.ts +2 -0
- package/{lib/hooks/useDebounce.js → hooks/useDebounce.tsx} +6 -4
- package/hooks/useLoadFonts.tsx +13 -0
- package/index.js +3 -2
- package/lib/components/Button/index.tsx +66 -0
- package/lib/components/Button/style.ts +111 -0
- package/lib/components/Card/index.tsx +33 -0
- package/lib/components/Card/style.ts +34 -0
- package/lib/components/ConfirmationModal/index.tsx +104 -0
- package/lib/components/ConfirmationModal/style.tsx +53 -0
- package/lib/components/Container/index.tsx +33 -0
- package/lib/components/Container/style.ts +13 -0
- package/lib/components/CustomChatView/index.tsx +65 -0
- package/lib/components/CustomChatView/style.ts +10 -0
- package/lib/components/DeckSwiper/index.tsx +90 -0
- package/lib/components/DeckSwiper/style.ts +59 -0
- package/lib/components/DonutCountdown/index.tsx +86 -0
- package/lib/components/DonutCountdown/style.ts +8 -0
- package/lib/components/FloatingContainer/index.tsx +35 -0
- package/lib/components/FloatingContainer/style.ts +25 -0
- package/lib/components/Footer/index.tsx +35 -0
- package/lib/components/Footer/style.ts +40 -0
- package/lib/components/Header/index.tsx +21 -0
- package/lib/components/Header/style.ts +34 -0
- package/lib/components/ImagePicker/index.tsx +18 -0
- package/lib/components/ImageResponsive/index.tsx +24 -0
- package/lib/components/ImageResponsive/style.ts +9 -0
- package/lib/components/ImageViewer/index.tsx +36 -0
- package/lib/components/ImageViewer/style.ts +38 -0
- package/lib/components/Input/index.tsx +62 -0
- package/lib/components/Input/style.ts +91 -0
- package/lib/components/InputPin/index.tsx +21 -0
- package/lib/components/InputPin/style.ts +22 -0
- package/lib/components/MenuItem/index.tsx +25 -0
- package/lib/components/MenuItem/style.ts +44 -0
- package/lib/components/NavigationTitle/index.tsx +53 -0
- package/lib/components/NavigationTitle/style.ts +49 -0
- package/lib/components/Notification/index.tsx +44 -0
- package/lib/components/Notification/style.ts +50 -0
- package/lib/components/PreventDoubleClick/index.tsx +28 -0
- package/lib/components/Select/index.tsx +51 -0
- package/lib/components/Select/style.ts +64 -0
- package/lib/components/SwipeablePanel/index.tsx +208 -0
- package/lib/components/SwipeablePanel/style.ts +81 -0
- package/lib/components/Switch/index.tsx +30 -0
- package/lib/components/TakePicture/confirmPictureModal.tsx +37 -0
- package/lib/components/TakePicture/index.tsx +148 -0
- package/lib/components/TakePicture/style.ts +95 -0
- package/lib/components/Text/index.tsx +33 -0
- package/lib/components/Text/style.ts +101 -0
- package/lib/components/Textarea/index.tsx +26 -0
- package/lib/components/Textarea/style.ts +38 -0
- package/lib/components/TimeOutButton/index.tsx +67 -0
- package/lib/components/TimeOutButton/style.ts +42 -0
- package/lib/components/Toast/index.tsx +34 -0
- package/lib/components/Toast/style.ts +12 -0
- package/lib/components/UploadDocument/index.tsx +179 -0
- package/lib/components/UploadDocument/style.ts +57 -0
- package/lib/components/VirtualKeyboard/index.tsx +75 -0
- package/lib/components/VirtualKeyboard/style.ts +25 -0
- package/lib/components/index.ts +29 -0
- package/lib/configs/constants.ts +273 -0
- package/lib/configs/types.ts +326 -0
- package/lib/hooks/index.ts +2 -0
- package/lib/hooks/useDebounce.tsx +24 -0
- package/lib/hooks/useLoadFonts.tsx +13 -0
- package/lib/index.js +3 -2
- package/metro.config.js +11 -0
- package/package.json +72 -63
- package/prettier.config.mjs +23 -0
- package/stories/Button.stories.tsx +181 -0
- package/stories/Card.stories.tsx +22 -0
- package/stories/Colors.stories.tsx +57 -0
- package/stories/ConfirmationModal.stories.tsx +142 -0
- package/stories/Container.stories.tsx +105 -0
- package/stories/DeckSwiper.stories.tsx +43 -0
- package/stories/DonutCountdown.stories.tsx +134 -0
- package/stories/FloatingContainer.stories.tsx +139 -0
- package/stories/Footer.stories.tsx +65 -0
- package/stories/Header.stories.tsx +37 -0
- package/stories/ImagePicker.stories.tsx +14 -0
- package/stories/ImageResponsive.stories.tsx +18 -0
- package/stories/ImageViewer.stories.tsx +24 -0
- package/stories/Input.stories.tsx +119 -0
- package/stories/InputPin.stories.tsx +40 -0
- package/stories/Menu.stories.tsx +53 -0
- package/stories/MenuItem.stories.tsx +30 -0
- package/stories/NavigationTitle.stories.tsx +51 -0
- package/stories/Notification.stories.tsx +58 -0
- package/stories/Select.stories.tsx +270 -0
- package/stories/SwipeablePanel.stories.tsx +360 -0
- package/stories/Switch.stories.tsx +36 -0
- package/stories/TakePicture.stories.tsx +59 -0
- package/stories/Text.stories.tsx +61 -0
- package/stories/Textarea.stories.tsx +48 -0
- package/stories/TimeOutButton.stories.tsx +55 -0
- package/stories/Toast.stories.tsx +37 -0
- package/stories/UploadDocument.stories.tsx +179 -0
- package/stories/VirtualKeyboard.stories.tsx +14 -0
- package/tsconfig.json +21 -0
- package/utilities/ScrollView.tsx +19 -0
- package/utilities/index.ts +2 -0
- package/utilities/utils.ts +29 -0
- package/lib/components/Button/index.js +0 -104
- package/lib/components/Card/index.js +0 -49
- package/lib/components/DeckSwiper/index.js +0 -118
- package/lib/components/FlashMessage/index.js +0 -81
- package/lib/components/FloatingContainer/index.js +0 -69
- package/lib/components/Footer/index.js +0 -61
- package/lib/components/Header/index.js +0 -45
- package/lib/components/ImageResponsive/index.js +0 -39
- package/lib/components/ImageResponsive/style.js +0 -7
- package/lib/components/ImageViewer/index.js +0 -62
- package/lib/components/MenuItem/index.js +0 -44
- package/lib/components/Notification/index.js +0 -80
- package/lib/components/PreventDoubleClick/index.js +0 -21
- package/lib/components/Select/index.js +0 -89
- package/lib/components/Select/style.js +0 -81
- package/lib/components/Switch/index.js +0 -57
- package/lib/components/TakePicture/confirmPictureModal.js +0 -64
- package/lib/components/TakePicture/index.js +0 -198
- package/lib/components/Text/index.js +0 -75
- package/lib/components/TimeOutButton/index.js +0 -104
- package/lib/components/VirtualKeyboard/index.js +0 -86
- package/lib/components/index.js +0 -28
- package/lib/configs/loadFonts.js +0 -11
- package/lib/hooks/index.js +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
|
|
3
|
+
import { Input } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Input',
|
|
8
|
+
component: Input,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Variant = {
|
|
12
|
+
render: () => (
|
|
13
|
+
<>
|
|
14
|
+
<Input placeholder="Placeholder" />
|
|
15
|
+
<Input variant="completed" placeholder="Placeholder" />
|
|
16
|
+
<Input variant="error" placeholder="Placeholder" value="Input with error" />
|
|
17
|
+
</>
|
|
18
|
+
),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const LeftIcon = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<>
|
|
24
|
+
<Input placeholder="Placeholder" leftIcon={<Ionicons name="person-outline" size={26} color={Colors.midblue} />} />
|
|
25
|
+
<Input
|
|
26
|
+
variant="completed"
|
|
27
|
+
placeholder="Placeholder"
|
|
28
|
+
leftIcon={<Ionicons name="shield-checkmark-outline" size={26} color={Colors.midblue} />}
|
|
29
|
+
/>
|
|
30
|
+
<Input
|
|
31
|
+
variant="error"
|
|
32
|
+
placeholder="Placeholder"
|
|
33
|
+
value="Input with error"
|
|
34
|
+
leftIcon={<Ionicons name="power-outline" size={26} color={Colors.red} />}
|
|
35
|
+
/>
|
|
36
|
+
</>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Sizes = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<>
|
|
43
|
+
<Input size="fixed" placeholder="Fixed" />
|
|
44
|
+
|
|
45
|
+
<Input size="fit" placeholder="Fit" />
|
|
46
|
+
</>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Disabled = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<>
|
|
53
|
+
<Input disabled placeholder="Placeholder" />
|
|
54
|
+
<Input disabled variant="completed" placeholder="Placeholder" />
|
|
55
|
+
<Input disabled variant="error" placeholder="Placeholder" value="Input with error" />
|
|
56
|
+
</>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ShowLabel = {
|
|
61
|
+
render: () => (
|
|
62
|
+
<>
|
|
63
|
+
<Input showLabel label="User Name" placeholder="Enter your name" />
|
|
64
|
+
<Input showLabel label="Password" variant="completed" placeholder="Enter your password" />
|
|
65
|
+
<Input showLabel label="Error" variant="error" placeholder="Enter your input" value="Invalid input" />
|
|
66
|
+
</>
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const CharacterCount = {
|
|
71
|
+
render: () => (
|
|
72
|
+
<>
|
|
73
|
+
<Input count maxLength={50} placeholder="Type here..." />
|
|
74
|
+
<Input count maxLength={30} variant="completed" placeholder="Type here..." />
|
|
75
|
+
<Input count maxLength={20} variant="error" placeholder="Type here..." value="Too many characters" />
|
|
76
|
+
</>
|
|
77
|
+
),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const RightIcon = {
|
|
81
|
+
render: () => (
|
|
82
|
+
<>
|
|
83
|
+
<Input
|
|
84
|
+
placeholder="Enter text"
|
|
85
|
+
rightIcon={<Ionicons name="checkmark-outline" size={26} color={Colors.green} />}
|
|
86
|
+
/>
|
|
87
|
+
<Input
|
|
88
|
+
variant="completed"
|
|
89
|
+
placeholder="Enter text"
|
|
90
|
+
rightIcon={<Ionicons name="happy-outline" size={26} color={Colors.midblue} />}
|
|
91
|
+
/>
|
|
92
|
+
<Input
|
|
93
|
+
variant="error"
|
|
94
|
+
placeholder="Enter text"
|
|
95
|
+
value="Error state"
|
|
96
|
+
rightIcon={<Ionicons name="alert-circle-outline" size={26} color={Colors.red} />}
|
|
97
|
+
/>
|
|
98
|
+
</>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const CombinedFeatures = {
|
|
103
|
+
render: () => (
|
|
104
|
+
<>
|
|
105
|
+
<Input
|
|
106
|
+
showLabel
|
|
107
|
+
label="Search"
|
|
108
|
+
placeholder="Enter search term"
|
|
109
|
+
rightIcon={<Ionicons name="search-outline" size={26} color={Colors.gray} />}
|
|
110
|
+
/>
|
|
111
|
+
<Input
|
|
112
|
+
count
|
|
113
|
+
maxLength={30}
|
|
114
|
+
placeholder="Type here"
|
|
115
|
+
rightIcon={<Ionicons name="send-outline" size={26} color={Colors.midblue} />}
|
|
116
|
+
/>
|
|
117
|
+
</>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { InputPin, VirtualKeyboard } from '../components';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Input Pin',
|
|
7
|
+
component: InputPin,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const DefaultComponent = () => {
|
|
11
|
+
const [values, setValues] = useState<(string | number)[]>([]);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<InputPin values={values} />
|
|
16
|
+
<VirtualKeyboard
|
|
17
|
+
onPress={(key) => {
|
|
18
|
+
switch (key) {
|
|
19
|
+
case 'back':
|
|
20
|
+
if (values.length) {
|
|
21
|
+
setValues(values.slice(0, -1));
|
|
22
|
+
}
|
|
23
|
+
break;
|
|
24
|
+
case 'biometrics':
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
if (values.length < 4 && key !== null) {
|
|
28
|
+
setValues([...values, key]);
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Default = {
|
|
39
|
+
render: DefaultComponent,
|
|
40
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
|
|
3
|
+
import { Card, MenuItem } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Menu',
|
|
8
|
+
component: MenuItem,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Default = {
|
|
12
|
+
render: () => (
|
|
13
|
+
<>
|
|
14
|
+
<Card>
|
|
15
|
+
<MenuItem
|
|
16
|
+
icon={<Ionicons name="list-outline" size={22} color={Colors.darkblue} />}
|
|
17
|
+
text="Menu item text"
|
|
18
|
+
onPress={() => {}}
|
|
19
|
+
/>
|
|
20
|
+
<MenuItem
|
|
21
|
+
icon={<Ionicons name="card-outline" size={22} color={Colors.darkblue} />}
|
|
22
|
+
text="Menu item text"
|
|
23
|
+
onPress={() => {}}
|
|
24
|
+
/>
|
|
25
|
+
<MenuItem
|
|
26
|
+
icon={<Ionicons name="location-outline" size={22} color={Colors.darkblue} />}
|
|
27
|
+
text="Menu item text"
|
|
28
|
+
onPress={() => {}}
|
|
29
|
+
/>
|
|
30
|
+
<MenuItem
|
|
31
|
+
icon={<Ionicons name="lock-closed-outline" size={22} color={Colors.darkblue} />}
|
|
32
|
+
text="Menu item text"
|
|
33
|
+
last
|
|
34
|
+
onPress={() => {}}
|
|
35
|
+
/>
|
|
36
|
+
</Card>
|
|
37
|
+
|
|
38
|
+
<Card>
|
|
39
|
+
<MenuItem
|
|
40
|
+
icon={<Ionicons name="headset-outline" size={22} color={Colors.darkblue} />}
|
|
41
|
+
text="Menu item text"
|
|
42
|
+
onPress={() => {}}
|
|
43
|
+
/>
|
|
44
|
+
<MenuItem
|
|
45
|
+
icon={<Ionicons name="help-circle-outline" size={22} color={Colors.darkblue} />}
|
|
46
|
+
text="Menu item text"
|
|
47
|
+
onPress={() => {}}
|
|
48
|
+
last
|
|
49
|
+
/>
|
|
50
|
+
</Card>
|
|
51
|
+
</>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
|
|
3
|
+
import { MenuItem } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Menu Item',
|
|
8
|
+
component: MenuItem,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Default = {
|
|
12
|
+
render: () => (
|
|
13
|
+
<MenuItem
|
|
14
|
+
icon={<Ionicons name="list-outline" size={24} color={Colors.darkblue} />}
|
|
15
|
+
text="Menu item text"
|
|
16
|
+
onPress={() => {}}
|
|
17
|
+
/>
|
|
18
|
+
),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Last = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<MenuItem
|
|
24
|
+
icon={<Ionicons name="list-outline" size={24} color={Colors.darkblue} />}
|
|
25
|
+
text="Menu item text"
|
|
26
|
+
last
|
|
27
|
+
onPress={() => {}}
|
|
28
|
+
/>
|
|
29
|
+
),
|
|
30
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { ImageResponsive, NavigationTitle, Text } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Navigation Title',
|
|
8
|
+
component: NavigationTitle,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Close = {
|
|
12
|
+
render: () => <NavigationTitle title="This is the title" onPress={() => {}} />,
|
|
13
|
+
};
|
|
14
|
+
export const Back = {
|
|
15
|
+
render: () => <NavigationTitle type="back" title="This is the title" onPress={() => {}} />,
|
|
16
|
+
};
|
|
17
|
+
export const UseComponentInTitle = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<NavigationTitle
|
|
20
|
+
type="back"
|
|
21
|
+
title={
|
|
22
|
+
<View style={{ flexDirection: 'row', alignSelf: 'center' }}>
|
|
23
|
+
<ImageResponsive
|
|
24
|
+
avatar
|
|
25
|
+
source={require('../assets/icon.png')}
|
|
26
|
+
style={{ height: 50, width: 50, borderColor: Colors.lightblue, borderWidth: 1, marginHorizontal: 10 }}
|
|
27
|
+
/>
|
|
28
|
+
<View>
|
|
29
|
+
<Text size="large" weight="semiBold">
|
|
30
|
+
This is the title
|
|
31
|
+
</Text>
|
|
32
|
+
<Text size="tiny" color="light">
|
|
33
|
+
This is the title
|
|
34
|
+
</Text>
|
|
35
|
+
</View>
|
|
36
|
+
</View>
|
|
37
|
+
}
|
|
38
|
+
onPress={() => {}}
|
|
39
|
+
/>
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
export const NoShadow = {
|
|
43
|
+
render: () => <NavigationTitle type="back" noShadow title="This is the title" onPress={() => {}} />,
|
|
44
|
+
};
|
|
45
|
+
export const ExtraLarge = {
|
|
46
|
+
render: () => <NavigationTitle type="back" xlarge title="This is the title" onPress={() => {}} />,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const BlockNavigation = {
|
|
50
|
+
render: () => <NavigationTitle type="back" blockNavigation title="This is the title" onPress={() => {}} />,
|
|
51
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
|
|
3
|
+
import { Notification } from '../components';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Notification',
|
|
7
|
+
component: Notification,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (
|
|
12
|
+
<Notification
|
|
13
|
+
title="Mike Lyne"
|
|
14
|
+
description="I must tell you my interview this. I must tell you my interview this"
|
|
15
|
+
avatar={{ uri: 'https://picsum.photos/id/237/300' }}
|
|
16
|
+
date={dayjs().subtract(3, 'm')}
|
|
17
|
+
onPress={() => {}}
|
|
18
|
+
/>
|
|
19
|
+
),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const First = {
|
|
23
|
+
render: () => (
|
|
24
|
+
<Notification
|
|
25
|
+
first
|
|
26
|
+
title="Mike Lyne"
|
|
27
|
+
description="I must tell you my interview this"
|
|
28
|
+
avatar={{ uri: 'https://picsum.photos/id/237/300' }}
|
|
29
|
+
date={dayjs().subtract(1, 'd')}
|
|
30
|
+
onPress={() => {}}
|
|
31
|
+
/>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Active = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<Notification
|
|
38
|
+
active
|
|
39
|
+
title="Mike Lyne"
|
|
40
|
+
description="I must tell you my interview this"
|
|
41
|
+
avatar={{ uri: 'https://picsum.photos/id/237/300' }}
|
|
42
|
+
date={dayjs().subtract(1, 'month')}
|
|
43
|
+
onPress={() => {}}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const NoAvatar = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<Notification
|
|
51
|
+
hideAvatar
|
|
52
|
+
title="Mike Lyne"
|
|
53
|
+
description="I must tell you my interview this"
|
|
54
|
+
date={dayjs().subtract(1, 'h')}
|
|
55
|
+
onPress={() => {}}
|
|
56
|
+
/>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Dimensions, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Select } from '../components';
|
|
5
|
+
|
|
6
|
+
const { width } = Dimensions.get('window');
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Select',
|
|
10
|
+
component: Select,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const VariantComponent = () => {
|
|
14
|
+
const [value, setValue] = useState<string>('');
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Select
|
|
18
|
+
items={[
|
|
19
|
+
{
|
|
20
|
+
label: 'Spanish',
|
|
21
|
+
value: 'es',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'English',
|
|
25
|
+
value: 'en',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'French',
|
|
29
|
+
value: 'fr',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Italian',
|
|
33
|
+
value: 'it',
|
|
34
|
+
},
|
|
35
|
+
]}
|
|
36
|
+
value={value}
|
|
37
|
+
placeholder="Select a language"
|
|
38
|
+
onValueChange={setValue}
|
|
39
|
+
/>
|
|
40
|
+
<Select
|
|
41
|
+
variant="completed"
|
|
42
|
+
items={[
|
|
43
|
+
{
|
|
44
|
+
label: 'Spanish',
|
|
45
|
+
value: 'es',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'English',
|
|
49
|
+
value: 'en',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: 'French',
|
|
53
|
+
value: 'fr',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: 'Italian',
|
|
57
|
+
value: 'it',
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
value={value}
|
|
61
|
+
placeholder="Select a language"
|
|
62
|
+
onValueChange={setValue}
|
|
63
|
+
/>
|
|
64
|
+
<Select
|
|
65
|
+
variant="error"
|
|
66
|
+
items={[
|
|
67
|
+
{
|
|
68
|
+
label: 'Spanish',
|
|
69
|
+
value: 'es',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'English',
|
|
73
|
+
value: 'en',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'French',
|
|
77
|
+
value: 'fr',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: 'Italian',
|
|
81
|
+
value: 'it',
|
|
82
|
+
},
|
|
83
|
+
]}
|
|
84
|
+
value={value}
|
|
85
|
+
placeholder="Select a language"
|
|
86
|
+
onValueChange={setValue}
|
|
87
|
+
/>
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const FitToContainerComponent = () => {
|
|
93
|
+
const [value, setValue] = useState<string>('');
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<View style={{ width }}>
|
|
97
|
+
<Select
|
|
98
|
+
fitToContainer
|
|
99
|
+
items={[
|
|
100
|
+
{
|
|
101
|
+
label: 'Spanish',
|
|
102
|
+
value: 'es',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: 'English',
|
|
106
|
+
value: 'en',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: 'French',
|
|
110
|
+
value: 'fr',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: 'Italian',
|
|
114
|
+
value: 'it',
|
|
115
|
+
},
|
|
116
|
+
]}
|
|
117
|
+
value={value}
|
|
118
|
+
placeholder="Select a language"
|
|
119
|
+
onValueChange={setValue}
|
|
120
|
+
/>
|
|
121
|
+
</View>
|
|
122
|
+
<View style={{ width: width - 100 }}>
|
|
123
|
+
<Select
|
|
124
|
+
fitToContainer
|
|
125
|
+
items={[
|
|
126
|
+
{
|
|
127
|
+
label: 'Spanish',
|
|
128
|
+
value: 'es',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'English',
|
|
132
|
+
value: 'en',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: 'French',
|
|
136
|
+
value: 'fr',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'Italian',
|
|
140
|
+
value: 'it',
|
|
141
|
+
},
|
|
142
|
+
]}
|
|
143
|
+
value={value}
|
|
144
|
+
placeholder="Select a language"
|
|
145
|
+
onValueChange={setValue}
|
|
146
|
+
/>
|
|
147
|
+
</View>
|
|
148
|
+
<View style={{ width: width - 180 }}>
|
|
149
|
+
<Select
|
|
150
|
+
fitToContainer
|
|
151
|
+
items={[
|
|
152
|
+
{
|
|
153
|
+
label: 'Spanish',
|
|
154
|
+
value: 'es',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: 'English',
|
|
158
|
+
value: 'en',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: 'French',
|
|
162
|
+
value: 'fr',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
label: 'Italian',
|
|
166
|
+
value: 'it',
|
|
167
|
+
},
|
|
168
|
+
]}
|
|
169
|
+
value={value}
|
|
170
|
+
placeholder="Select a language"
|
|
171
|
+
onValueChange={setValue}
|
|
172
|
+
/>
|
|
173
|
+
</View>
|
|
174
|
+
</>
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const DisabledComponent = () => {
|
|
179
|
+
const [value, setValue] = useState<string>('');
|
|
180
|
+
return (
|
|
181
|
+
<>
|
|
182
|
+
<Select
|
|
183
|
+
disabled
|
|
184
|
+
items={[
|
|
185
|
+
{
|
|
186
|
+
label: 'Spanish',
|
|
187
|
+
value: 'es',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: 'English',
|
|
191
|
+
value: 'en',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: 'French',
|
|
195
|
+
value: 'fr',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
label: 'Italian',
|
|
199
|
+
value: 'it',
|
|
200
|
+
},
|
|
201
|
+
]}
|
|
202
|
+
value={value}
|
|
203
|
+
placeholder="Select a language"
|
|
204
|
+
onValueChange={setValue}
|
|
205
|
+
/>
|
|
206
|
+
<Select
|
|
207
|
+
variant="completed"
|
|
208
|
+
disabled
|
|
209
|
+
items={[
|
|
210
|
+
{
|
|
211
|
+
label: 'Spanish',
|
|
212
|
+
value: 'es',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
label: 'English',
|
|
216
|
+
value: 'en',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: 'French',
|
|
220
|
+
value: 'fr',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: 'Italian',
|
|
224
|
+
value: 'it',
|
|
225
|
+
},
|
|
226
|
+
]}
|
|
227
|
+
value={value}
|
|
228
|
+
placeholder="Select a language"
|
|
229
|
+
onValueChange={setValue}
|
|
230
|
+
/>
|
|
231
|
+
<Select
|
|
232
|
+
variant="error"
|
|
233
|
+
disabled
|
|
234
|
+
items={[
|
|
235
|
+
{
|
|
236
|
+
label: 'Spanish',
|
|
237
|
+
value: 'es',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
label: 'English',
|
|
241
|
+
value: 'en',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
label: 'French',
|
|
245
|
+
value: 'fr',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
label: 'Italian',
|
|
249
|
+
value: 'it',
|
|
250
|
+
},
|
|
251
|
+
]}
|
|
252
|
+
value={value}
|
|
253
|
+
placeholder="Select a language"
|
|
254
|
+
onValueChange={setValue}
|
|
255
|
+
/>
|
|
256
|
+
</>
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export const Variant = {
|
|
261
|
+
render: VariantComponent,
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const FitToContainer = {
|
|
265
|
+
render: FitToContainerComponent,
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const Disabled = {
|
|
269
|
+
render: DisabledComponent,
|
|
270
|
+
};
|