@herca/rn-kit 0.1.69 → 0.1.71

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 (66) hide show
  1. package/lib/module/Icon/Icon.js +3 -1
  2. package/lib/module/Icon/Icon.js.map +1 -1
  3. package/lib/module/Icon/README.md +1 -0
  4. package/lib/module/Icon/icons/FaceId.js +61 -0
  5. package/lib/module/Icon/icons/FaceId.js.map +1 -0
  6. package/lib/module/Input/InputFile.js +76 -275
  7. package/lib/module/Input/InputFile.js.map +1 -1
  8. package/lib/module/Input/README_INPUT_FILE.md +144 -23
  9. package/lib/module/Input/partials/InputFile/CardTrigger.js +77 -0
  10. package/lib/module/Input/partials/InputFile/CardTrigger.js.map +1 -0
  11. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js +86 -0
  12. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js.map +1 -0
  13. package/lib/module/Input/partials/InputFile/ItemPicker.js +43 -0
  14. package/lib/module/Input/partials/InputFile/ItemPicker.js.map +1 -0
  15. package/lib/module/Input/partials/InputFile/ItemPreview.js +149 -0
  16. package/lib/module/Input/partials/InputFile/ItemPreview.js.map +1 -0
  17. package/lib/module/Input/partials/InputFile/ModalDelete.js +76 -0
  18. package/lib/module/Input/partials/InputFile/ModalDelete.js.map +1 -0
  19. package/lib/module/Input/partials/InputFile/ModalPicker.js +72 -0
  20. package/lib/module/Input/partials/InputFile/ModalPicker.js.map +1 -0
  21. package/lib/module/Spinner/Spinner.js +78 -0
  22. package/lib/module/Spinner/Spinner.js.map +1 -0
  23. package/lib/module/Ui/Center.js.map +1 -1
  24. package/lib/module/styles/layouting.js +3 -0
  25. package/lib/module/styles/layouting.js.map +1 -1
  26. package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
  27. package/lib/typescript/src/Icon/icons/FaceId.d.ts +9 -0
  28. package/lib/typescript/src/Icon/icons/FaceId.d.ts.map +1 -0
  29. package/lib/typescript/src/Icon/type.d.ts +1 -1
  30. package/lib/typescript/src/Icon/type.d.ts.map +1 -1
  31. package/lib/typescript/src/Input/InputFile.d.ts +17 -4
  32. package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
  33. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts +11 -0
  34. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts.map +1 -0
  35. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts +12 -0
  36. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts.map +1 -0
  37. package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts +10 -0
  38. package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts.map +1 -0
  39. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts +11 -0
  40. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts.map +1 -0
  41. package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts +12 -0
  42. package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts.map +1 -0
  43. package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts +18 -0
  44. package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts.map +1 -0
  45. package/lib/typescript/src/Spinner/Spinner.d.ts +5 -0
  46. package/lib/typescript/src/Spinner/Spinner.d.ts.map +1 -0
  47. package/lib/typescript/src/Ui/Center.d.ts +2 -2
  48. package/lib/typescript/src/Ui/Center.d.ts.map +1 -1
  49. package/lib/typescript/src/styles/layouting.d.ts +3 -0
  50. package/lib/typescript/src/styles/layouting.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/Icon/Icon.tsx +2 -0
  53. package/src/Icon/README.md +1 -0
  54. package/src/Icon/icons/FaceId.tsx +64 -0
  55. package/src/Icon/type.tsx +2 -1
  56. package/src/Input/InputFile.tsx +148 -296
  57. package/src/Input/README_INPUT_FILE.md +144 -23
  58. package/src/Input/partials/InputFile/CardTrigger.tsx +87 -0
  59. package/src/Input/partials/InputFile/CardTriggerSmall.tsx +120 -0
  60. package/src/Input/partials/InputFile/ItemPicker.tsx +46 -0
  61. package/src/Input/partials/InputFile/ItemPreview.tsx +182 -0
  62. package/src/Input/partials/InputFile/ModalDelete.tsx +84 -0
  63. package/src/Input/partials/InputFile/ModalPicker.tsx +86 -0
  64. package/src/Spinner/Spinner.tsx +67 -0
  65. package/src/Ui/Center.tsx +2 -2
  66. 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
+ });
@@ -0,0 +1,67 @@
1
+ import { useRef, useEffect } from 'react';
2
+ import { Animated, Easing, StyleSheet, View } from 'react-native';
3
+ import Svg, { Defs, LinearGradient, Stop, Circle } from 'react-native-svg';
4
+
5
+ export default function Spinner({ size = 48, color = '#FFFFFF' }) {
6
+ const rotateAnim = useRef(new Animated.Value(0)).current;
7
+
8
+ useEffect(() => {
9
+ const spin = Animated.loop(
10
+ Animated.timing(rotateAnim, {
11
+ toValue: 1,
12
+ duration: 1200,
13
+ easing: Easing.linear,
14
+ useNativeDriver: true,
15
+ })
16
+ );
17
+ spin.start();
18
+ return () => spin.stop();
19
+ }, [rotateAnim]);
20
+
21
+ const rotateInterpolate = rotateAnim.interpolate({
22
+ inputRange: [0, 1],
23
+ outputRange: ['0deg', '360deg'],
24
+ });
25
+
26
+ const strokeWidth = size * 0.1;
27
+ const radius = size / 2 - strokeWidth;
28
+
29
+ const darkerColor = '#999';
30
+
31
+ return (
32
+ <View style={[styles.container, { width: size, height: size }]}>
33
+ <Animated.View
34
+ style={{
35
+ transform: [{ rotate: rotateInterpolate }],
36
+ }}
37
+ >
38
+ <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
39
+ <Defs>
40
+ <LinearGradient id="grad" x1="0" y1="0" x2="1" y2="1">
41
+ <Stop offset="0%" stopColor={color} />
42
+ <Stop offset="100%" stopColor={darkerColor} />
43
+ </LinearGradient>
44
+ </Defs>
45
+
46
+ {/* Lingkaran penuh */}
47
+ <Circle
48
+ cx={size / 2}
49
+ cy={size / 2}
50
+ r={radius}
51
+ stroke="url(#grad)"
52
+ strokeWidth={strokeWidth}
53
+ fill="none"
54
+ strokeLinecap="round"
55
+ />
56
+ </Svg>
57
+ </Animated.View>
58
+ </View>
59
+ );
60
+ }
61
+
62
+ const styles = StyleSheet.create({
63
+ container: {
64
+ justifyContent: 'center',
65
+ alignItems: 'center',
66
+ },
67
+ });
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) => {
@@ -6,6 +6,7 @@ export const layouting = {
6
6
  grow: { flexGrow: 1 },
7
7
  shrink: { flexShrink: 1 },
8
8
  row: { flexDirection: 'row' },
9
+ col: { flexDirection: 'column' },
9
10
  rowCenter: {
10
11
  flexDirection: 'row',
11
12
  alignItems: 'center',