@holper/react-native-holper-storybook 0.7.0 → 0.7.2

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.
Files changed (127) hide show
  1. package/README.md +1 -1
  2. package/lib/components/DonutCountdown/style.ts +2 -1
  3. package/lib/components/Input/style.ts +2 -1
  4. package/lib/components/Select/index.tsx +1 -0
  5. package/lib/components/Select/style.ts +6 -1
  6. package/lib/components/Toast/index.tsx +34 -20
  7. package/lib/configs/constants.ts +2 -0
  8. package/package.json +5 -1
  9. package/.expo/README.md +0 -8
  10. package/.nvmrc +0 -1
  11. package/.prettierignore +0 -5
  12. package/.storybook/index.jsx +0 -11
  13. package/.storybook/main.js +0 -8
  14. package/.storybook/preview.jsx +0 -51
  15. package/.storybook/storybook.requires.js +0 -43
  16. package/.yarn/releases/yarn-4.5.0.cjs +0 -925
  17. package/.yarnrc.yml +0 -3
  18. package/App.jsx +0 -29
  19. package/app.config.js +0 -77
  20. package/assets/adaptive-icon.png +0 -0
  21. package/assets/favicon.png +0 -0
  22. package/assets/fonts/Poppins-Bold.ttf +0 -0
  23. package/assets/fonts/Poppins-Regular.ttf +0 -0
  24. package/assets/fonts/Poppins-SemiBold.ttf +0 -0
  25. package/assets/icon.png +0 -0
  26. package/assets/splash.png +0 -0
  27. package/babel.config.js +0 -7
  28. package/build.sh +0 -11
  29. package/components/Button/index.tsx +0 -66
  30. package/components/Button/style.ts +0 -111
  31. package/components/Card/index.tsx +0 -33
  32. package/components/Card/style.ts +0 -34
  33. package/components/ConfirmationModal/index.tsx +0 -104
  34. package/components/ConfirmationModal/style.tsx +0 -53
  35. package/components/Container/index.tsx +0 -33
  36. package/components/Container/style.ts +0 -13
  37. package/components/CustomChatView/index.tsx +0 -65
  38. package/components/CustomChatView/style.ts +0 -10
  39. package/components/DeckSwiper/index.tsx +0 -90
  40. package/components/DeckSwiper/style.ts +0 -59
  41. package/components/DonutCountdown/index.tsx +0 -86
  42. package/components/DonutCountdown/style.ts +0 -8
  43. package/components/FloatingContainer/index.tsx +0 -35
  44. package/components/FloatingContainer/style.ts +0 -25
  45. package/components/Footer/index.tsx +0 -35
  46. package/components/Footer/style.ts +0 -40
  47. package/components/Header/index.tsx +0 -21
  48. package/components/Header/style.ts +0 -34
  49. package/components/ImagePicker/index.tsx +0 -18
  50. package/components/ImageResponsive/index.tsx +0 -24
  51. package/components/ImageResponsive/style.ts +0 -9
  52. package/components/ImageViewer/index.tsx +0 -36
  53. package/components/ImageViewer/style.ts +0 -38
  54. package/components/Input/index.tsx +0 -62
  55. package/components/Input/style.ts +0 -91
  56. package/components/InputPin/index.tsx +0 -21
  57. package/components/InputPin/style.ts +0 -22
  58. package/components/MenuItem/index.tsx +0 -25
  59. package/components/MenuItem/style.ts +0 -44
  60. package/components/NavigationTitle/index.tsx +0 -53
  61. package/components/NavigationTitle/style.ts +0 -49
  62. package/components/Notification/index.tsx +0 -44
  63. package/components/Notification/style.ts +0 -50
  64. package/components/PreventDoubleClick/index.tsx +0 -28
  65. package/components/Select/index.tsx +0 -51
  66. package/components/Select/style.ts +0 -64
  67. package/components/SwipeablePanel/index.tsx +0 -208
  68. package/components/SwipeablePanel/style.ts +0 -81
  69. package/components/Switch/index.tsx +0 -30
  70. package/components/TakePicture/confirmPictureModal.tsx +0 -37
  71. package/components/TakePicture/index.tsx +0 -148
  72. package/components/TakePicture/style.ts +0 -95
  73. package/components/Text/index.tsx +0 -33
  74. package/components/Text/style.ts +0 -101
  75. package/components/Textarea/index.tsx +0 -26
  76. package/components/Textarea/style.ts +0 -38
  77. package/components/TimeOutButton/index.tsx +0 -67
  78. package/components/TimeOutButton/style.ts +0 -42
  79. package/components/Toast/index.tsx +0 -34
  80. package/components/Toast/style.ts +0 -12
  81. package/components/UploadDocument/index.tsx +0 -179
  82. package/components/UploadDocument/style.ts +0 -57
  83. package/components/VirtualKeyboard/index.tsx +0 -75
  84. package/components/VirtualKeyboard/style.ts +0 -25
  85. package/components/index.ts +0 -29
  86. package/configs/constants.ts +0 -273
  87. package/configs/types.ts +0 -326
  88. package/eas.json +0 -27
  89. package/eslint.config.mjs +0 -205
  90. package/hooks/index.ts +0 -2
  91. package/hooks/useDebounce.tsx +0 -24
  92. package/hooks/useLoadFonts.tsx +0 -13
  93. package/metro.config.js +0 -11
  94. package/prettier.config.mjs +0 -23
  95. package/stories/Button.stories.tsx +0 -181
  96. package/stories/Card.stories.tsx +0 -22
  97. package/stories/Colors.stories.tsx +0 -57
  98. package/stories/ConfirmationModal.stories.tsx +0 -142
  99. package/stories/Container.stories.tsx +0 -105
  100. package/stories/DeckSwiper.stories.tsx +0 -43
  101. package/stories/DonutCountdown.stories.tsx +0 -134
  102. package/stories/FloatingContainer.stories.tsx +0 -139
  103. package/stories/Footer.stories.tsx +0 -65
  104. package/stories/Header.stories.tsx +0 -37
  105. package/stories/ImagePicker.stories.tsx +0 -14
  106. package/stories/ImageResponsive.stories.tsx +0 -18
  107. package/stories/ImageViewer.stories.tsx +0 -24
  108. package/stories/Input.stories.tsx +0 -119
  109. package/stories/InputPin.stories.tsx +0 -40
  110. package/stories/Menu.stories.tsx +0 -53
  111. package/stories/MenuItem.stories.tsx +0 -30
  112. package/stories/NavigationTitle.stories.tsx +0 -51
  113. package/stories/Notification.stories.tsx +0 -58
  114. package/stories/Select.stories.tsx +0 -270
  115. package/stories/SwipeablePanel.stories.tsx +0 -360
  116. package/stories/Switch.stories.tsx +0 -36
  117. package/stories/TakePicture.stories.tsx +0 -59
  118. package/stories/Text.stories.tsx +0 -61
  119. package/stories/Textarea.stories.tsx +0 -48
  120. package/stories/TimeOutButton.stories.tsx +0 -55
  121. package/stories/Toast.stories.tsx +0 -37
  122. package/stories/UploadDocument.stories.tsx +0 -179
  123. package/stories/VirtualKeyboard.stories.tsx +0 -14
  124. package/tsconfig.json +0 -21
  125. package/utilities/ScrollView.tsx +0 -19
  126. package/utilities/index.ts +0 -2
  127. package/utilities/utils.ts +0 -29
package/README.md CHANGED
@@ -14,7 +14,7 @@ Run the command: `npm publish` this will build the lib before publishing.
14
14
 
15
15
  #### How to set up
16
16
 
17
- `import { asyncLoadFont } from from 'react-native-holper-storybook';` and call the `asyncLoadFont` function in your app entry point.
17
+ `import { useLoadFonts } from from 'react-native-holper-storybook';` and call the `useLoadFonts` function in your app entry point.
18
18
 
19
19
  ```
20
20
  import { useEffect, useState } from 'react';
@@ -1,8 +1,9 @@
1
- import { StyleSheet } from 'react-native';
1
+ import { Platform, StyleSheet } from 'react-native';
2
2
 
3
3
  export default StyleSheet.create({
4
4
  center: {
5
5
  justifyContent: 'center',
6
6
  alignItems: 'center',
7
+ top: Platform.OS === 'android' ? 4 : 0,
7
8
  },
8
9
  });
@@ -1,4 +1,4 @@
1
- import { Dimensions, StyleSheet } from 'react-native';
1
+ import { Dimensions, Platform, StyleSheet } from 'react-native';
2
2
 
3
3
  import { borderRadius, Colors } from '../../configs/constants';
4
4
 
@@ -27,6 +27,7 @@ export default StyleSheet.create({
27
27
  fontFamily: 'poppins_regular',
28
28
  backgroundColor: Colors.white,
29
29
  marginVertical: 6,
30
+ paddingTop: Platform.OS === 'android' ? 14 : 0,
30
31
  },
31
32
  fixedSize: {
32
33
  width: width - 60,
@@ -29,6 +29,7 @@ const Select = ({
29
29
  Icon={() => <Feather name="chevron-down" size={24} style={style.iconStyle} />}
30
30
  useNativeAndroidPickerStyle={false}
31
31
  pickerProps={{ mode: 'dropdown', enabled: !disabled, itemStyle: style.itemStyle }}
32
+ dropdownItemStyle={style.dropdownStyle}
32
33
  style={{
33
34
  inputIOSContainer: { pointerEvents: 'none', ...style.basicStyle, ...style[`${variant}Container`] },
34
35
  inputAndroidContainer: { ...style.basicStyle, ...style[`${variant}Container`] },
@@ -1,4 +1,4 @@
1
- import { Dimensions, StyleSheet } from 'react-native';
1
+ import { Dimensions, Platform, StyleSheet } from 'react-native';
2
2
 
3
3
  import { borderRadius, Colors } from '../../configs/constants';
4
4
 
@@ -42,6 +42,7 @@ export default StyleSheet.create({
42
42
  flex: 1,
43
43
  color: Colors.darkblue,
44
44
  fontFamily: 'poppins_regular',
45
+ top: Platform.OS === 'android' ? 2 : 0,
45
46
  },
46
47
  errorFontStyle: {
47
48
  color: Colors.red,
@@ -56,6 +57,10 @@ export default StyleSheet.create({
56
57
  marginTop: 12,
57
58
  color: Colors.darkblue,
58
59
  },
60
+ dropdownStyle: {
61
+ backgroundColor: Colors.white,
62
+ color: Colors.darkblue,
63
+ },
59
64
  itemStyle: {
60
65
  color: Colors.darkblue,
61
66
  fontFamily: 'poppins_regular',
@@ -1,4 +1,5 @@
1
1
  import { Ionicons } from '@expo/vector-icons';
2
+ import { useColorScheme } from 'react-native';
2
3
  import { toast, Toaster } from 'sonner-native';
3
4
 
4
5
  import { Colors } from '../../configs/constants';
@@ -6,26 +7,39 @@ import style from './style';
6
7
 
7
8
  import type { ToastMessageProps } from '../../configs/types';
8
9
 
9
- const Toast = () => (
10
- <Toaster
11
- autoWiggleOnUpdate="toast-change"
12
- closeButton
13
- duration={3000}
14
- icons={{
15
- error: <Ionicons name="alert-circle-outline" color={Colors.darkred} size={30} />,
16
- success: <Ionicons name="checkmark-circle-outline" color={Colors.darkgreen} size={30} />,
17
- }}
18
- pauseWhenPageIsHidden
19
- position="top-center"
20
- richColors
21
- swipeToDismissDirection="up"
22
- visibleToasts={4}
23
- toastOptions={{
24
- titleStyle: style.titleStyle,
25
- descriptionStyle: style.descriptionStyle,
26
- }}
27
- />
28
- );
10
+ const Toast = () => {
11
+ const colorScheme = useColorScheme();
12
+ const isDarkMode = colorScheme === 'dark';
13
+
14
+ return (
15
+ <Toaster
16
+ autoWiggleOnUpdate="toast-change"
17
+ closeButton
18
+ duration={3000}
19
+ icons={{
20
+ error: (
21
+ <Ionicons name="alert-circle-outline" color={isDarkMode ? Colors.brightred : Colors.darkred} size={30} />
22
+ ),
23
+ success: (
24
+ <Ionicons
25
+ name="checkmark-circle-outline"
26
+ color={isDarkMode ? Colors.brightgreen : Colors.darkgreen}
27
+ size={30}
28
+ />
29
+ ),
30
+ }}
31
+ pauseWhenPageIsHidden
32
+ position="top-center"
33
+ richColors
34
+ swipeToDismissDirection="up"
35
+ visibleToasts={4}
36
+ toastOptions={{
37
+ titleStyle: style.titleStyle,
38
+ descriptionStyle: style.descriptionStyle,
39
+ }}
40
+ />
41
+ );
42
+ };
29
43
 
30
44
  export const sendMessage = ({ variant, message, description }: ToastMessageProps) => {
31
45
  toast[variant](message, { description });
@@ -8,6 +8,7 @@ export const Colors = {
8
8
  whiteice: '#E7EAEE',
9
9
  whitepearl: '#F7F8F9',
10
10
  // Greens
11
+ brightgreen: '#8AE8AD',
11
12
  darkgreen: '#008A2E',
12
13
  green: '#3FE384',
13
14
  lightergreen: '#F5FEFA',
@@ -28,6 +29,7 @@ export const Colors = {
28
29
  placeboPurple: '#F0ECFE',
29
30
  violet: '#300049',
30
31
  // Reds
32
+ brightred: '#E6A3A6',
31
33
  darkred: '#E60606',
32
34
  lightred: '#FFC1C1',
33
35
  red: '#FD4C4C',
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
- "version": "0.7.0",
3
2
  "main": "lib/index.js",
3
+ "version": "0.7.2",
4
4
  "name": "@holper/react-native-holper-storybook",
5
5
  "description": "A component library for Holper projects",
6
6
  "license": "MIT",
7
+ "files": [
8
+ "lib",
9
+ "index.js"
10
+ ],
7
11
  "packageManager": "yarn@4.5.0",
8
12
  "homepage": "https://github.com/holperapp/holper-storybook",
9
13
  "repository": {
package/.expo/README.md DELETED
@@ -1,8 +0,0 @@
1
- > Why do I have a folder named ".expo" in my project?
2
- The ".expo" folder is created when an Expo project is started using "expo start" command.
3
- > What do the files contain?
4
- - "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
5
- - "settings.json": contains the server configuration that is used to serve the application manifest.
6
- > Should I commit the ".expo" folder?
7
- No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
8
- Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 22.17.0
package/.prettierignore DELETED
@@ -1,5 +0,0 @@
1
- # Ignore artifacts:
2
- build
3
- coverage
4
- # Ignore .storybook directory
5
- .storybook
@@ -1,11 +0,0 @@
1
- import AsyncStorage from '@react-native-async-storage/async-storage';
2
- import { view } from './storybook.requires';
3
-
4
- const StorybookUIRoot = view.getStorybookUI({
5
- storage: {
6
- getItem: AsyncStorage.getItem,
7
- setItem: AsyncStorage.setItem,
8
- },
9
- });
10
-
11
- export default StorybookUIRoot;
@@ -1,8 +0,0 @@
1
- /** @type{import("@storybook/react-native").StorybookConfig} */
2
- module.exports = {
3
- stories: ['../stories/**/*.stories.?(ts|tsx|js|jsx)'],
4
- addons: [
5
- '@storybook/addon-ondevice-controls',
6
- '@storybook/addon-ondevice-actions',
7
- ],
8
- };
@@ -1,51 +0,0 @@
1
- import { View } from 'react-native';
2
- import * as SplashScreen from 'expo-splash-screen';
3
- import { useLoadFonts } from '../hooks';
4
- import { Colors } from '../configs/constants';
5
- import { useEffect } from 'react';
6
-
7
- SplashScreen.preventAutoHideAsync();
8
-
9
- /** @type{import("@storybook/react").Preview} */
10
- const preview = {
11
- parameters: {
12
- controls: {
13
- matchers: {
14
- color: /(background|color)$/i,
15
- date: /Date$/,
16
- },
17
- },
18
- },
19
-
20
- decorators: [
21
- (Story, { parameters }) => {
22
- const { loaded, error } = useLoadFonts();
23
-
24
- useEffect(() => {
25
- if (loaded || error) {
26
- SplashScreen.hideAsync();
27
- }
28
- }, [loaded, error]);
29
-
30
- if (!loaded && !error) {
31
- return null;
32
- }
33
-
34
- return (
35
- <View
36
- style={{
37
- flex: 1,
38
- justifyContent: 'center',
39
- alignItems: 'center',
40
- backgroundColor: parameters.noBackground === true ? undefined : Colors.whiteice,
41
- padding: 8,
42
- }}
43
- >
44
- <Story />
45
- </View>
46
- );
47
- },
48
- ],
49
- };
50
-
51
- export default preview;
@@ -1,43 +0,0 @@
1
- /* do not change this file, it is auto generated by storybook. */
2
-
3
- import { start, updateView } from "@storybook/react-native";
4
-
5
- import "@storybook/addon-ondevice-controls/register";
6
- import "@storybook/addon-ondevice-actions/register";
7
-
8
- const normalizedStories = [
9
- {
10
- titlePrefix: "",
11
- directory: "./stories",
12
- files: "**/*.stories.?(ts|tsx|js|jsx)",
13
- importPathMatcher:
14
- /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
15
-
16
- req: require.context(
17
- "../stories",
18
- true,
19
- /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
20
- ),
21
- },
22
- ];
23
-
24
- const annotations = [
25
- require("./preview"),
26
- require("@storybook/react-native/dist/preview"),
27
- require("@storybook/addon-actions/preview"),
28
- ];
29
-
30
- global.STORIES = normalizedStories;
31
-
32
- module?.hot?.accept?.();
33
-
34
- if (!global.view) {
35
- global.view = start({
36
- annotations,
37
- storyEntries: normalizedStories,
38
- });
39
- } else {
40
- updateView(global.view, annotations, normalizedStories);
41
- }
42
-
43
- export const view = global.view;