@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
package/package.json
CHANGED
|
@@ -1,91 +1,100 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "0.7.0",
|
|
2
3
|
"main": "lib/index.js",
|
|
3
4
|
"name": "@holper/react-native-holper-storybook",
|
|
4
5
|
"description": "A component library for Holper projects",
|
|
5
|
-
"version": "0.6.101",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"index.js"
|
|
10
|
-
],
|
|
11
|
-
"homepage": "https://bitbucket.org/d4fitwearapps/holper-storybook",
|
|
7
|
+
"packageManager": "yarn@4.5.0",
|
|
8
|
+
"homepage": "https://github.com/holperapp/holper-storybook",
|
|
12
9
|
"repository": {
|
|
13
10
|
"type": "git",
|
|
14
|
-
"url": "https://
|
|
11
|
+
"url": "https://github.com/holperapp/holper-storybook.git"
|
|
15
12
|
},
|
|
16
13
|
"bugs": {
|
|
17
|
-
"url": "https://
|
|
14
|
+
"url": "https://github.com/holperapp/holper-storybook/issues",
|
|
18
15
|
"email": "d4fitwear@gmail.com"
|
|
19
16
|
},
|
|
20
17
|
"scripts": {
|
|
21
|
-
"start": "
|
|
18
|
+
"start": "expo start",
|
|
22
19
|
"build-dev": "eas build --profile development",
|
|
23
|
-
"build-preview": "eas build --profile preview",
|
|
24
|
-
"eject": "expo eject",
|
|
25
20
|
"clear": "watchman watch-del-all",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
21
|
+
"android": "expo start --android",
|
|
22
|
+
"ios": "expo start --ios",
|
|
23
|
+
"web": "expo start --web",
|
|
24
|
+
"lint:debug": "TIMING=all eslint -c ./eslint.config.mjs --debug",
|
|
25
|
+
"lint:fix": "eslint -c ./eslint.config.mjs --fix",
|
|
26
|
+
"lint": "eslint -c ./eslint.config.mjs",
|
|
27
|
+
"format:check": "prettier . --check --config prettier.config.mjs",
|
|
28
|
+
"format": "prettier . --write --config prettier.config.mjs",
|
|
29
|
+
"storybook:android": "cross-env STORYBOOK_ENABLED='true' expo start --android",
|
|
30
|
+
"storybook:generate": "sb-rn-get-stories -js",
|
|
31
|
+
"storybook:ios": "cross-env STORYBOOK_ENABLED='true' expo start --ios",
|
|
32
|
+
"storybook:publish": "./build.sh",
|
|
33
|
+
"storybook:start": "cross-env STORYBOOK_ENABLED='true' expo start",
|
|
34
|
+
"type:check": "tsc --extendedDiagnostics",
|
|
35
|
+
"verify:fix": "yarn lint:fix && yarn format && yarn type:check",
|
|
36
|
+
"verify": "yarn lint && yarn format:check && yarn type:check"
|
|
28
37
|
},
|
|
29
38
|
"dependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@react-native-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"expo
|
|
36
|
-
"expo-
|
|
37
|
-
"expo-
|
|
39
|
+
"@expo/metro-runtime": "~5.0.4",
|
|
40
|
+
"@expo/vector-icons": "^14.1.0",
|
|
41
|
+
"@react-native-picker/picker": "2.11.1",
|
|
42
|
+
"@types/react": "~19.0.10",
|
|
43
|
+
"dayjs": "^1.11.13",
|
|
44
|
+
"expo": "^53.0.19",
|
|
45
|
+
"expo-camera": "~16.1.10",
|
|
46
|
+
"expo-constants": "~17.1.7",
|
|
47
|
+
"expo-dev-client": "~5.2.4",
|
|
48
|
+
"expo-font": "~13.3.2",
|
|
38
49
|
"expo-image-manipulator": "~13.1.7",
|
|
39
50
|
"expo-image-picker": "~16.1.4",
|
|
40
51
|
"expo-media-library": "~17.1.7",
|
|
41
|
-
"expo-
|
|
42
|
-
"
|
|
43
|
-
"prop-types": "^15.8.1",
|
|
52
|
+
"expo-splash-screen": "~0.30.10",
|
|
53
|
+
"lodash": "^4.17.21",
|
|
44
54
|
"react": "19.0.0",
|
|
45
55
|
"react-dom": "19.0.0",
|
|
46
|
-
"react-native": "0.79.
|
|
47
|
-
"react-native-
|
|
48
|
-
"react-native-deck-swiper": "^2.0.16",
|
|
49
|
-
"react-native-dropdown-picker": "^5.4.6",
|
|
50
|
-
"react-native-flash-message": "^0.4.2",
|
|
56
|
+
"react-native": "0.79.5",
|
|
57
|
+
"react-native-deck-swiper": "^2.0.18",
|
|
51
58
|
"react-native-maps": "1.20.1",
|
|
52
|
-
"react-native-
|
|
53
|
-
"react-native-
|
|
54
|
-
"react-native-
|
|
55
|
-
"
|
|
56
|
-
"react-native-vector-icons": "^10.0.3",
|
|
57
|
-
"react-native-web": "^0.20.0"
|
|
59
|
+
"react-native-picker-select": "^9.3.1",
|
|
60
|
+
"react-native-screens": "~4.11.1",
|
|
61
|
+
"react-native-web": "^0.20.0",
|
|
62
|
+
"sonner-native": "^0.21.0"
|
|
58
63
|
},
|
|
59
64
|
"devDependencies": {
|
|
60
|
-
"@babel/core": "^7.
|
|
61
|
-
"@babel/
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@
|
|
67
|
-
"@storybook/
|
|
68
|
-
"@storybook/
|
|
69
|
-
"@storybook/react-native
|
|
65
|
+
"@babel/core": "^7.26.0",
|
|
66
|
+
"@babel/plugin-transform-class-static-block": "^7.27.1",
|
|
67
|
+
"@eslint/js": "^9.31.0",
|
|
68
|
+
"@gorhom/bottom-sheet": "^4.6.4",
|
|
69
|
+
"@react-native-async-storage/async-storage": "2.1.2",
|
|
70
|
+
"@react-native-community/datetimepicker": "8.4.1",
|
|
71
|
+
"@react-native-community/slider": "4.5.6",
|
|
72
|
+
"@storybook/addon-ondevice-actions": "^8.3.5",
|
|
73
|
+
"@storybook/addon-ondevice-controls": "^8.3.5",
|
|
74
|
+
"@storybook/react-native": "^8.3.5",
|
|
75
|
+
"@types/lodash": "^4.17.20",
|
|
70
76
|
"babel-loader": "^9.1.3",
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"react": "
|
|
76
|
-
"react-
|
|
77
|
-
"
|
|
77
|
+
"cross-env": "^7.0.3",
|
|
78
|
+
"eslint": "^9.30.1",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
80
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
81
|
+
"eslint-plugin-react": "^7.37.5",
|
|
82
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
83
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
84
|
+
"globals": "^16.3.0",
|
|
85
|
+
"lint-staged": "^16.1.2",
|
|
86
|
+
"prettier": "^3.6.2",
|
|
87
|
+
"react-native-gesture-handler": "~2.24.0",
|
|
88
|
+
"react-native-reanimated": "~3.17.4",
|
|
89
|
+
"react-native-safe-area-context": "5.4.0",
|
|
90
|
+
"react-native-svg": "15.11.2",
|
|
91
|
+
"typescript": "~5.8.3",
|
|
92
|
+
"typescript-eslint": "^8.37.0"
|
|
78
93
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"react-native-maps-directions",
|
|
85
|
-
"react-native-status-bar-height"
|
|
86
|
-
],
|
|
87
|
-
"listUnknownPackages": false
|
|
88
|
-
}
|
|
89
|
-
}
|
|
94
|
+
"lint-staged": {
|
|
95
|
+
"*.{js,jsx,ts,tsx,json,css,md}": [
|
|
96
|
+
"eslint --fix",
|
|
97
|
+
"prettier --write"
|
|
98
|
+
]
|
|
90
99
|
}
|
|
91
100
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('prettier').Config}
|
|
3
|
+
* Need to restart IDE after changes.
|
|
4
|
+
* Open command palette and run (Ctrl + Shift + P) and execute the command > Reload Window.
|
|
5
|
+
*/
|
|
6
|
+
const config = {
|
|
7
|
+
semi: true,
|
|
8
|
+
tabWidth: 2,
|
|
9
|
+
endOfLine: 'lf',
|
|
10
|
+
printWidth: 120,
|
|
11
|
+
singleQuote: true,
|
|
12
|
+
trailingComma: 'es5',
|
|
13
|
+
overrides: [
|
|
14
|
+
{
|
|
15
|
+
files: '*.json',
|
|
16
|
+
options: {
|
|
17
|
+
tabWidth: 2,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default config;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
|
|
3
|
+
import { Button, Text } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
import { ScrollView } from '../utilities';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Button',
|
|
9
|
+
component: Button,
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story: any) => (
|
|
12
|
+
<ScrollView>
|
|
13
|
+
<Story />
|
|
14
|
+
</ScrollView>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Variants = {
|
|
20
|
+
render: () => (
|
|
21
|
+
<>
|
|
22
|
+
<Button variant="primary">
|
|
23
|
+
<Text color="white">Primary Button</Text>
|
|
24
|
+
</Button>
|
|
25
|
+
<Button variant="secondary">
|
|
26
|
+
<Text>Secondary Button</Text>
|
|
27
|
+
</Button>
|
|
28
|
+
<Button variant="dim">
|
|
29
|
+
<Text>Button Dim</Text>
|
|
30
|
+
</Button>
|
|
31
|
+
<Button variant="light">
|
|
32
|
+
<Text>Button Light</Text>
|
|
33
|
+
</Button>
|
|
34
|
+
<Button variant="brightblue">
|
|
35
|
+
<Text>Button Bright</Text>
|
|
36
|
+
</Button>
|
|
37
|
+
<Button variant="lightgreen">
|
|
38
|
+
<Text>Button Light Green</Text>
|
|
39
|
+
</Button>
|
|
40
|
+
<Button variant="electricblue">
|
|
41
|
+
<Text>Button Electric Blue</Text>
|
|
42
|
+
</Button>
|
|
43
|
+
<Button variant="brightviolet">
|
|
44
|
+
<Text>Button Bright Violet</Text>
|
|
45
|
+
</Button>
|
|
46
|
+
<Button variant="darkyellow">
|
|
47
|
+
<Text>Button Dark Yellow</Text>
|
|
48
|
+
</Button>
|
|
49
|
+
<Button variant="inverted">
|
|
50
|
+
<Text color="white">Button Inverted</Text>
|
|
51
|
+
</Button>
|
|
52
|
+
<Button variant="error">
|
|
53
|
+
<Text color="white">Button Error</Text>
|
|
54
|
+
</Button>
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Size = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<>
|
|
62
|
+
<Button size="fit">
|
|
63
|
+
<Text color="white">Fit</Text>
|
|
64
|
+
</Button>
|
|
65
|
+
<Button>
|
|
66
|
+
<Text color="white">Medium</Text>
|
|
67
|
+
</Button>
|
|
68
|
+
<Button size="small">
|
|
69
|
+
<Text color="white">Small</Text>
|
|
70
|
+
</Button>
|
|
71
|
+
<Button size="tiny">
|
|
72
|
+
<Text color="white">Tiny</Text>
|
|
73
|
+
</Button>
|
|
74
|
+
<Button size="icon">
|
|
75
|
+
<Ionicons name="navigate-outline" size={24} color={Colors.white} />
|
|
76
|
+
</Button>
|
|
77
|
+
</>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const Bordered = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<>
|
|
84
|
+
<Button bordered>
|
|
85
|
+
<Text>Button Primary Bordered</Text>
|
|
86
|
+
</Button>
|
|
87
|
+
<Button bordered variant="secondary">
|
|
88
|
+
<Text>Button Secondary Bordered</Text>
|
|
89
|
+
</Button>
|
|
90
|
+
<Button bordered variant="dim">
|
|
91
|
+
<Text>Button Dim Bordered</Text>
|
|
92
|
+
</Button>
|
|
93
|
+
<Button bordered variant="light">
|
|
94
|
+
<Text>Button Light</Text>
|
|
95
|
+
</Button>
|
|
96
|
+
<Button bordered variant="inverted">
|
|
97
|
+
<Text>Button Inverted Bordered</Text>
|
|
98
|
+
</Button>
|
|
99
|
+
<Button bordered variant="error">
|
|
100
|
+
<Text>Button Error Bordered</Text>
|
|
101
|
+
</Button>
|
|
102
|
+
</>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Disabled = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<>
|
|
109
|
+
<Button disabled>
|
|
110
|
+
<Text color="white">Button Primary Disabled</Text>
|
|
111
|
+
</Button>
|
|
112
|
+
<Button disabled variant="secondary">
|
|
113
|
+
<Text>Button Secondary Disabled</Text>
|
|
114
|
+
</Button>
|
|
115
|
+
<Button disabled variant="dim">
|
|
116
|
+
<Text>Button Dim Disabled</Text>
|
|
117
|
+
</Button>
|
|
118
|
+
<Button disabled variant="inverted">
|
|
119
|
+
<Text color="white">Button Inverted Disabled</Text>
|
|
120
|
+
</Button>
|
|
121
|
+
<Button disabled variant="error">
|
|
122
|
+
<Text color="white">Button Error Disabled</Text>
|
|
123
|
+
</Button>
|
|
124
|
+
</>
|
|
125
|
+
),
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const NoShadow = {
|
|
129
|
+
render: () => (
|
|
130
|
+
<>
|
|
131
|
+
<Button disabled>
|
|
132
|
+
<Text color="white">Button Primary Disabled</Text>
|
|
133
|
+
</Button>
|
|
134
|
+
<Button disabled variant="secondary">
|
|
135
|
+
<Text>Button Secondary Disabled</Text>
|
|
136
|
+
</Button>
|
|
137
|
+
<Button disabled variant="dim">
|
|
138
|
+
<Text>Button Dim Disabled</Text>
|
|
139
|
+
</Button>
|
|
140
|
+
<Button disabled variant="inverted">
|
|
141
|
+
<Text color="white">Button Inverted Disabled</Text>
|
|
142
|
+
</Button>
|
|
143
|
+
<Button disabled variant="error">
|
|
144
|
+
<Text color="white">Button Error Disabled</Text>
|
|
145
|
+
</Button>
|
|
146
|
+
</>
|
|
147
|
+
),
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const Loading = {
|
|
151
|
+
render: () => (
|
|
152
|
+
<>
|
|
153
|
+
<Button isLoading>
|
|
154
|
+
<Text color="white">Button Primary</Text>
|
|
155
|
+
</Button>
|
|
156
|
+
<Button variant="secondary" isLoading>
|
|
157
|
+
<Text>Button Secondary</Text>
|
|
158
|
+
</Button>
|
|
159
|
+
<Button variant="dim" isLoading>
|
|
160
|
+
<Text>Button Dim</Text>
|
|
161
|
+
</Button>
|
|
162
|
+
<Button variant="light" isLoading>
|
|
163
|
+
<Text>Button Light</Text>
|
|
164
|
+
</Button>
|
|
165
|
+
<Button variant="inverted" isLoading>
|
|
166
|
+
<Text color="white">Button Inverted</Text>
|
|
167
|
+
</Button>
|
|
168
|
+
<Button variant="error" isLoading>
|
|
169
|
+
<Text color="white">Button Error</Text>
|
|
170
|
+
</Button>
|
|
171
|
+
</>
|
|
172
|
+
),
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const WithDebounce = {
|
|
176
|
+
render: () => (
|
|
177
|
+
<Button debounceDelay={2000}>
|
|
178
|
+
<Text color="white">Button Primary</Text>
|
|
179
|
+
</Button>
|
|
180
|
+
),
|
|
181
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Card, Text } from '../components';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Card',
|
|
5
|
+
component: Card,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: () => (
|
|
10
|
+
<Card>
|
|
11
|
+
<Text>The card with some text as content</Text>
|
|
12
|
+
</Card>
|
|
13
|
+
),
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const AsButton = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<Card isButton>
|
|
19
|
+
<Text>The card as text with some text as content</Text>
|
|
20
|
+
</Card>
|
|
21
|
+
),
|
|
22
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { Text } from '../components';
|
|
4
|
+
import { Colors } from '../configs/constants';
|
|
5
|
+
import { lightOrDark, ScrollView } from '../utilities';
|
|
6
|
+
|
|
7
|
+
const colorList: { key: string; value: string }[] = [];
|
|
8
|
+
for (const [key, value] of Object.entries(Colors)) {
|
|
9
|
+
colorList.push({ key, value });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Colors',
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story: any) => (
|
|
16
|
+
<ScrollView
|
|
17
|
+
contentContainerStyle={{
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
flexWrap: 'wrap',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<Story />
|
|
24
|
+
</ScrollView>
|
|
25
|
+
),
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Default = {
|
|
30
|
+
render: () => (
|
|
31
|
+
<>
|
|
32
|
+
{colorList.map((color, index) => (
|
|
33
|
+
<View key={index} style={{ flexDirection: 'column', margin: 5 }}>
|
|
34
|
+
<View
|
|
35
|
+
style={{
|
|
36
|
+
height: 90,
|
|
37
|
+
width: 90,
|
|
38
|
+
backgroundColor: color.value,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{color.key === 'transparent' ? (
|
|
42
|
+
<Text color="dark" size="small">
|
|
43
|
+
{color.key}:{'\n'}
|
|
44
|
+
{color.value}
|
|
45
|
+
</Text>
|
|
46
|
+
) : (
|
|
47
|
+
<Text color={lightOrDark(color.value) === 'light' ? 'dark' : 'white'} size="small">
|
|
48
|
+
{color.key}:{'\n'}
|
|
49
|
+
{color.value}
|
|
50
|
+
</Text>
|
|
51
|
+
)}
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
))}
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Button, ConfirmationModal, Text } from '../components';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Confirmation Modal',
|
|
7
|
+
component: ConfirmationModal,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const DefaultComponent = () => {
|
|
11
|
+
const [showDefault, setShowDefault] = useState<boolean>(false);
|
|
12
|
+
const [showAlert, setShowAlert] = useState<boolean>(false);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Button onPress={() => setShowDefault(true)}>
|
|
17
|
+
<Text color="white">Default modal</Text>
|
|
18
|
+
</Button>
|
|
19
|
+
<Button variant="inverted" onPress={() => setShowAlert(true)}>
|
|
20
|
+
<Text color="white">Alert modal</Text>
|
|
21
|
+
</Button>
|
|
22
|
+
|
|
23
|
+
<ConfirmationModal
|
|
24
|
+
visible={showDefault}
|
|
25
|
+
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
|
26
|
+
confirmText="Accept"
|
|
27
|
+
cancelText="Cancel"
|
|
28
|
+
onConfirm={() => setShowDefault(false)}
|
|
29
|
+
onCancel={() => setShowDefault(false)}
|
|
30
|
+
>
|
|
31
|
+
<Text>
|
|
32
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in urna vel velit faucibus commodo.
|
|
33
|
+
Quisque eget arcu ut metus consectetur cursus eget eu magna. Pellentesque habitant morbi tristique senectus et
|
|
34
|
+
netus et malesuada fames ac turpis egestas. Integer tristique dui posuere turpis ultrices aliquet. Nulla
|
|
35
|
+
facilisi. Nulla molestie nisl et purus facilisis tempor.
|
|
36
|
+
</Text>
|
|
37
|
+
</ConfirmationModal>
|
|
38
|
+
|
|
39
|
+
<ConfirmationModal
|
|
40
|
+
visible={showAlert}
|
|
41
|
+
title="Lorem ipsum dolor sit amet"
|
|
42
|
+
confirmText="Accept"
|
|
43
|
+
onConfirm={() => setShowAlert(false)}
|
|
44
|
+
alertMode
|
|
45
|
+
>
|
|
46
|
+
<Text>
|
|
47
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in urna vel velit faucibus commodo.
|
|
48
|
+
Quisque eget arcu ut metus consectetur cursus eget eu magna. Pellentesque habitant morbi tristique senectus et
|
|
49
|
+
netus et malesuada fames ac turpis egestas. Integer tristique dui posuere turpis ultrices aliquet. Nulla
|
|
50
|
+
facilisi. Nulla molestie nisl et purus facilisis tempor.
|
|
51
|
+
</Text>
|
|
52
|
+
</ConfirmationModal>
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const InvertedComponent = () => {
|
|
58
|
+
const [showDefault, setShowDefault] = useState(false);
|
|
59
|
+
const [showAlert, setShowAlert] = useState(false);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
<Button onPress={() => setShowDefault(true)}>
|
|
64
|
+
<Text color="white">Default modal</Text>
|
|
65
|
+
</Button>
|
|
66
|
+
<Button variant="inverted" onPress={() => setShowAlert(true)}>
|
|
67
|
+
<Text color="white">Alert modal</Text>
|
|
68
|
+
</Button>
|
|
69
|
+
|
|
70
|
+
<ConfirmationModal
|
|
71
|
+
inverted
|
|
72
|
+
visible={showDefault}
|
|
73
|
+
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
|
74
|
+
confirmText="Accept"
|
|
75
|
+
cancelText="Cancel"
|
|
76
|
+
onConfirm={() => setShowDefault(false)}
|
|
77
|
+
onCancel={() => setShowDefault(false)}
|
|
78
|
+
>
|
|
79
|
+
<Text>
|
|
80
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in urna vel velit faucibus commodo.
|
|
81
|
+
Quisque eget arcu ut metus consectetur cursus eget eu magna. Pellentesque habitant morbi tristique senectus et
|
|
82
|
+
netus et malesuada fames ac turpis egestas. Integer tristique dui posuere turpis ultrices aliquet. Nulla
|
|
83
|
+
facilisi. Nulla molestie nisl et purus facilisis tempor.
|
|
84
|
+
</Text>
|
|
85
|
+
</ConfirmationModal>
|
|
86
|
+
|
|
87
|
+
<ConfirmationModal
|
|
88
|
+
inverted
|
|
89
|
+
visible={showAlert}
|
|
90
|
+
title="Lorem ipsum dolor sit amet"
|
|
91
|
+
confirmText="Accept"
|
|
92
|
+
onConfirm={() => setShowAlert(false)}
|
|
93
|
+
alertMode
|
|
94
|
+
>
|
|
95
|
+
<Text>
|
|
96
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in urna vel velit faucibus commodo.
|
|
97
|
+
Quisque eget arcu ut metus consectetur cursus eget eu magna. Pellentesque habitant morbi tristique senectus et
|
|
98
|
+
netus et malesuada fames ac turpis egestas. Integer tristique dui posuere turpis ultrices aliquet. Nulla
|
|
99
|
+
facilisi. Nulla molestie nisl et purus facilisis tempor.
|
|
100
|
+
</Text>
|
|
101
|
+
</ConfirmationModal>
|
|
102
|
+
</>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const InfoModeComponent = () => {
|
|
107
|
+
const [showAlert, setShowAlert] = useState(false);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<Button variant="inverted" onPress={() => setShowAlert(true)}>
|
|
112
|
+
<Text color="white">Default modal</Text>
|
|
113
|
+
</Button>
|
|
114
|
+
|
|
115
|
+
<ConfirmationModal
|
|
116
|
+
visible={showAlert}
|
|
117
|
+
title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"
|
|
118
|
+
infoMode
|
|
119
|
+
onClose={() => setShowAlert(false)}
|
|
120
|
+
>
|
|
121
|
+
<Text>
|
|
122
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse in urna vel velit faucibus commodo.
|
|
123
|
+
Quisque eget arcu ut metus consectetur cursus eget eu magna. Pellentesque habitant morbi tristique senectus et
|
|
124
|
+
netus et malesuada fames ac turpis egestas. Integer tristique dui posuere turpis ultrices aliquet. Nulla
|
|
125
|
+
facilisi. Nulla molestie nisl et purus facilisis tempor.
|
|
126
|
+
</Text>
|
|
127
|
+
</ConfirmationModal>
|
|
128
|
+
</>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const Default = {
|
|
133
|
+
render: DefaultComponent,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const Inverted = {
|
|
137
|
+
render: InvertedComponent,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const InfoMode = {
|
|
141
|
+
render: InfoModeComponent,
|
|
142
|
+
};
|