@herca/rn-kit 0.1.69 → 0.1.70
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/lib/module/Input/InputFile.js +76 -275
- package/lib/module/Input/InputFile.js.map +1 -1
- package/lib/module/Input/README_INPUT_FILE.md +144 -23
- package/lib/module/Input/partials/InputFile/CardTrigger.js +77 -0
- package/lib/module/Input/partials/InputFile/CardTrigger.js.map +1 -0
- package/lib/module/Input/partials/InputFile/CardTriggerSmall.js +86 -0
- package/lib/module/Input/partials/InputFile/CardTriggerSmall.js.map +1 -0
- package/lib/module/Input/partials/InputFile/ItemPicker.js +43 -0
- package/lib/module/Input/partials/InputFile/ItemPicker.js.map +1 -0
- package/lib/module/Input/partials/InputFile/ItemPreview.js +149 -0
- package/lib/module/Input/partials/InputFile/ItemPreview.js.map +1 -0
- package/lib/module/Input/partials/InputFile/ModalDelete.js +76 -0
- package/lib/module/Input/partials/InputFile/ModalDelete.js.map +1 -0
- package/lib/module/Input/partials/InputFile/ModalPicker.js +72 -0
- package/lib/module/Input/partials/InputFile/ModalPicker.js.map +1 -0
- package/lib/module/Ui/Center.js.map +1 -1
- package/lib/module/styles/layouting.js +3 -0
- package/lib/module/styles/layouting.js.map +1 -1
- package/lib/typescript/src/Input/InputFile.d.ts +17 -4
- package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
- package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts +11 -0
- package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts.map +1 -0
- package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts +12 -0
- package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts.map +1 -0
- package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts +10 -0
- package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts.map +1 -0
- package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts +11 -0
- package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts.map +1 -0
- package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts +12 -0
- package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts.map +1 -0
- package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts +18 -0
- package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Center.d.ts +2 -2
- package/lib/typescript/src/Ui/Center.d.ts.map +1 -1
- package/lib/typescript/src/styles/layouting.d.ts +3 -0
- package/lib/typescript/src/styles/layouting.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Input/InputFile.tsx +148 -296
- package/src/Input/README_INPUT_FILE.md +144 -23
- package/src/Input/partials/InputFile/CardTrigger.tsx +87 -0
- package/src/Input/partials/InputFile/CardTriggerSmall.tsx +120 -0
- package/src/Input/partials/InputFile/ItemPicker.tsx +46 -0
- package/src/Input/partials/InputFile/ItemPreview.tsx +182 -0
- package/src/Input/partials/InputFile/ModalDelete.tsx +84 -0
- package/src/Input/partials/InputFile/ModalPicker.tsx +86 -0
- package/src/Ui/Center.tsx +2 -2
- package/src/styles/layouting.ts +1 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import BottomSheet from '../../../BottomSheet/BottomSheet';
|
|
3
|
+
import Center from '../../../Ui/Center';
|
|
4
|
+
import Typography from '../../../Typography/Typography';
|
|
5
|
+
import Color from '../../../Color/Color';
|
|
6
|
+
import Button from '../../../Button/Button';
|
|
7
|
+
|
|
8
|
+
interface Props extends React.ComponentProps<typeof BottomSheet> {
|
|
9
|
+
title: string;
|
|
10
|
+
descripition: string;
|
|
11
|
+
confirm: string;
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
cancel: string;
|
|
14
|
+
onCnacel: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function ModalDelete({
|
|
18
|
+
title,
|
|
19
|
+
descripition,
|
|
20
|
+
confirm,
|
|
21
|
+
cancel,
|
|
22
|
+
onCnacel,
|
|
23
|
+
onConfirm,
|
|
24
|
+
...props
|
|
25
|
+
}: Props) {
|
|
26
|
+
return (
|
|
27
|
+
<BottomSheet {...props}>
|
|
28
|
+
<View style={styles.deleteFileContent}>
|
|
29
|
+
<Center style={styles.deleteFileCenter}>
|
|
30
|
+
<Typography
|
|
31
|
+
variant="p2"
|
|
32
|
+
weight="semibold"
|
|
33
|
+
color={Color.gray[800]}
|
|
34
|
+
center
|
|
35
|
+
>
|
|
36
|
+
{title}
|
|
37
|
+
</Typography>
|
|
38
|
+
<Typography
|
|
39
|
+
variant="t1"
|
|
40
|
+
weight="regular"
|
|
41
|
+
color={Color.gray[500]}
|
|
42
|
+
center
|
|
43
|
+
>
|
|
44
|
+
{descripition}
|
|
45
|
+
</Typography>
|
|
46
|
+
</Center>
|
|
47
|
+
<View>
|
|
48
|
+
<Button color="danger" title={confirm} onPress={onConfirm} />
|
|
49
|
+
<Button
|
|
50
|
+
color="primary"
|
|
51
|
+
variant="tertiary"
|
|
52
|
+
title={cancel}
|
|
53
|
+
onPress={onCnacel}
|
|
54
|
+
/>
|
|
55
|
+
</View>
|
|
56
|
+
</View>
|
|
57
|
+
</BottomSheet>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
wrapper: {
|
|
63
|
+
gap: 12,
|
|
64
|
+
},
|
|
65
|
+
containerInput: {
|
|
66
|
+
borderStyle: 'dashed',
|
|
67
|
+
backgroundColor: Color.gray[50],
|
|
68
|
+
borderRadius: 16,
|
|
69
|
+
},
|
|
70
|
+
centerInput: {
|
|
71
|
+
gap: 14,
|
|
72
|
+
},
|
|
73
|
+
deleteFileContent: {
|
|
74
|
+
gap: 10,
|
|
75
|
+
},
|
|
76
|
+
deleteFileCenter: {
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
gap: 4,
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
previewWrapper: {
|
|
82
|
+
gap: 12,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import BottomSheet from '../../../BottomSheet/BottomSheet';
|
|
3
|
+
import Center from '../../../Ui/Center';
|
|
4
|
+
import Typography from '../../../Typography/Typography';
|
|
5
|
+
import List from '../../../List/List';
|
|
6
|
+
import ListItem from '../../../List/ListItem';
|
|
7
|
+
import ItemPicker from './ItemPicker';
|
|
8
|
+
import Color from '../../../Color/Color';
|
|
9
|
+
import type { IconNameProps } from '../../../Icon';
|
|
10
|
+
|
|
11
|
+
interface FilePicker {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
onPress: () => void;
|
|
15
|
+
icon: IconNameProps;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Props extends React.ComponentProps<typeof BottomSheet> {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
camera: FilePicker;
|
|
22
|
+
gallery: FilePicker;
|
|
23
|
+
document: FilePicker;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function ModalPicker({
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
camera,
|
|
30
|
+
gallery,
|
|
31
|
+
document,
|
|
32
|
+
...props
|
|
33
|
+
}: Props) {
|
|
34
|
+
return (
|
|
35
|
+
<BottomSheet {...props}>
|
|
36
|
+
<View style={styles.bottomSheetContent}>
|
|
37
|
+
<Center style={styles.bottomSheetCenter}>
|
|
38
|
+
<Typography variant="p2" weight="semibold" color={Color.gray[800]}>
|
|
39
|
+
{title}
|
|
40
|
+
</Typography>
|
|
41
|
+
<Typography variant="t1" weight="regular" color={Color.gray[600]}>
|
|
42
|
+
{description}
|
|
43
|
+
</Typography>
|
|
44
|
+
</Center>
|
|
45
|
+
|
|
46
|
+
<List>
|
|
47
|
+
<ListItem>
|
|
48
|
+
<ItemPicker
|
|
49
|
+
title={camera?.title}
|
|
50
|
+
icon={camera?.icon}
|
|
51
|
+
onPress={camera?.onPress}
|
|
52
|
+
description={camera?.description}
|
|
53
|
+
/>
|
|
54
|
+
</ListItem>
|
|
55
|
+
|
|
56
|
+
<ListItem>
|
|
57
|
+
<ItemPicker
|
|
58
|
+
title={gallery?.title}
|
|
59
|
+
icon={gallery?.icon}
|
|
60
|
+
onPress={gallery?.onPress}
|
|
61
|
+
description={gallery?.description}
|
|
62
|
+
/>
|
|
63
|
+
</ListItem>
|
|
64
|
+
|
|
65
|
+
<ListItem>
|
|
66
|
+
<ItemPicker
|
|
67
|
+
title={document?.title}
|
|
68
|
+
icon={document?.icon}
|
|
69
|
+
onPress={document?.onPress}
|
|
70
|
+
description={document?.description}
|
|
71
|
+
/>
|
|
72
|
+
</ListItem>
|
|
73
|
+
</List>
|
|
74
|
+
</View>
|
|
75
|
+
</BottomSheet>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
bottomSheetContent: {
|
|
81
|
+
gap: 16,
|
|
82
|
+
},
|
|
83
|
+
bottomSheetCenter: {
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
},
|
|
86
|
+
});
|
package/src/Ui/Center.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { View, StyleSheet, type ViewStyle } from 'react-native';
|
|
1
|
+
import { View, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';
|
|
2
2
|
|
|
3
3
|
interface CenterProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
size?: number;
|
|
6
|
-
style?: ViewStyle
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const Center = ({ children, style }: CenterProps) => {
|