afrikit-mobile 1.0.18 → 1.0.19
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/.storybook/index.ts +11 -0
- package/.storybook/main.ts +11 -0
- package/.storybook/preview.tsx +14 -0
- package/.storybook/stories/AppAvatar/AppAvatar.stories.tsx +145 -0
- package/.storybook/stories/AppBottomSheet/AppBottomSheet.stories.tsx +165 -0
- package/.storybook/stories/AppButton/AppButton.stories.tsx +242 -0
- package/.storybook/stories/AppDateInput/AppDateInput.stories.tsx +94 -0
- package/.storybook/stories/AppHintText/AppHintText.stories.tsx +84 -0
- package/.storybook/stories/AppIcon/AppIcon.stories.tsx +39 -0
- package/.storybook/stories/AppInput/AppInput.stories.tsx +82 -0
- package/.storybook/stories/AppList/AppList.stories.tsx +214 -0
- package/.storybook/stories/AppModalLoader.tsx/AppModalLoader.stories.tsx +83 -0
- package/.storybook/stories/AppPasswordInput/AppPassword.stories.tsx +81 -0
- package/.storybook/stories/AppPhoneInput/AppPhoneInput.stories.tsx +59 -0
- package/.storybook/stories/AppSearchInput/AppSearchInput.stories.tsx +51 -0
- package/.storybook/stories/AppSelect/AppSelect.stories.tsx +125 -0
- package/.storybook/stories/AppText/AppText.stories.tsx +165 -0
- package/.storybook/stories/AppTitle/AppTitle.stories.tsx +106 -0
- package/.storybook/stories/AppToast/AppToast.stories.tsx +65 -0
- package/.storybook/stories/AppTopBar/AppTopBar.stories.tsx +136 -0
- package/.storybook/stories/AuthInput/AuthInput.stories.tsx +65 -0
- package/.storybook/stories/CodeInput/CodeInput.stories.tsx +75 -0
- package/.storybook/stories/GlobalWrapper/GlobalWrapper.stories.tsx +59 -0
- package/.storybook/stories/KeyPad/KeyPad.stories.tsx +67 -0
- package/.storybook/storybook.requires.ts +57 -0
- package/App.tsx +345 -0
- package/CHANGELOG.md +80 -0
- package/app.config.js +42 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash.png +0 -0
- package/atoms/AppText.tsx +125 -0
- package/atoms/AppTitle.tsx +35 -0
- package/atoms/index.ts +2 -0
- package/babel.config.js +7 -0
- package/components/molecules/FloatingButton.tsx +38 -0
- package/components/molecules/IconButton.tsx +31 -0
- package/components/molecules/TopBarTitle.tsx +81 -0
- package/{dist/components/molecules/index.d.ts → components/molecules/index.tsx} +0 -1
- package/eas.json +22 -0
- package/entrance.ts +8 -0
- package/global.css +3 -0
- package/index.ts +6 -0
- package/metro.config.js +13 -0
- package/molecules/AppAvatar/avatar.ts +163 -0
- package/molecules/AppAvatar/index.tsx +73 -0
- package/molecules/AppBottomSheet/RenderedSheet.tsx +113 -0
- package/molecules/AppBottomSheet/checkBottomSheetProps.ts +64 -0
- package/molecules/AppBottomSheet/index.tsx +156 -0
- package/molecules/AppButton/button.ts +152 -0
- package/molecules/AppButton/index.tsx +103 -0
- package/molecules/AppDateInput/index.tsx +182 -0
- package/molecules/AppHintText/index.tsx +56 -0
- package/molecules/AppIcon.tsx +43 -0
- package/molecules/AppInput.tsx +168 -0
- package/molecules/AppModalLoader/AppModalLoader.tsx +129 -0
- package/molecules/AppModalLoader/index.ts +3 -0
- package/molecules/AppPasswordInput.tsx +184 -0
- package/molecules/AppPhoneInput.tsx +173 -0
- package/molecules/AppSearchInput.tsx +134 -0
- package/molecules/AppSelect/index.tsx +179 -0
- package/molecules/AppTopBar/AppTopBar.tsx +189 -0
- package/{dist/molecules/AppTopBar/index.d.ts → molecules/AppTopBar/index.ts} +2 -1
- package/molecules/AuthInput.tsx +104 -0
- package/molecules/CodeInput.tsx +88 -0
- package/molecules/GlobalWrapper/GlobalWrapper.tsx +55 -0
- package/molecules/GlobalWrapper/index.ts +3 -0
- package/molecules/app-toast.tsx +91 -0
- package/molecules/index.ts +18 -0
- package/molecules/keypad.tsx +91 -0
- package/molecules/list-item.tsx +379 -0
- package/nativewind-env.d.ts +1 -0
- package/organisms/index.ts +0 -0
- package/package.json +8 -12
- package/postcss.config.js +7 -0
- package/readme.md +112 -0
- package/tailwind.config.js +85 -0
- package/tsconfig.json +43 -0
- package/types/atoms.d.ts +93 -0
- package/types/index.ts +2 -0
- package/types/molecules.d.ts +38 -0
- package/utilities/classnames.ts +7 -0
- package/utilities/getInitials.ts +40 -0
- package/utilities/validation.tsx +35 -0
- package/dist/atoms/AppText.d.ts +0 -5
- package/dist/atoms/AppText.d.ts.map +0 -1
- package/dist/atoms/AppText.js +0 -119
- package/dist/atoms/AppText.js.map +0 -1
- package/dist/atoms/AppTitle.d.ts +0 -6
- package/dist/atoms/AppTitle.d.ts.map +0 -1
- package/dist/atoms/AppTitle.js +0 -14
- package/dist/atoms/AppTitle.js.map +0 -1
- package/dist/atoms/index.d.ts +0 -3
- package/dist/atoms/index.d.ts.map +0 -1
- package/dist/atoms/index.js +0 -11
- package/dist/atoms/index.js.map +0 -1
- package/dist/components/molecules/FloatingButton.d.ts +0 -8
- package/dist/components/molecules/FloatingButton.d.ts.map +0 -1
- package/dist/components/molecules/FloatingButton.js +0 -31
- package/dist/components/molecules/FloatingButton.js.map +0 -1
- package/dist/components/molecules/IconButton.d.ts +0 -10
- package/dist/components/molecules/IconButton.d.ts.map +0 -1
- package/dist/components/molecules/IconButton.js +0 -31
- package/dist/components/molecules/IconButton.js.map +0 -1
- package/dist/components/molecules/TopBarTitle.d.ts +0 -24
- package/dist/components/molecules/TopBarTitle.d.ts.map +0 -1
- package/dist/components/molecules/TopBarTitle.js +0 -49
- package/dist/components/molecules/TopBarTitle.js.map +0 -1
- package/dist/components/molecules/index.d.ts.map +0 -1
- package/dist/components/molecules/index.js +0 -16
- package/dist/components/molecules/index.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/molecules/AppAvatar/avatar.d.ts +0 -26
- package/dist/molecules/AppAvatar/avatar.d.ts.map +0 -1
- package/dist/molecules/AppAvatar/avatar.js +0 -141
- package/dist/molecules/AppAvatar/avatar.js.map +0 -1
- package/dist/molecules/AppAvatar/index.d.ts +0 -5
- package/dist/molecules/AppAvatar/index.d.ts.map +0 -1
- package/dist/molecules/AppAvatar/index.js +0 -38
- package/dist/molecules/AppAvatar/index.js.map +0 -1
- package/dist/molecules/AppBottomSheet/RenderedSheet.d.ts +0 -12
- package/dist/molecules/AppBottomSheet/RenderedSheet.d.ts.map +0 -1
- package/dist/molecules/AppBottomSheet/RenderedSheet.js +0 -25
- package/dist/molecules/AppBottomSheet/RenderedSheet.js.map +0 -1
- package/dist/molecules/AppBottomSheet/checkBottomSheetProps.d.ts +0 -3
- package/dist/molecules/AppBottomSheet/checkBottomSheetProps.d.ts.map +0 -1
- package/dist/molecules/AppBottomSheet/checkBottomSheetProps.js +0 -64
- package/dist/molecules/AppBottomSheet/checkBottomSheetProps.js.map +0 -1
- package/dist/molecules/AppBottomSheet/index.d.ts +0 -5
- package/dist/molecules/AppBottomSheet/index.d.ts.map +0 -1
- package/dist/molecules/AppBottomSheet/index.js +0 -98
- package/dist/molecules/AppBottomSheet/index.js.map +0 -1
- package/dist/molecules/AppButton/button.d.ts +0 -15
- package/dist/molecules/AppButton/button.d.ts.map +0 -1
- package/dist/molecules/AppButton/button.js +0 -132
- package/dist/molecules/AppButton/button.js.map +0 -1
- package/dist/molecules/AppButton/index.d.ts +0 -21
- package/dist/molecules/AppButton/index.d.ts.map +0 -1
- package/dist/molecules/AppButton/index.js +0 -28
- package/dist/molecules/AppButton/index.js.map +0 -1
- package/dist/molecules/AppDateInput/index.d.ts +0 -13
- package/dist/molecules/AppDateInput/index.d.ts.map +0 -1
- package/dist/molecules/AppDateInput/index.js +0 -69
- package/dist/molecules/AppDateInput/index.js.map +0 -1
- package/dist/molecules/AppHintText/index.d.ts +0 -12
- package/dist/molecules/AppHintText/index.d.ts.map +0 -1
- package/dist/molecules/AppHintText/index.js +0 -25
- package/dist/molecules/AppHintText/index.js.map +0 -1
- package/dist/molecules/AppIcon.d.ts +0 -9
- package/dist/molecules/AppIcon.d.ts.map +0 -1
- package/dist/molecules/AppIcon.js +0 -28
- package/dist/molecules/AppIcon.js.map +0 -1
- package/dist/molecules/AppInput.d.ts +0 -5
- package/dist/molecules/AppInput.d.ts.map +0 -1
- package/dist/molecules/AppInput.js +0 -127
- package/dist/molecules/AppInput.js.map +0 -1
- package/dist/molecules/AppModalLoader/AppModalLoader.d.ts +0 -25
- package/dist/molecules/AppModalLoader/AppModalLoader.d.ts.map +0 -1
- package/dist/molecules/AppModalLoader/AppModalLoader.js +0 -64
- package/dist/molecules/AppModalLoader/AppModalLoader.js.map +0 -1
- package/dist/molecules/AppModalLoader/index.d.ts +0 -3
- package/dist/molecules/AppModalLoader/index.d.ts.map +0 -1
- package/dist/molecules/AppModalLoader/index.js +0 -6
- package/dist/molecules/AppModalLoader/index.js.map +0 -1
- package/dist/molecules/AppPasswordInput.d.ts +0 -5
- package/dist/molecules/AppPasswordInput.d.ts.map +0 -1
- package/dist/molecules/AppPasswordInput.js +0 -131
- package/dist/molecules/AppPasswordInput.js.map +0 -1
- package/dist/molecules/AppPhoneInput.d.ts +0 -5
- package/dist/molecules/AppPhoneInput.d.ts.map +0 -1
- package/dist/molecules/AppPhoneInput.js +0 -124
- package/dist/molecules/AppPhoneInput.js.map +0 -1
- package/dist/molecules/AppSearchInput.d.ts +0 -5
- package/dist/molecules/AppSearchInput.d.ts.map +0 -1
- package/dist/molecules/AppSearchInput.js +0 -99
- package/dist/molecules/AppSearchInput.js.map +0 -1
- package/dist/molecules/AppSelect/index.d.ts +0 -18
- package/dist/molecules/AppSelect/index.d.ts.map +0 -1
- package/dist/molecules/AppSelect/index.js +0 -88
- package/dist/molecules/AppSelect/index.js.map +0 -1
- package/dist/molecules/AppTopBar/AppTopBar.d.ts +0 -64
- package/dist/molecules/AppTopBar/AppTopBar.d.ts.map +0 -1
- package/dist/molecules/AppTopBar/AppTopBar.js +0 -55
- package/dist/molecules/AppTopBar/AppTopBar.js.map +0 -1
- package/dist/molecules/AppTopBar/index.d.ts.map +0 -1
- package/dist/molecules/AppTopBar/index.js +0 -6
- package/dist/molecules/AppTopBar/index.js.map +0 -1
- package/dist/molecules/AuthInput.d.ts +0 -12
- package/dist/molecules/AuthInput.d.ts.map +0 -1
- package/dist/molecules/AuthInput.js +0 -53
- package/dist/molecules/AuthInput.js.map +0 -1
- package/dist/molecules/CodeInput.d.ts +0 -11
- package/dist/molecules/CodeInput.d.ts.map +0 -1
- package/dist/molecules/CodeInput.js +0 -58
- package/dist/molecules/CodeInput.js.map +0 -1
- package/dist/molecules/GlobalWrapper/GlobalWrapper.d.ts +0 -9
- package/dist/molecules/GlobalWrapper/GlobalWrapper.d.ts.map +0 -1
- package/dist/molecules/GlobalWrapper/GlobalWrapper.js +0 -25
- package/dist/molecules/GlobalWrapper/GlobalWrapper.js.map +0 -1
- package/dist/molecules/GlobalWrapper/index.d.ts +0 -3
- package/dist/molecules/GlobalWrapper/index.d.ts.map +0 -1
- package/dist/molecules/GlobalWrapper/index.js +0 -6
- package/dist/molecules/GlobalWrapper/index.js.map +0 -1
- package/dist/molecules/app-toast.d.ts +0 -16
- package/dist/molecules/app-toast.d.ts.map +0 -1
- package/dist/molecules/app-toast.js +0 -101
- package/dist/molecules/app-toast.js.map +0 -1
- package/dist/molecules/index.d.ts +0 -17
- package/dist/molecules/index.d.ts.map +0 -1
- package/dist/molecules/index.js +0 -40
- package/dist/molecules/index.js.map +0 -1
- package/dist/molecules/keypad.d.ts +0 -13
- package/dist/molecules/keypad.d.ts.map +0 -1
- package/dist/molecules/keypad.js +0 -51
- package/dist/molecules/keypad.js.map +0 -1
- package/dist/molecules/list-item.d.ts +0 -61
- package/dist/molecules/list-item.d.ts.map +0 -1
- package/dist/molecules/list-item.js +0 -153
- package/dist/molecules/list-item.js.map +0 -1
- package/dist/organisms/index.d.ts +0 -1
- package/dist/organisms/index.d.ts.map +0 -1
- package/dist/organisms/index.js +0 -2
- package/dist/organisms/index.js.map +0 -1
- package/dist/utilities/classnames.d.ts +0 -3
- package/dist/utilities/classnames.d.ts.map +0 -1
- package/dist/utilities/classnames.js +0 -8
- package/dist/utilities/classnames.js.map +0 -1
- package/dist/utilities/getInitials.d.ts +0 -3
- package/dist/utilities/getInitials.d.ts.map +0 -1
- package/dist/utilities/getInitials.js +0 -34
- package/dist/utilities/getInitials.js.map +0 -1
- package/dist/utilities/validation.d.ts +0 -3
- package/dist/utilities/validation.d.ts.map +0 -1
- package/dist/utilities/validation.js +0 -28
- package/dist/utilities/validation.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StorybookConfig } from '@storybook/react-native';
|
|
2
|
+
|
|
3
|
+
const main: StorybookConfig = {
|
|
4
|
+
stories: ['./stories/**/*.stories.?(ts|tsx|js|jsx)'],
|
|
5
|
+
addons: [
|
|
6
|
+
'@storybook/addon-ondevice-controls',
|
|
7
|
+
'@storybook/addon-ondevice-actions',
|
|
8
|
+
],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default main;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { View } from 'react-native'
|
|
4
|
+
import AppAvatar from '../../../molecules/AppAvatar'
|
|
5
|
+
import { AppAvatarProps } from '../../../molecules/AppAvatar/avatar'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'AppAvatar',
|
|
9
|
+
component: AppAvatar,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
Story => (
|
|
13
|
+
<View style={{ alignItems: 'center', justifyContent: 'center', flex: 1, padding: 10 }}>
|
|
14
|
+
<Story />
|
|
15
|
+
</View>
|
|
16
|
+
),
|
|
17
|
+
],
|
|
18
|
+
argTypes: {
|
|
19
|
+
size: { control: 'select', options: [1, 2, 3, 4, 5, 6, 7, 8, 9] },
|
|
20
|
+
variant: { control: 'select', options: ['solid', 'soft'] },
|
|
21
|
+
color: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['accent', 'neutral', 'success', 'error', 'warning', 'info'],
|
|
24
|
+
},
|
|
25
|
+
highContrast: { control: 'boolean' },
|
|
26
|
+
fallBack: { control: 'select', options: ['image', 'initials', 'icon'] },
|
|
27
|
+
initials: { control: 'text' },
|
|
28
|
+
imageUrl: { control: 'text' },
|
|
29
|
+
numberOfInitials: { control: 'select', options: [1, 2] },
|
|
30
|
+
},
|
|
31
|
+
} as Meta
|
|
32
|
+
|
|
33
|
+
const Template: Story<AppAvatarProps> = args => <AppAvatar {...args} />
|
|
34
|
+
|
|
35
|
+
// Variants for different avatar scenarios
|
|
36
|
+
|
|
37
|
+
export const Default = Template.bind({})
|
|
38
|
+
Default.args = {
|
|
39
|
+
size: 4,
|
|
40
|
+
variant: 'solid',
|
|
41
|
+
color: 'neutral',
|
|
42
|
+
fallBack: 'initials',
|
|
43
|
+
initials: 'AB',
|
|
44
|
+
numberOfInitials: 1,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const WithImage = Template.bind({})
|
|
48
|
+
WithImage.args = {
|
|
49
|
+
size: 4,
|
|
50
|
+
variant: 'solid',
|
|
51
|
+
color: 'accent',
|
|
52
|
+
fallBack: 'image',
|
|
53
|
+
imageUrl: 'https://picsum.photos/seed/picsum/200/300',
|
|
54
|
+
numberOfInitials: 1,
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const WithIcon = Template.bind({})
|
|
58
|
+
WithIcon.args = {
|
|
59
|
+
size: 4,
|
|
60
|
+
variant: 'solid',
|
|
61
|
+
color: 'success',
|
|
62
|
+
fallBack: 'icon',
|
|
63
|
+
numberOfInitials: 1,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const HighContrast = Template.bind({})
|
|
67
|
+
HighContrast.args = {
|
|
68
|
+
size: 4,
|
|
69
|
+
variant: 'solid',
|
|
70
|
+
color: 'neutral',
|
|
71
|
+
fallBack: 'initials',
|
|
72
|
+
initials: 'HK',
|
|
73
|
+
highContrast: true,
|
|
74
|
+
numberOfInitials: 1,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const LargeAvatar = Template.bind({})
|
|
78
|
+
LargeAvatar.args = {
|
|
79
|
+
size: 9,
|
|
80
|
+
variant: 'solid',
|
|
81
|
+
color: 'warning',
|
|
82
|
+
fallBack: 'initials',
|
|
83
|
+
initials: 'LG',
|
|
84
|
+
numberOfInitials: 1,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const SoftVariant = Template.bind({})
|
|
88
|
+
SoftVariant.args = {
|
|
89
|
+
size: 4,
|
|
90
|
+
variant: 'soft',
|
|
91
|
+
color: 'info',
|
|
92
|
+
fallBack: 'initials',
|
|
93
|
+
initials: 'SV',
|
|
94
|
+
numberOfInitials: 1,
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const AccentAvatar = Template.bind({})
|
|
98
|
+
AccentAvatar.args = {
|
|
99
|
+
size: 4,
|
|
100
|
+
variant: 'solid',
|
|
101
|
+
color: 'accent',
|
|
102
|
+
fallBack: 'initials',
|
|
103
|
+
initials: 'Anita',
|
|
104
|
+
numberOfInitials: 1,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const SuccessAvatar = Template.bind({})
|
|
108
|
+
SuccessAvatar.args = {
|
|
109
|
+
size: 4,
|
|
110
|
+
variant: 'solid',
|
|
111
|
+
color: 'success',
|
|
112
|
+
fallBack: 'initials',
|
|
113
|
+
initials: 'SC',
|
|
114
|
+
numberOfInitials: 1,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const ErrorAvatar = Template.bind({})
|
|
118
|
+
ErrorAvatar.args = {
|
|
119
|
+
size: 4,
|
|
120
|
+
variant: 'solid',
|
|
121
|
+
color: 'error',
|
|
122
|
+
fallBack: 'initials',
|
|
123
|
+
initials: 'ER',
|
|
124
|
+
numberOfInitials: 1,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const WarningAvatar = Template.bind({})
|
|
128
|
+
WarningAvatar.args = {
|
|
129
|
+
size: 4,
|
|
130
|
+
variant: 'solid',
|
|
131
|
+
color: 'warning',
|
|
132
|
+
fallBack: 'initials',
|
|
133
|
+
initials: 'WR',
|
|
134
|
+
numberOfInitials: 1,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const InfoAvatar = Template.bind({})
|
|
138
|
+
InfoAvatar.args = {
|
|
139
|
+
size: 4,
|
|
140
|
+
variant: 'solid',
|
|
141
|
+
color: 'info',
|
|
142
|
+
fallBack: 'initials',
|
|
143
|
+
initials: 'IN',
|
|
144
|
+
numberOfInitials: 1,
|
|
145
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
import { Text, View } from 'react-native'
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler'
|
|
6
|
+
import Icon from 'react-native-remix-icon'
|
|
7
|
+
import AppBottomSheet from '../../../molecules/AppBottomSheet'
|
|
8
|
+
import AppButton from '../../../molecules/AppButton'
|
|
9
|
+
import { AppBottomSheetProps } from '../../../types/molecules'
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof AppBottomSheet> = {
|
|
12
|
+
title: 'AppBottomSheet',
|
|
13
|
+
component: AppBottomSheet,
|
|
14
|
+
argTypes: {
|
|
15
|
+
isDetached: {
|
|
16
|
+
control: 'boolean',
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
},
|
|
19
|
+
showModal: {
|
|
20
|
+
control: 'boolean',
|
|
21
|
+
defaultValue: false,
|
|
22
|
+
},
|
|
23
|
+
backdropClose: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
defaultValue: true,
|
|
26
|
+
},
|
|
27
|
+
index: {
|
|
28
|
+
control: 'select',
|
|
29
|
+
options: [0, 1, 2, 3, 4, 5],
|
|
30
|
+
if: { arg: 'isDetached', truthy: false },
|
|
31
|
+
},
|
|
32
|
+
height: {
|
|
33
|
+
control: 'number',
|
|
34
|
+
if: { arg: 'index', exists: false },
|
|
35
|
+
},
|
|
36
|
+
title: {
|
|
37
|
+
control: 'object',
|
|
38
|
+
},
|
|
39
|
+
isSwipeable: {
|
|
40
|
+
control: 'boolean',
|
|
41
|
+
if: { arg: 'isDetached', truthy: false },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default meta
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof AppBottomSheet>
|
|
49
|
+
|
|
50
|
+
const BottomSheetWrapper = (props: AppBottomSheetProps<boolean>) => {
|
|
51
|
+
const [showModal, setShowModal] = useState(false)
|
|
52
|
+
return (
|
|
53
|
+
<GestureHandlerRootView className={'flex-1'}>
|
|
54
|
+
<BottomSheetModalProvider>
|
|
55
|
+
<View className={'flex-1 items-center justify-center'}>
|
|
56
|
+
<AppButton
|
|
57
|
+
size={4}
|
|
58
|
+
text={'Open Bottom Sheet'}
|
|
59
|
+
color={'neutral'}
|
|
60
|
+
variant={'solid'}
|
|
61
|
+
highContrast
|
|
62
|
+
onPress={() => setShowModal(true)}
|
|
63
|
+
/>
|
|
64
|
+
<AppBottomSheet {...props} showModal={showModal} setShowModal={setShowModal} />
|
|
65
|
+
</View>
|
|
66
|
+
</BottomSheetModalProvider>
|
|
67
|
+
</GestureHandlerRootView>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Default: Story = {
|
|
72
|
+
render: args => <BottomSheetWrapper {...args} />,
|
|
73
|
+
args: {
|
|
74
|
+
isDetached: false,
|
|
75
|
+
backdropClose: true,
|
|
76
|
+
index: 2,
|
|
77
|
+
title: { text: 'Default Bottom Sheet', align: 'center' },
|
|
78
|
+
isSwipeable: true,
|
|
79
|
+
children: (
|
|
80
|
+
<Text className={'text-light-type-gray-muted dark:text-dark-type-gray-muted'}>
|
|
81
|
+
This is the content of the bottom sheet.
|
|
82
|
+
</Text>
|
|
83
|
+
),
|
|
84
|
+
actionButton: {
|
|
85
|
+
text: 'Close',
|
|
86
|
+
action: () => {},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const DetachedSheet: Story = {
|
|
92
|
+
render: args => <BottomSheetWrapper {...args} />,
|
|
93
|
+
args: {
|
|
94
|
+
isDetached: true,
|
|
95
|
+
backdropClose: true,
|
|
96
|
+
height: 300,
|
|
97
|
+
title: 'Detached Bottom Sheet',
|
|
98
|
+
content: 'This is a detached bottom sheet with fixed content.',
|
|
99
|
+
icon: <Icon name={'search-line'} size="76" color="#000" />,
|
|
100
|
+
actionButton: {
|
|
101
|
+
text: 'Confirm',
|
|
102
|
+
action: () => {},
|
|
103
|
+
},
|
|
104
|
+
secondaryActionButton: {
|
|
105
|
+
text: 'Cancel',
|
|
106
|
+
action: () => {},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const CustomHeightSheet: Story = {
|
|
112
|
+
render: args => <BottomSheetWrapper {...args} />,
|
|
113
|
+
args: {
|
|
114
|
+
isDetached: false,
|
|
115
|
+
backdropClose: true,
|
|
116
|
+
height: 400,
|
|
117
|
+
title: { text: 'Custom Height Sheet', align: 'left' },
|
|
118
|
+
isSwipeable: true,
|
|
119
|
+
children: (
|
|
120
|
+
<Text className={'text-light-type-accent dark:text-dark-type-accent-bold'}>
|
|
121
|
+
This bottom sheet has a custom height of 400.
|
|
122
|
+
</Text>
|
|
123
|
+
),
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const NonSwipeableSheet: Story = {
|
|
128
|
+
render: args => <BottomSheetWrapper {...args} />,
|
|
129
|
+
args: {
|
|
130
|
+
isDetached: false,
|
|
131
|
+
backdropClose: false,
|
|
132
|
+
index: 3,
|
|
133
|
+
title: { text: 'Non-Swipeable Sheet', align: 'center' },
|
|
134
|
+
isSwipeable: false,
|
|
135
|
+
children: (
|
|
136
|
+
<Text className={'text-light-type-accent dark:text-dark-type-accent-bold'}>
|
|
137
|
+
This bottom sheet cannot be swiped.
|
|
138
|
+
</Text>
|
|
139
|
+
),
|
|
140
|
+
actionButton: {
|
|
141
|
+
text: 'Close',
|
|
142
|
+
action: () => {},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export const SheetWithSubtitle: Story = {
|
|
148
|
+
render: args => <BottomSheetWrapper {...args} />,
|
|
149
|
+
args: {
|
|
150
|
+
isDetached: false,
|
|
151
|
+
backdropClose: true,
|
|
152
|
+
index: 1,
|
|
153
|
+
title: {
|
|
154
|
+
text: 'Sheet with Subtitle',
|
|
155
|
+
align: 'left',
|
|
156
|
+
subtitle: 'This is a subtitle for the bottom sheet',
|
|
157
|
+
},
|
|
158
|
+
isSwipeable: true,
|
|
159
|
+
children: (
|
|
160
|
+
<Text className={'text-light-type-accent dark:text-dark-type-accent-bold'}>
|
|
161
|
+
Content with a title and subtitle.
|
|
162
|
+
</Text>
|
|
163
|
+
),
|
|
164
|
+
},
|
|
165
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { View } from 'react-native'
|
|
4
|
+
import AppButton, { AppButtonProps } from '../../../molecules/AppButton'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'AppButton',
|
|
8
|
+
component: AppButton,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
decorators: [
|
|
11
|
+
Story => (
|
|
12
|
+
<View style={{ alignItems: 'center', justifyContent: 'center', flex: 1 }}>
|
|
13
|
+
<Story />
|
|
14
|
+
</View>
|
|
15
|
+
),
|
|
16
|
+
],
|
|
17
|
+
argTypes: {
|
|
18
|
+
size: { control: 'select', options: [1, 2, 3, 4] },
|
|
19
|
+
variant: { control: 'select', options: ['solid', 'soft', 'surface', 'outline', 'ghost'] },
|
|
20
|
+
color: { control: 'select', options: ['accent', 'neutral', 'error'] },
|
|
21
|
+
state: { control: 'select', options: ['default', 'active', 'disabled'] },
|
|
22
|
+
highContrast: { control: 'boolean' },
|
|
23
|
+
iconStart: { control: 'boolean' },
|
|
24
|
+
iconEnd: { control: 'boolean' },
|
|
25
|
+
text: { control: 'text' },
|
|
26
|
+
accessibilityLabel: { control: 'text' },
|
|
27
|
+
accessibilityHint: { control: 'text' },
|
|
28
|
+
},
|
|
29
|
+
} as Meta
|
|
30
|
+
|
|
31
|
+
const Template: Story<AppButtonProps> = args => <AppButton {...args} />
|
|
32
|
+
|
|
33
|
+
// Accent Variants
|
|
34
|
+
export const AccentSolidVariant = Template.bind({})
|
|
35
|
+
AccentSolidVariant.args = {
|
|
36
|
+
size: 4,
|
|
37
|
+
variant: 'solid',
|
|
38
|
+
color: 'accent',
|
|
39
|
+
highContrast: false,
|
|
40
|
+
state: 'default',
|
|
41
|
+
text: 'Accent Solid Button',
|
|
42
|
+
accessibilityLabel: 'Accent Solid Button',
|
|
43
|
+
accessibilityHint: 'Press to select the accent solid button',
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const AccentSoftVariant = Template.bind({})
|
|
47
|
+
AccentSoftVariant.args = {
|
|
48
|
+
size: 4,
|
|
49
|
+
variant: 'soft',
|
|
50
|
+
color: 'accent',
|
|
51
|
+
highContrast: false,
|
|
52
|
+
state: 'default',
|
|
53
|
+
text: 'Accent Soft Button',
|
|
54
|
+
accessibilityLabel: 'Accent Soft Button',
|
|
55
|
+
accessibilityHint: 'Press to select the accent soft button',
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const AccentSurfaceVariant = Template.bind({})
|
|
59
|
+
AccentSurfaceVariant.args = {
|
|
60
|
+
size: 4,
|
|
61
|
+
variant: 'surface',
|
|
62
|
+
color: 'accent',
|
|
63
|
+
highContrast: false,
|
|
64
|
+
state: 'default',
|
|
65
|
+
text: 'Accent Surface Button',
|
|
66
|
+
accessibilityLabel: 'Accent Surface Button',
|
|
67
|
+
accessibilityHint: 'Press to select the accent surface button',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const AccentOutlineVariant = Template.bind({})
|
|
71
|
+
AccentOutlineVariant.args = {
|
|
72
|
+
size: 4,
|
|
73
|
+
variant: 'outline',
|
|
74
|
+
color: 'accent',
|
|
75
|
+
highContrast: false,
|
|
76
|
+
state: 'default',
|
|
77
|
+
text: 'Accent Outline Button',
|
|
78
|
+
accessibilityLabel: 'Accent Outline Button',
|
|
79
|
+
accessibilityHint: 'Press to select the accent outline button',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const AccentGhostVariant = Template.bind({})
|
|
83
|
+
AccentGhostVariant.args = {
|
|
84
|
+
size: 4,
|
|
85
|
+
variant: 'ghost',
|
|
86
|
+
color: 'accent',
|
|
87
|
+
highContrast: false,
|
|
88
|
+
state: 'default',
|
|
89
|
+
text: 'Accent Ghost Button',
|
|
90
|
+
accessibilityLabel: 'Accent Ghost Button',
|
|
91
|
+
accessibilityHint: 'Press to select the accent ghost button',
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Neutral Variants
|
|
95
|
+
export const NeutralSolidVariant = Template.bind({})
|
|
96
|
+
NeutralSolidVariant.args = {
|
|
97
|
+
size: 4,
|
|
98
|
+
variant: 'solid',
|
|
99
|
+
color: 'neutral',
|
|
100
|
+
highContrast: false,
|
|
101
|
+
state: 'default',
|
|
102
|
+
text: 'Neutral Solid Button',
|
|
103
|
+
accessibilityLabel: 'Neutral Solid Button',
|
|
104
|
+
accessibilityHint: 'Press to select the neutral solid button',
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const NeutralSoftVariant = Template.bind({})
|
|
108
|
+
NeutralSoftVariant.args = {
|
|
109
|
+
size: 4,
|
|
110
|
+
variant: 'soft',
|
|
111
|
+
color: 'neutral',
|
|
112
|
+
highContrast: false,
|
|
113
|
+
state: 'default',
|
|
114
|
+
text: 'Neutral Soft Button',
|
|
115
|
+
accessibilityLabel: 'Neutral Soft Button',
|
|
116
|
+
accessibilityHint: 'Press to select the neutral soft button',
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const NeutralSurfaceVariant = Template.bind({})
|
|
120
|
+
NeutralSurfaceVariant.args = {
|
|
121
|
+
size: 4,
|
|
122
|
+
variant: 'surface',
|
|
123
|
+
color: 'neutral',
|
|
124
|
+
highContrast: false,
|
|
125
|
+
state: 'default',
|
|
126
|
+
text: 'Neutral Surface Button',
|
|
127
|
+
accessibilityLabel: 'Neutral Surface Button',
|
|
128
|
+
accessibilityHint: 'Press to select the neutral surface button',
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const NeutralOutlineVariant = Template.bind({})
|
|
132
|
+
NeutralOutlineVariant.args = {
|
|
133
|
+
size: 4,
|
|
134
|
+
variant: 'outline',
|
|
135
|
+
color: 'neutral',
|
|
136
|
+
highContrast: false,
|
|
137
|
+
state: 'default',
|
|
138
|
+
text: 'Neutral Outline Button',
|
|
139
|
+
accessibilityLabel: 'Neutral Outline Button',
|
|
140
|
+
accessibilityHint: 'Press to select the neutral outline button',
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const NeutralGhostVariant = Template.bind({})
|
|
144
|
+
NeutralGhostVariant.args = {
|
|
145
|
+
size: 4,
|
|
146
|
+
variant: 'ghost',
|
|
147
|
+
color: 'neutral',
|
|
148
|
+
highContrast: false,
|
|
149
|
+
state: 'default',
|
|
150
|
+
text: 'Neutral Ghost Button',
|
|
151
|
+
accessibilityLabel: 'Neutral Ghost Button',
|
|
152
|
+
accessibilityHint: 'Press to select the neutral ghost button',
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Error Variants
|
|
156
|
+
export const ErrorSolidVariant = Template.bind({})
|
|
157
|
+
ErrorSolidVariant.args = {
|
|
158
|
+
size: 4,
|
|
159
|
+
variant: 'solid',
|
|
160
|
+
color: 'error',
|
|
161
|
+
highContrast: false,
|
|
162
|
+
state: 'default',
|
|
163
|
+
text: 'Error Solid Button',
|
|
164
|
+
accessibilityLabel: 'Error Solid Button',
|
|
165
|
+
accessibilityHint: 'Press to select the error solid button',
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export const ErrorSoftVariant = Template.bind({})
|
|
169
|
+
ErrorSoftVariant.args = {
|
|
170
|
+
size: 4,
|
|
171
|
+
variant: 'soft',
|
|
172
|
+
color: 'error',
|
|
173
|
+
highContrast: false,
|
|
174
|
+
state: 'default',
|
|
175
|
+
text: 'Error Soft Button',
|
|
176
|
+
accessibilityLabel: 'Error Soft Button',
|
|
177
|
+
accessibilityHint: 'Press to select the error soft button',
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const ErrorSurfaceVariant = Template.bind({})
|
|
181
|
+
ErrorSurfaceVariant.args = {
|
|
182
|
+
size: 4,
|
|
183
|
+
variant: 'surface',
|
|
184
|
+
color: 'error',
|
|
185
|
+
highContrast: false,
|
|
186
|
+
state: 'default',
|
|
187
|
+
text: 'Error Surface Button',
|
|
188
|
+
accessibilityLabel: 'Error Surface Button',
|
|
189
|
+
accessibilityHint: 'Press to select the error surface button',
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const ErrorOutlineVariant = Template.bind({})
|
|
193
|
+
ErrorOutlineVariant.args = {
|
|
194
|
+
size: 4,
|
|
195
|
+
variant: 'outline',
|
|
196
|
+
color: 'error',
|
|
197
|
+
highContrast: false,
|
|
198
|
+
state: 'default',
|
|
199
|
+
text: 'Error Outline Button',
|
|
200
|
+
accessibilityLabel: 'Error Outline Button',
|
|
201
|
+
accessibilityHint: 'Press to select the error outline button',
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export const ErrorGhostVariant = Template.bind({})
|
|
205
|
+
ErrorGhostVariant.args = {
|
|
206
|
+
size: 4,
|
|
207
|
+
variant: 'ghost',
|
|
208
|
+
color: 'error',
|
|
209
|
+
highContrast: false,
|
|
210
|
+
state: 'default',
|
|
211
|
+
text: 'Error Ghost Button',
|
|
212
|
+
accessibilityLabel: 'Error Ghost Button',
|
|
213
|
+
accessibilityHint: 'Press to select the error ghost button',
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Button with icons stories to be added after remix icon configurations
|
|
217
|
+
|
|
218
|
+
// export const WithIconStart = Template.bind({});
|
|
219
|
+
// WithIconStart.args = {
|
|
220
|
+
// size: 2,
|
|
221
|
+
// variant: 'solid',
|
|
222
|
+
// color: 'accent',
|
|
223
|
+
// highContrast: false,
|
|
224
|
+
// state: 'default',
|
|
225
|
+
// iconStart: true,
|
|
226
|
+
// text: 'Button with Icon Start',
|
|
227
|
+
// accessibilityLabel: 'Button with Icon Start',
|
|
228
|
+
// accessibilityHint: 'Press to select the button with icon start',
|
|
229
|
+
// };
|
|
230
|
+
|
|
231
|
+
// export const WithIconEnd = Template.bind({});
|
|
232
|
+
// WithIconEnd.args = {
|
|
233
|
+
// size: 2,
|
|
234
|
+
// variant: 'solid',
|
|
235
|
+
// color: 'accent',
|
|
236
|
+
// highContrast: false,
|
|
237
|
+
// state: 'default',
|
|
238
|
+
// iconEnd: true,
|
|
239
|
+
// text: 'Button with Icon End',
|
|
240
|
+
// accessibilityLabel: 'Button with Icon End',
|
|
241
|
+
// accessibilityHint: 'Press to select the button with icon end',
|
|
242
|
+
// };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
|
|
2
|
+
import { Meta, Story } from '@storybook/react'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { View } from 'react-native'
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler'
|
|
6
|
+
import AppDateInput, { AppDateInputProps } from '../../../molecules/AppDateInput'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'AppDateInput',
|
|
10
|
+
component: AppDateInput,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [
|
|
13
|
+
Story => (
|
|
14
|
+
<GestureHandlerRootView>
|
|
15
|
+
<BottomSheetModalProvider>
|
|
16
|
+
<View style={{ alignItems: 'center', justifyContent: 'center', flex: 1, width: '100%' }}>
|
|
17
|
+
<View style={{ width: '80%' }}>
|
|
18
|
+
<Story />
|
|
19
|
+
</View>
|
|
20
|
+
</View>
|
|
21
|
+
</BottomSheetModalProvider>
|
|
22
|
+
</GestureHandlerRootView>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
argTypes: {
|
|
26
|
+
label: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Label for the date input component',
|
|
29
|
+
defaultValue: 'Select a date',
|
|
30
|
+
},
|
|
31
|
+
state: {
|
|
32
|
+
control: 'select',
|
|
33
|
+
options: ['default', 'disabled'],
|
|
34
|
+
description: 'State of the date input component',
|
|
35
|
+
defaultValue: 'default',
|
|
36
|
+
},
|
|
37
|
+
hasError: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Display error state',
|
|
40
|
+
defaultValue: false,
|
|
41
|
+
},
|
|
42
|
+
errorText: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Error message text',
|
|
45
|
+
defaultValue: 'This is an error message',
|
|
46
|
+
},
|
|
47
|
+
hintText: {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Hint text for the input component',
|
|
50
|
+
defaultValue: 'Select your date of birth',
|
|
51
|
+
},
|
|
52
|
+
onDateChange: {
|
|
53
|
+
action: 'dateChanged',
|
|
54
|
+
description: 'Callback function when the date is changed',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
} as Meta
|
|
58
|
+
|
|
59
|
+
const Template: Story<AppDateInputProps> = args => <AppDateInput {...args} />
|
|
60
|
+
|
|
61
|
+
// Default story
|
|
62
|
+
export const Default = Template.bind({})
|
|
63
|
+
Default.args = {
|
|
64
|
+
label: 'Select a date',
|
|
65
|
+
state: 'default',
|
|
66
|
+
hasError: false,
|
|
67
|
+
hintText: 'Select your date of birth',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Hint Text story
|
|
71
|
+
export const WithHintText = Template.bind({})
|
|
72
|
+
WithHintText.args = {
|
|
73
|
+
label: 'Select a date',
|
|
74
|
+
state: 'default',
|
|
75
|
+
hintText: 'Info hint text',
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Disabled state story
|
|
79
|
+
export const Disabled = Template.bind({})
|
|
80
|
+
Disabled.args = {
|
|
81
|
+
label: 'Select a date',
|
|
82
|
+
state: 'disabled',
|
|
83
|
+
hasError: false,
|
|
84
|
+
hintText: 'This input is disabled',
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Error state story
|
|
88
|
+
export const WithError = Template.bind({})
|
|
89
|
+
WithError.args = {
|
|
90
|
+
label: 'Select a date',
|
|
91
|
+
state: 'default',
|
|
92
|
+
hasError: true,
|
|
93
|
+
errorText: 'Invalid date selected',
|
|
94
|
+
}
|