@holper/react-native-holper-storybook 0.7.0 → 0.7.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.
Files changed (121) hide show
  1. package/README.md +1 -1
  2. package/package.json +5 -1
  3. package/.expo/README.md +0 -8
  4. package/.nvmrc +0 -1
  5. package/.prettierignore +0 -5
  6. package/.storybook/index.jsx +0 -11
  7. package/.storybook/main.js +0 -8
  8. package/.storybook/preview.jsx +0 -51
  9. package/.storybook/storybook.requires.js +0 -43
  10. package/.yarn/releases/yarn-4.5.0.cjs +0 -925
  11. package/.yarnrc.yml +0 -3
  12. package/App.jsx +0 -29
  13. package/app.config.js +0 -77
  14. package/assets/adaptive-icon.png +0 -0
  15. package/assets/favicon.png +0 -0
  16. package/assets/fonts/Poppins-Bold.ttf +0 -0
  17. package/assets/fonts/Poppins-Regular.ttf +0 -0
  18. package/assets/fonts/Poppins-SemiBold.ttf +0 -0
  19. package/assets/icon.png +0 -0
  20. package/assets/splash.png +0 -0
  21. package/babel.config.js +0 -7
  22. package/build.sh +0 -11
  23. package/components/Button/index.tsx +0 -66
  24. package/components/Button/style.ts +0 -111
  25. package/components/Card/index.tsx +0 -33
  26. package/components/Card/style.ts +0 -34
  27. package/components/ConfirmationModal/index.tsx +0 -104
  28. package/components/ConfirmationModal/style.tsx +0 -53
  29. package/components/Container/index.tsx +0 -33
  30. package/components/Container/style.ts +0 -13
  31. package/components/CustomChatView/index.tsx +0 -65
  32. package/components/CustomChatView/style.ts +0 -10
  33. package/components/DeckSwiper/index.tsx +0 -90
  34. package/components/DeckSwiper/style.ts +0 -59
  35. package/components/DonutCountdown/index.tsx +0 -86
  36. package/components/DonutCountdown/style.ts +0 -8
  37. package/components/FloatingContainer/index.tsx +0 -35
  38. package/components/FloatingContainer/style.ts +0 -25
  39. package/components/Footer/index.tsx +0 -35
  40. package/components/Footer/style.ts +0 -40
  41. package/components/Header/index.tsx +0 -21
  42. package/components/Header/style.ts +0 -34
  43. package/components/ImagePicker/index.tsx +0 -18
  44. package/components/ImageResponsive/index.tsx +0 -24
  45. package/components/ImageResponsive/style.ts +0 -9
  46. package/components/ImageViewer/index.tsx +0 -36
  47. package/components/ImageViewer/style.ts +0 -38
  48. package/components/Input/index.tsx +0 -62
  49. package/components/Input/style.ts +0 -91
  50. package/components/InputPin/index.tsx +0 -21
  51. package/components/InputPin/style.ts +0 -22
  52. package/components/MenuItem/index.tsx +0 -25
  53. package/components/MenuItem/style.ts +0 -44
  54. package/components/NavigationTitle/index.tsx +0 -53
  55. package/components/NavigationTitle/style.ts +0 -49
  56. package/components/Notification/index.tsx +0 -44
  57. package/components/Notification/style.ts +0 -50
  58. package/components/PreventDoubleClick/index.tsx +0 -28
  59. package/components/Select/index.tsx +0 -51
  60. package/components/Select/style.ts +0 -64
  61. package/components/SwipeablePanel/index.tsx +0 -208
  62. package/components/SwipeablePanel/style.ts +0 -81
  63. package/components/Switch/index.tsx +0 -30
  64. package/components/TakePicture/confirmPictureModal.tsx +0 -37
  65. package/components/TakePicture/index.tsx +0 -148
  66. package/components/TakePicture/style.ts +0 -95
  67. package/components/Text/index.tsx +0 -33
  68. package/components/Text/style.ts +0 -101
  69. package/components/Textarea/index.tsx +0 -26
  70. package/components/Textarea/style.ts +0 -38
  71. package/components/TimeOutButton/index.tsx +0 -67
  72. package/components/TimeOutButton/style.ts +0 -42
  73. package/components/Toast/index.tsx +0 -34
  74. package/components/Toast/style.ts +0 -12
  75. package/components/UploadDocument/index.tsx +0 -179
  76. package/components/UploadDocument/style.ts +0 -57
  77. package/components/VirtualKeyboard/index.tsx +0 -75
  78. package/components/VirtualKeyboard/style.ts +0 -25
  79. package/components/index.ts +0 -29
  80. package/configs/constants.ts +0 -273
  81. package/configs/types.ts +0 -326
  82. package/eas.json +0 -27
  83. package/eslint.config.mjs +0 -205
  84. package/hooks/index.ts +0 -2
  85. package/hooks/useDebounce.tsx +0 -24
  86. package/hooks/useLoadFonts.tsx +0 -13
  87. package/metro.config.js +0 -11
  88. package/prettier.config.mjs +0 -23
  89. package/stories/Button.stories.tsx +0 -181
  90. package/stories/Card.stories.tsx +0 -22
  91. package/stories/Colors.stories.tsx +0 -57
  92. package/stories/ConfirmationModal.stories.tsx +0 -142
  93. package/stories/Container.stories.tsx +0 -105
  94. package/stories/DeckSwiper.stories.tsx +0 -43
  95. package/stories/DonutCountdown.stories.tsx +0 -134
  96. package/stories/FloatingContainer.stories.tsx +0 -139
  97. package/stories/Footer.stories.tsx +0 -65
  98. package/stories/Header.stories.tsx +0 -37
  99. package/stories/ImagePicker.stories.tsx +0 -14
  100. package/stories/ImageResponsive.stories.tsx +0 -18
  101. package/stories/ImageViewer.stories.tsx +0 -24
  102. package/stories/Input.stories.tsx +0 -119
  103. package/stories/InputPin.stories.tsx +0 -40
  104. package/stories/Menu.stories.tsx +0 -53
  105. package/stories/MenuItem.stories.tsx +0 -30
  106. package/stories/NavigationTitle.stories.tsx +0 -51
  107. package/stories/Notification.stories.tsx +0 -58
  108. package/stories/Select.stories.tsx +0 -270
  109. package/stories/SwipeablePanel.stories.tsx +0 -360
  110. package/stories/Switch.stories.tsx +0 -36
  111. package/stories/TakePicture.stories.tsx +0 -59
  112. package/stories/Text.stories.tsx +0 -61
  113. package/stories/Textarea.stories.tsx +0 -48
  114. package/stories/TimeOutButton.stories.tsx +0 -55
  115. package/stories/Toast.stories.tsx +0 -37
  116. package/stories/UploadDocument.stories.tsx +0 -179
  117. package/stories/VirtualKeyboard.stories.tsx +0 -14
  118. package/tsconfig.json +0 -21
  119. package/utilities/ScrollView.tsx +0 -19
  120. package/utilities/index.ts +0 -2
  121. package/utilities/utils.ts +0 -29
package/eslint.config.mjs DELETED
@@ -1,205 +0,0 @@
1
- import { default as eslintJs } from '@eslint/js';
2
- import importPlugin from 'eslint-plugin-import';
3
- import perfectionistPlugin from 'eslint-plugin-perfectionist';
4
- import reactPlugin from 'eslint-plugin-react';
5
- import reactHooksPlugin from 'eslint-plugin-react-hooks';
6
- import unusedImportsPlugin from 'eslint-plugin-unused-imports';
7
- import globals from 'globals';
8
- import eslintTs from 'typescript-eslint';
9
- import { defineConfig, globalIgnores } from 'eslint/config';
10
-
11
- /**
12
- * @rules common
13
- * from 'react', 'eslint-plugin-react-hooks'...
14
- */
15
- const commonRules = () => ({
16
- ...reactHooksPlugin.configs.recommended.rules,
17
- 'arrow-body-style': [2, 'as-needed', { requireReturnForObjectLiteral: false }],
18
- 'class-methods-use-this': 0,
19
- 'consistent-return': 2,
20
- 'default-case-last': 2,
21
- 'default-case': [2, { commentPattern: '^no default$' }],
22
- 'func-names': 1,
23
- 'jsx-a11y/anchor-is-valid': 0,
24
- 'jsx-a11y/control-has-associated-label': 0,
25
- 'lines-around-directive': [2, { before: 'always', after: 'always' }],
26
- 'no-alert': 0,
27
- 'no-bitwise': 2,
28
- 'no-console': 0,
29
- 'no-constant-condition': 1,
30
- 'no-param-reassign': 0,
31
- 'no-promise-executor-return': 0,
32
- 'no-restricted-exports': 0,
33
- 'no-restricted-syntax': ['error', 'WithStatement'],
34
- 'no-underscore-dangle': 0,
35
- 'no-unused-vars': 0,
36
- 'no-useless-rename': 1,
37
- 'object-shorthand': 1,
38
- 'prefer-destructuring': [1, { object: true, array: false }],
39
-
40
- camelcase: 0,
41
- // react
42
- 'react/display-name': 0,
43
- 'react/function-component-definition': 0,
44
- 'react/jsx-boolean-value': 2,
45
- 'react/jsx-curly-brace-presence': [2, { props: 'never', children: 'never' }],
46
- 'react/jsx-key': 0,
47
- 'react/jsx-no-duplicate-props': [1, { ignoreCase: false }],
48
- 'react/jsx-no-useless-fragment': [1, { allowExpressions: true }],
49
- 'react/jsx-props-no-spreading': 0,
50
- 'react/no-array-index-key': 0,
51
- 'react/no-children-prop': 0,
52
- 'react/no-unstable-nested-components': [1, { allowAsProps: true }],
53
- 'react/prop-types': 0,
54
- 'react/react-in-jsx-scope': 0,
55
- 'react/require-default-props': 0,
56
- 'react/self-closing-comp': 2,
57
- // typescript
58
- '@typescript-eslint/await-thenable': 0,
59
- '@typescript-eslint/consistent-type-imports': 1,
60
- '@typescript-eslint/naming-convention': 0,
61
- '@typescript-eslint/no-empty-object-type': 0,
62
- '@typescript-eslint/no-explicit-any': 0,
63
- '@typescript-eslint/no-floating-promises': 0,
64
- '@typescript-eslint/no-require-imports': 0,
65
- '@typescript-eslint/no-shadow': 2,
66
- '@typescript-eslint/no-unused-vars': [1, { args: 'none' }],
67
- '@typescript-eslint/no-use-before-define': 0,
68
- '@typescript-eslint/no-duplicate-enum-values': 0,
69
- });
70
-
71
- /**
72
- * @rules import
73
- * from 'eslint-plugin-import'.
74
- */
75
- const importRules = () => ({
76
- ...importPlugin.configs.recommended.rules,
77
- 'import/named': 0,
78
- 'import/export': 0,
79
- 'import/default': 0,
80
- 'import/namespace': 0,
81
- 'import/no-named-as-default': 0,
82
- 'import/newline-after-import': 2,
83
- 'import/no-named-as-default-member': 0,
84
- 'import/prefer-default-export': 0,
85
- 'import/no-cycle': [
86
- 0, // disabled if slow
87
- { maxDepth: '∞', ignoreExternal: false, allowUnsafeDynamicCyclicDependency: false },
88
- ],
89
- });
90
-
91
- /**
92
- * @rules unused imports
93
- * from 'eslint-plugin-unused-imports'.
94
- */
95
- const unusedImportsRules = () => ({
96
- 'unused-imports/no-unused-imports': 0,
97
- 'unused-imports/no-unused-vars': [
98
- 0,
99
- { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
100
- ],
101
- });
102
-
103
- /**
104
- * @rules sort or imports/exports
105
- * from 'eslint-plugin-perfectionist'.
106
- */
107
- const sortImportsRules = () => {
108
- return {
109
- 'perfectionist/sort-named-imports': [1, { order: 'asc' }],
110
- 'perfectionist/sort-named-exports': [1, { order: 'asc' }],
111
- 'perfectionist/sort-exports': [
112
- 1,
113
- {
114
- order: 'asc',
115
-
116
- groupKind: 'values-first',
117
- },
118
- ],
119
- 'perfectionist/sort-imports': [
120
- 2,
121
- {
122
- order: 'asc',
123
- ignoreCase: true,
124
- environment: 'node',
125
- maxLineLength: undefined,
126
- newlinesBetween: 'always',
127
- groups: [
128
- 'style',
129
- 'side-effect',
130
- 'type',
131
- ['builtin', 'external'],
132
- 'internal',
133
- ['parent', 'sibling', 'index'],
134
- ['parent-type', 'sibling-type', 'index-type'],
135
- 'object',
136
- 'unknown',
137
- ],
138
- },
139
- ],
140
- };
141
- };
142
-
143
- /**
144
- * Custom ESLint configuration.
145
- */
146
- export const customConfig = {
147
- plugins: {
148
- 'react-hooks': reactHooksPlugin,
149
- 'unused-imports': unusedImportsPlugin,
150
- perfectionist: perfectionistPlugin,
151
- import: importPlugin,
152
- },
153
- settings: {
154
- // https://www.npmjs.com/package/eslint-import-resolver-typescript
155
- ...importPlugin.configs.typescript.settings,
156
- 'import/resolver': {
157
- typescript: { project: './tsconfig.json', alwaysTryTypes: true },
158
- ...importPlugin.configs.typescript.settings['import/resolver'],
159
- },
160
- react: {
161
- version: 'detect',
162
- },
163
- },
164
- rules: { ...commonRules(), ...importRules(), ...unusedImportsRules(), ...sortImportsRules() },
165
- };
166
-
167
- // ----------------------------------------------------------------------
168
-
169
- const eslintIgnore = globalIgnores([
170
- '.expo/',
171
- '.storybook/',
172
- '.yarn/',
173
- '**/*.d.ts',
174
- '**/node_modules',
175
- 'dist/',
176
- 'eslint.config.mjs',
177
- 'prettier.config.mjs',
178
- ]);
179
-
180
- export default defineConfig([
181
- { files: ['**/*.{ts,tsx}'] },
182
- eslintIgnore,
183
- {
184
- languageOptions: {
185
- globals: { ...globals.browser, ...globals.node },
186
- parserOptions: {
187
- ecmaFeatures: { jsx: true },
188
- project: './tsconfig.json',
189
- warnOnUnsupportedTypeScriptVersion: true,
190
- },
191
- },
192
- settings: {
193
- 'import/resolver': {
194
- node: {
195
- extensions: ['.js', '.jsx', '.ts', '.tsx'],
196
- },
197
- },
198
- },
199
- },
200
- eslintJs.configs.recommended,
201
- ...eslintTs.configs.recommended,
202
- reactPlugin.configs.flat.recommended,
203
- customConfig,
204
- { files: ['*.tsx'], rules: { '@typescript-eslint/no-floating-promises': 0 } },
205
- ]);
package/hooks/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { default as useDebounce } from './useDebounce';
2
- export { default as useLoadFonts } from './useLoadFonts';
@@ -1,24 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
-
3
- const useDebounce = (callback: () => void, delay: number | undefined) => {
4
- const latestCallback = useRef<() => void>(null);
5
- const latestTimeout = useRef<ReturnType<typeof setTimeout>>(null);
6
-
7
- useEffect(() => {
8
- latestCallback.current = callback;
9
- }, [callback]);
10
-
11
- return () => {
12
- if (latestTimeout.current) {
13
- clearTimeout(latestTimeout.current);
14
- }
15
-
16
- latestTimeout.current = setTimeout(() => {
17
- if (latestCallback.current) {
18
- latestCallback.current();
19
- }
20
- }, delay);
21
- };
22
- };
23
-
24
- export default useDebounce;
@@ -1,13 +0,0 @@
1
- import { useFonts } from 'expo-font';
2
-
3
- const useLoadFonts = () => {
4
- const [loaded, error] = useFonts({
5
- poppins_bold: require('../assets/fonts/Poppins-Bold.ttf'),
6
- poppins_regular: require('../assets/fonts/Poppins-Regular.ttf'),
7
- poppins_semiBold: require('../assets/fonts/Poppins-SemiBold.ttf'),
8
- });
9
-
10
- return { error, loaded };
11
- };
12
-
13
- export default useLoadFonts;
package/metro.config.js DELETED
@@ -1,11 +0,0 @@
1
- const withStorybook = require('@storybook/react-native/metro/withStorybook');
2
- const { getDefaultConfig } = require('expo/metro-config');
3
- const path = require('path');
4
-
5
- const defaultConfig = getDefaultConfig(__dirname);
6
-
7
- module.exports = withStorybook(defaultConfig, {
8
- configPath: path.resolve(__dirname, './.storybook'),
9
- enabled: true,
10
- useJs: true,
11
- });
@@ -1,23 +0,0 @@
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;
@@ -1,181 +0,0 @@
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
- };
@@ -1,22 +0,0 @@
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
- };
@@ -1,57 +0,0 @@
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
- };
@@ -1,142 +0,0 @@
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
- };