@herca/rn-kit 0.1.68 → 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.
Files changed (73) hide show
  1. package/lib/module/DatePicker/TimePicker.js +26 -46
  2. package/lib/module/DatePicker/TimePicker.js.map +1 -1
  3. package/lib/module/DatePicker/partials/AnimatedItem.js +52 -0
  4. package/lib/module/DatePicker/partials/AnimatedItem.js.map +1 -0
  5. package/lib/module/Input/InputFile.js +76 -275
  6. package/lib/module/Input/InputFile.js.map +1 -1
  7. package/lib/module/Input/README_INPUT_FILE.md +144 -23
  8. package/lib/module/Input/TextArea.js +5 -2
  9. package/lib/module/Input/TextArea.js.map +1 -1
  10. package/lib/module/Input/partials/InputFile/CardTrigger.js +77 -0
  11. package/lib/module/Input/partials/InputFile/CardTrigger.js.map +1 -0
  12. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js +86 -0
  13. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js.map +1 -0
  14. package/lib/module/Input/partials/InputFile/ItemPicker.js +43 -0
  15. package/lib/module/Input/partials/InputFile/ItemPicker.js.map +1 -0
  16. package/lib/module/Input/partials/InputFile/ItemPreview.js +149 -0
  17. package/lib/module/Input/partials/InputFile/ItemPreview.js.map +1 -0
  18. package/lib/module/Input/partials/InputFile/ModalDelete.js +76 -0
  19. package/lib/module/Input/partials/InputFile/ModalDelete.js.map +1 -0
  20. package/lib/module/Input/partials/InputFile/ModalPicker.js +72 -0
  21. package/lib/module/Input/partials/InputFile/ModalPicker.js.map +1 -0
  22. package/lib/module/LabelForm/LabelForm.js +3 -1
  23. package/lib/module/LabelForm/LabelForm.js.map +1 -1
  24. package/lib/module/Step/Step.js +1 -1
  25. package/lib/module/Step/StepItem.js +14 -6
  26. package/lib/module/Step/StepItem.js.map +1 -1
  27. package/lib/module/Ui/Center.js.map +1 -1
  28. package/lib/module/styles/layouting.js +3 -0
  29. package/lib/module/styles/layouting.js.map +1 -1
  30. package/lib/typescript/src/DatePicker/TimePicker.d.ts +4 -1
  31. package/lib/typescript/src/DatePicker/TimePicker.d.ts.map +1 -1
  32. package/lib/typescript/src/DatePicker/partials/AnimatedItem.d.ts +11 -0
  33. package/lib/typescript/src/DatePicker/partials/AnimatedItem.d.ts.map +1 -0
  34. package/lib/typescript/src/Input/InputFile.d.ts +17 -4
  35. package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
  36. package/lib/typescript/src/Input/TextArea.d.ts +1 -1
  37. package/lib/typescript/src/Input/TextArea.d.ts.map +1 -1
  38. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts +11 -0
  39. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts.map +1 -0
  40. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts +12 -0
  41. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts.map +1 -0
  42. package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts +10 -0
  43. package/lib/typescript/src/Input/partials/InputFile/ItemPicker.d.ts.map +1 -0
  44. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts +11 -0
  45. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts.map +1 -0
  46. package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts +12 -0
  47. package/lib/typescript/src/Input/partials/InputFile/ModalDelete.d.ts.map +1 -0
  48. package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts +18 -0
  49. package/lib/typescript/src/Input/partials/InputFile/ModalPicker.d.ts.map +1 -0
  50. package/lib/typescript/src/LabelForm/LabelForm.d.ts +2 -1
  51. package/lib/typescript/src/LabelForm/LabelForm.d.ts.map +1 -1
  52. package/lib/typescript/src/Step/StepItem.d.ts.map +1 -1
  53. package/lib/typescript/src/Ui/Center.d.ts +2 -2
  54. package/lib/typescript/src/Ui/Center.d.ts.map +1 -1
  55. package/lib/typescript/src/styles/layouting.d.ts +3 -0
  56. package/lib/typescript/src/styles/layouting.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/src/DatePicker/TimePicker.tsx +37 -74
  59. package/src/DatePicker/partials/AnimatedItem.tsx +62 -0
  60. package/src/Input/InputFile.tsx +148 -296
  61. package/src/Input/README_INPUT_FILE.md +144 -23
  62. package/src/Input/TextArea.tsx +3 -0
  63. package/src/Input/partials/InputFile/CardTrigger.tsx +87 -0
  64. package/src/Input/partials/InputFile/CardTriggerSmall.tsx +120 -0
  65. package/src/Input/partials/InputFile/ItemPicker.tsx +46 -0
  66. package/src/Input/partials/InputFile/ItemPreview.tsx +182 -0
  67. package/src/Input/partials/InputFile/ModalDelete.tsx +84 -0
  68. package/src/Input/partials/InputFile/ModalPicker.tsx +86 -0
  69. package/src/LabelForm/LabelForm.tsx +7 -2
  70. package/src/Step/Step.tsx +1 -1
  71. package/src/Step/StepItem.tsx +15 -3
  72. package/src/Ui/Center.tsx +2 -2
  73. 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
+ });
@@ -5,12 +5,17 @@ import Color from '../Color/Color';
5
5
  interface Props {
6
6
  title: string;
7
7
  required?: boolean;
8
+ color?: string;
8
9
  }
9
10
 
10
- export default function LabelForm({ title, required }: Props) {
11
+ export default function LabelForm({
12
+ title,
13
+ required,
14
+ color = Color.gray[900],
15
+ }: Props) {
11
16
  return (
12
17
  <View>
13
- <Typography variant="t2" weight="semibold">
18
+ <Typography variant="t2" weight="semibold" color={color}>
14
19
  {title}{' '}
15
20
  {required && (
16
21
  <Typography variant="t2" weight="semibold" color={Color.danger[500]}>
package/src/Step/Step.tsx CHANGED
@@ -75,7 +75,7 @@ const styles = StyleSheet.create({
75
75
  paddingHorizontal: 24,
76
76
  width: screenWidth,
77
77
  backgroundColor: Color.info[50],
78
- paddingVertical: 16,
78
+ paddingVertical: 8,
79
79
  },
80
80
  contentContainer: {
81
81
  flex: 1,
@@ -8,6 +8,7 @@ import {
8
8
  } from 'react-native';
9
9
  import Color from '../Color/Color';
10
10
  import type { StepItemProps } from './type';
11
+ import Icon from '../Icon';
11
12
 
12
13
  const StepItem = ({
13
14
  index = 0,
@@ -28,9 +29,17 @@ const StepItem = ({
28
29
  isActive && styles.active,
29
30
  ]}
30
31
  >
31
- <Text style={styles.circleText}>{index + 1}</Text>
32
+ {!isCompleted && <Text style={styles.circleText}>{index + 1}</Text>}
33
+ {isCompleted && <Icon name="Check" size={20} color="white" />}
32
34
  </View>
33
- {!isLast && <View style={styles.line} />}
35
+ {!isLast && (
36
+ <View
37
+ style={[
38
+ styles.line,
39
+ isCompleted ? styles.completedLine : undefined,
40
+ ]}
41
+ />
42
+ )}
34
43
  </View>
35
44
  );
36
45
  }
@@ -70,7 +79,7 @@ const styles = StyleSheet.create({
70
79
  backgroundColor: Color.info[500],
71
80
  },
72
81
  completed: {
73
- backgroundColor: Color.info[500],
82
+ backgroundColor: Color.success[500],
74
83
  },
75
84
  line: {
76
85
  width: 40,
@@ -82,5 +91,8 @@ const styles = StyleSheet.create({
82
91
  flex: 1,
83
92
  },
84
93
  listContent: {},
94
+ completedLine: {
95
+ backgroundColor: Color.success[500],
96
+ },
85
97
  });
86
98
  export default StepItem;
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',