@herca/rn-kit 0.1.40 → 0.1.42

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 (36) hide show
  1. package/lib/module/Icon/Icon.js +7 -1
  2. package/lib/module/Icon/Icon.js.map +1 -1
  3. package/lib/module/Icon/README.md +3 -0
  4. package/lib/module/Icon/icons/ExclamationTriangle.js +22 -0
  5. package/lib/module/Icon/icons/ExclamationTriangle.js.map +1 -0
  6. package/lib/module/Icon/icons/PdfFile.js +36 -0
  7. package/lib/module/Icon/icons/PdfFile.js.map +1 -0
  8. package/lib/module/Icon/icons/RotateRight.js +22 -0
  9. package/lib/module/Icon/icons/RotateRight.js.map +1 -0
  10. package/lib/module/Input/InputFile.js +194 -59
  11. package/lib/module/Input/InputFile.js.map +1 -1
  12. package/lib/module/Input/README_INPUT_FILE.md +132 -0
  13. package/lib/module/Ui/Container.js.map +1 -1
  14. package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
  15. package/lib/typescript/src/Icon/icons/ExclamationTriangle.d.ts +9 -0
  16. package/lib/typescript/src/Icon/icons/ExclamationTriangle.d.ts.map +1 -0
  17. package/lib/typescript/src/Icon/icons/PdfFile.d.ts +11 -0
  18. package/lib/typescript/src/Icon/icons/PdfFile.d.ts.map +1 -0
  19. package/lib/typescript/src/Icon/icons/RotateRight.d.ts +9 -0
  20. package/lib/typescript/src/Icon/icons/RotateRight.d.ts.map +1 -0
  21. package/lib/typescript/src/Icon/type.d.ts +1 -1
  22. package/lib/typescript/src/Icon/type.d.ts.map +1 -1
  23. package/lib/typescript/src/Input/InputFile.d.ts +23 -3
  24. package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
  25. package/lib/typescript/src/Ui/Container.d.ts +7 -1
  26. package/lib/typescript/src/Ui/Container.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/Icon/Icon.tsx +6 -0
  29. package/src/Icon/README.md +3 -0
  30. package/src/Icon/icons/ExclamationTriangle.tsx +23 -0
  31. package/src/Icon/icons/PdfFile.tsx +40 -0
  32. package/src/Icon/icons/RotateRight.tsx +23 -0
  33. package/src/Icon/type.tsx +3 -0
  34. package/src/Input/InputFile.tsx +235 -64
  35. package/src/Input/README_INPUT_FILE.md +132 -0
  36. package/src/Ui/Container.tsx +7 -2
@@ -0,0 +1,132 @@
1
+ # 📂 InputFile Component
2
+
3
+ Komponen `InputFile` digunakan untuk mengunggah, menampilkan, mengganti, menghapus, serta memberi label pada dokumen atau gambar di aplikasi React Native.
4
+ Mendukung **camera**, **gallery**, dan **document picker** dengan tampilan preview dan konfirmasi aksi.
5
+
6
+ ---
7
+
8
+ ## ✨ Fitur
9
+ - Upload file dari **kamera**, **galeri**, atau **dokumen perangkat**.
10
+ - Preview file (gambar atau dokumen).
11
+ - Mendukung **multiple file upload**.
12
+ - Ganti file (replace) atau hapus file dengan konfirmasi.
13
+ - Tambahkan label/nama dokumen secara manual.
14
+ - Konfigurasi teks modal (custom title, description, button).
15
+ - Callback `onChange` untuk mengirim data file terbaru ke parent.
16
+
17
+ ---
18
+
19
+ ## 📦 Dependencies
20
+ Komponen ini membutuhkan beberapa library:
21
+ - [`@react-native-documents/picker`](https://github.com/react-native-documents/picker)
22
+ - [`@react-native-documents/viewer`](https://github.com/react-native-documents/viewer)
23
+ - [`react-native-image-picker`](https://github.com/react-native-image-picker/react-native-image-picker)
24
+
25
+ ---
26
+
27
+ ## 🚀 Penggunaan
28
+
29
+ ```tsx
30
+ import InputFile from "@/components/Input/InputFile";
31
+ import { useState } from "react";
32
+
33
+ export default function ExampleScreen() {
34
+ const [files, setFiles] = useState<any[]>([]);
35
+
36
+ return (
37
+ <InputFile
38
+ title="Upload Dokumen"
39
+ description="Format file: JPG, PNG, PDF"
40
+ btnChooseFileText="Pilih File"
41
+ multiple={true}
42
+ value={files}
43
+ useChangeLabel={true}
44
+ modalPickFileText={{
45
+ title: "Pilih Sumber",
46
+ description: "Unggah dokumen atau ambil foto",
47
+ camera: { title: "Kamera", description: "Ambil foto langsung" },
48
+ gallery: { title: "Galeri", description: "Pilih gambar dari galeri" },
49
+ document: { title: "Dokumen", description: "Pilih file dari perangkat" },
50
+ }}
51
+ modalDeleteText={{
52
+ title: "Hapus File?",
53
+ description: "Apakah kamu yakin ingin menghapus file ini?",
54
+ confirmBtn: {
55
+ confirm: "Ya, Hapus",
56
+ cancel: "Batal",
57
+ },
58
+ }}
59
+ onChange={(newFiles) => setFiles(newFiles)}
60
+ />
61
+ );
62
+ }
63
+ ```
64
+
65
+ ---
66
+
67
+ ## ⚙️ Props
68
+
69
+ | Prop | Tipe | Default | Deskripsi |
70
+ |--------------------|-----------------------------------|-----------------------------------------------------------|---------------------------------------------------------------------------|
71
+ | `title` | `string` | `"Upload File"` | Judul input file. |
72
+ | `description` | `string` | `"File harus berformat JPG, PNG dan PDF"` | Deskripsi singkat tentang file yang diterima. |
73
+ | `accept` | `string[]` | `["application/pdf", "image/jpeg", "image/png"]` | Tipe MIME file yang diizinkan. |
74
+ | `multiple` | `boolean` | `false` | Jika `true`, memungkinkan memilih banyak file sekaligus. |
75
+ | `value` | `any[]` | `[]` | Daftar file yang sudah dipilih (state dari parent). |
76
+ | `onChange` | `(files: any[]) => void` | `undefined` | Callback saat daftar file berubah (add, replace, delete). |
77
+ | `btnChooseFileText`| `string` | `"Choose File"` | Label tombol untuk memilih file. |
78
+ | `modalPickFileText`| `modalPickFileText` (lihat bawah) | `undefined` | Teks kustom pada modal pemilihan sumber file. |
79
+ | `modalDeleteText` | `ModalOption & confirmBtn` | `undefined` | Teks kustom pada modal konfirmasi hapus file. |
80
+ | `useChangeLabel` | `boolean` | `false` | Jika `true`, menampilkan input untuk memberi nama/label pada file. |
81
+
82
+ ---
83
+
84
+ ## 🔤 Tipe Tambahan
85
+
86
+ ### `ModalOption`
87
+ ```ts
88
+ interface ModalOption {
89
+ title?: string;
90
+ description?: string;
91
+ }
92
+ ```
93
+
94
+ ### `modalPickFileText`
95
+ ```ts
96
+ interface modalPickFileText {
97
+ title?: string;
98
+ description?: string;
99
+ camera?: ModalOption;
100
+ gallery?: ModalOption;
101
+ document?: ModalOption;
102
+ }
103
+ ```
104
+
105
+ ### `modalDeleteText`
106
+ ```ts
107
+ interface ModalOption {
108
+ title?: string;
109
+ description?: string;
110
+ confirmBtn?: {
111
+ confirm?: string;
112
+ cancel?: string;
113
+ };
114
+ }
115
+ ```
116
+
117
+ ---
118
+
119
+ ## 📸 Preview UI
120
+ - **Card input awal** → tombol pilih file + icon ilustrasi.
121
+ - **Preview file** → menampilkan nama, ukuran, icon (atau thumbnail jika image).
122
+ - **Aksi file**:
123
+ - 🔄 Replace
124
+ - ❌ Delete
125
+ - 👁 Preview (buka dokumen dengan `viewDocument`)
126
+
127
+ ---
128
+
129
+ ## 🛠 Catatan
130
+ 1. Pastikan permission kamera & storage sudah diatur (Android/iOS).
131
+ 2. File hasil picker akan memiliki property standar (`uri`, `type`, `name`, `size`).
132
+ 3. Untuk **multiple upload**, `value` berupa array file yang akan dikelola oleh parent.
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","View","jsx","_jsx","Container","children","style","styles","container","create","paddingHorizontal","paddingVertical"],"sourceRoot":"../../../src","sources":["Ui/Container.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,eAAe,SAASC,SAASA,CAAC;EAAEC,QAAQ;EAAEC;AAAW,CAAC,EAAE;EAC1D,oBAAOH,IAAA,CAACF,IAAI;IAACK,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAEF,KAAK,IAAIA,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAO,CAAC;AAC3E;AAEA,MAAME,MAAM,GAAGP,UAAU,CAACS,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","View","jsx","_jsx","Container","children","style","styles","container","create","paddingHorizontal","paddingVertical"],"sourceRoot":"../../../src","sources":["Ui/Container.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAwB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOhE,eAAe,SAASC,SAASA,CAAC;EAAEC,QAAQ;EAAEC;AAAa,CAAC,EAAE;EAC5D,oBAAOH,IAAA,CAACF,IAAI;IAACK,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAEF,KAAK,IAAIA,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAO,CAAC;AAC3E;AAEA,MAAME,MAAM,GAAGP,UAAU,CAACS,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAyJvD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAa7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,QAAQ,CAAC;AA+JvD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAa7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ size?: number;
4
+ color?: string;
5
+ style?: object;
6
+ }
7
+ declare const ExclamationTriangle: React.FC<Props>;
8
+ export default ExclamationTriangle;
9
+ //# sourceMappingURL=ExclamationTriangle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExclamationTriangle.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/ExclamationTriangle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAWxC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ size?: number;
4
+ bgColor?: string;
5
+ cornerColor?: string;
6
+ textColor?: string;
7
+ style?: object;
8
+ }
9
+ declare const PdfFile: React.FC<Props>;
10
+ export default PdfFile;
11
+ //# sourceMappingURL=PdfFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfFile.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/PdfFile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA0B5B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ size?: number;
4
+ color?: string;
5
+ style?: object;
6
+ }
7
+ declare const RotateRight: React.FC<Props>;
8
+ export default RotateRight;
9
+ //# sourceMappingURL=RotateRight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RotateRight.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/RotateRight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAWhC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type ViewStyle } from 'react-native';
2
- export type IconNameProps = 'Search' | 'User' | 'Eye' | 'EyeOpen' | 'ArrowRight' | 'ArrowLeft' | 'Document' | 'Calendar' | 'ExclamationMark' | 'Download' | 'x-circle' | 'StickyNote' | 'RadioButton' | 'Pdf' | 'ArrowBackAlt' | 'ArrowForwardAlt' | 'ArrowDown' | 'ArrowUp' | 'Check' | 'Filter' | 'AirPlane' | 'Camera' | 'Image' | 'Times' | 'Plus' | 'Minus' | 'Bell' | 'file-list-check' | 'file-text' | 'bookmark-user' | 'folder-clock' | 'home-fill' | 'home-outline' | 'user-circle-outline' | 'user-circle-fill' | 'clipboard-list-check' | 'clipboard-list' | 'Megaphone' | 'Scanner' | 'Clock' | 'clock-outline' | 'clipboard-list-check-outline' | 'box-outline' | 'Box' | 'plus-square' | 'at-sign' | 'briefcase-outline' | 'edit-square-outline' | 'globe-earth' | 'lock-fill' | 'logo-herca-hris' | 'question-circle-outline' | 'shield-fill' | 'Users' | 'Bold' | 'Italic' | 'UnderLine' | 'settings-slider' | 'location-pin-fill' | 'discount-fill' | 'rotate-square-fill' | 'copy-fill' | 'copy-text-fill' | 'shield-checked-fill' | 'calendar-edit' | 'info-circle-outline' | 'Tag' | 'Tool' | 'user-edit' | 'Bolt' | 'bolt-slash' | 'image-plus' | 'Trash' | 'time-forward' | 'Signature' | 'Money' | 'info-circle-fill' | 'Flag' | 'Coupon' | 'more-vertical' | 'whatsapp-fill';
2
+ export type IconNameProps = 'Search' | 'User' | 'Eye' | 'EyeOpen' | 'ArrowRight' | 'ArrowLeft' | 'Document' | 'Calendar' | 'ExclamationMark' | 'exclamation-triangle' | 'Download' | 'x-circle' | 'StickyNote' | 'RadioButton' | 'Pdf' | 'pdf-file' | 'ArrowBackAlt' | 'ArrowForwardAlt' | 'ArrowDown' | 'ArrowUp' | 'Check' | 'Filter' | 'AirPlane' | 'Camera' | 'Image' | 'Times' | 'Plus' | 'Minus' | 'Bell' | 'file-list-check' | 'file-text' | 'bookmark-user' | 'folder-clock' | 'home-fill' | 'home-outline' | 'user-circle-outline' | 'user-circle-fill' | 'clipboard-list-check' | 'clipboard-list' | 'Megaphone' | 'Scanner' | 'Clock' | 'clock-outline' | 'clipboard-list-check-outline' | 'box-outline' | 'Box' | 'plus-square' | 'at-sign' | 'briefcase-outline' | 'edit-square-outline' | 'globe-earth' | 'lock-fill' | 'logo-herca-hris' | 'question-circle-outline' | 'shield-fill' | 'Users' | 'Bold' | 'Italic' | 'UnderLine' | 'settings-slider' | 'location-pin-fill' | 'discount-fill' | 'rotate-square-fill' | 'rotate-right' | 'copy-fill' | 'copy-text-fill' | 'shield-checked-fill' | 'calendar-edit' | 'info-circle-outline' | 'Tag' | 'Tool' | 'user-edit' | 'Bolt' | 'bolt-slash' | 'image-plus' | 'Trash' | 'time-forward' | 'Signature' | 'Money' | 'info-circle-fill' | 'Flag' | 'Coupon' | 'more-vertical' | 'whatsapp-fill';
3
3
  export interface IconProps {
4
4
  name: IconNameProps;
5
5
  size?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Icon/type.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,GACT,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,aAAa,GACb,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,cAAc,GACd,WAAW,GACX,cAAc,GACd,qBAAqB,GACrB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,OAAO,GACP,eAAe,GACf,8BAA8B,GAC9B,aAAa,GACb,KAAK,GACL,aAAa,GACb,SAAS,GACT,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,yBAAyB,GACzB,aAAa,GACb,OAAO,GACP,MAAM,GACN,QAAQ,GACR,WAAW,GACX,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,WAAW,GACX,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,GACf,qBAAqB,GACrB,KAAK,GACL,MAAM,GACN,WAAW,GACX,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,cAAc,GACd,WAAW,GACX,OAAO,GACP,kBAAkB,GAClB,MAAM,GACN,QAAQ,GACR,eAAe,GACf,eAAe,CAAC;AACpB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Icon/type.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,GACT,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,sBAAsB,GACtB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,aAAa,GACb,KAAK,GACL,UAAU,GACV,cAAc,GACd,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,cAAc,GACd,WAAW,GACX,cAAc,GACd,qBAAqB,GACrB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,OAAO,GACP,eAAe,GACf,8BAA8B,GAC9B,aAAa,GACb,KAAK,GACL,aAAa,GACb,SAAS,GACT,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,yBAAyB,GACzB,aAAa,GACb,OAAO,GACP,MAAM,GACN,QAAQ,GACR,WAAW,GACX,iBAAiB,GACjB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,gBAAgB,GAChB,qBAAqB,GACrB,eAAe,GACf,qBAAqB,GACrB,KAAK,GACL,MAAM,GACN,WAAW,GACX,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,cAAc,GACd,WAAW,GACX,OAAO,GACP,kBAAkB,GAClB,MAAM,GACN,QAAQ,GACR,eAAe,GACf,eAAe,CAAC;AACpB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
@@ -1,11 +1,31 @@
1
+ export interface ModalOption {
2
+ title?: string;
3
+ description?: string;
4
+ }
5
+ export interface modalPickFileText {
6
+ title?: string;
7
+ description?: string;
8
+ camera?: ModalOption;
9
+ gallery?: ModalOption;
10
+ document?: ModalOption;
11
+ }
1
12
  type InputFileProps = {
2
13
  title?: string;
3
14
  description?: string;
4
- maxFileSize?: number;
5
15
  accept?: string[];
6
16
  multiple?: boolean;
7
- onChange?: (files: any[]) => void;
17
+ onChange?: (files: any) => void;
18
+ value?: any[];
19
+ modalPickFileText?: modalPickFileText;
20
+ useChangeLabel?: boolean;
21
+ btnChooseFileText?: string;
22
+ modalDeleteText?: ModalOption & {
23
+ confirmBtn?: {
24
+ confirm?: string;
25
+ cancel?: string;
26
+ };
27
+ };
8
28
  };
9
- export default function InputFile({ title, description, maxFileSize, accept, multiple, onChange, }: InputFileProps): import("react/jsx-runtime").JSX.Element;
29
+ export default function InputFile({ title, description, accept, btnChooseFileText, multiple, value, modalPickFileText, modalDeleteText, useChangeLabel, onChange, }: InputFileProps): import("react/jsx-runtime").JSX.Element;
10
30
  export {};
11
31
  //# sourceMappingURL=InputFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputFile.d.ts","sourceRoot":"","sources":["../../../../src/Input/InputFile.tsx"],"names":[],"mappings":"AAgBA,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAqB,EACrB,WAAqD,EACrD,WAAe,EACf,MAAuD,EACvD,QAAgB,EAChB,QAAQ,GACT,EAAE,cAAc,2CAkPhB"}
1
+ {"version":3,"file":"InputFile.d.ts","sourceRoot":"","sources":["../../../../src/Input/InputFile.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,WAAW,GAAG;QAC9B,UAAU,CAAC,EAAE;YACX,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAqB,EACrB,WAAqD,EACrD,MAAuD,EACvD,iBAAiC,EACjC,QAAgB,EAChB,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,cAAsB,EACtB,QAAQ,GACT,EAAE,cAAc,2CA+WhB"}
@@ -1,2 +1,8 @@
1
- export default function Container({ children, style }: any): import("react/jsx-runtime").JSX.Element;
1
+ import { type ViewStyle } from 'react-native';
2
+ interface Props {
3
+ children: React.ReactNode;
4
+ style?: ViewStyle;
5
+ }
6
+ export default function Container({ children, style }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
2
8
  //# sourceMappingURL=Container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Container.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,2CAEzD"}
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,2CAE3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herca/rn-kit",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "React Native UI Kit",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
package/src/Icon/Icon.tsx CHANGED
@@ -82,6 +82,9 @@ import InfoCircleFill from './icons/InfoCircleFill';
82
82
  import Flag from './icons/Flag';
83
83
  import Coupon from './icons/Coupon';
84
84
  import MoreVertical from './icons/MoreVertical';
85
+ import ExclamationTriangle from './icons/ExclamationTriangle';
86
+ import PdfFile from './icons/PdfFile';
87
+ import RotateRight from './icons/RotateRight';
85
88
 
86
89
  const icons: Record<
87
90
  IconNameProps,
@@ -168,6 +171,9 @@ const icons: Record<
168
171
  'Flag': Flag,
169
172
  'Coupon': Coupon,
170
173
  'more-vertical': MoreVertical,
174
+ 'exclamation-triangle': ExclamationTriangle,
175
+ 'pdf-file': PdfFile,
176
+ 'rotate-right': RotateRight,
171
177
  };
172
178
 
173
179
  const Icon: React.FC<IconProps> = ({
@@ -129,3 +129,6 @@ export default function App() {
129
129
  - Flag
130
130
  - Coupon
131
131
  - more-vertical
132
+ - exclamation-triangle
133
+ - pdf-file
134
+ - rotate-right
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import Svg, { Path } from 'react-native-svg';
3
+
4
+ interface Props {
5
+ size?: number;
6
+ color?: string;
7
+ style?: object;
8
+ }
9
+
10
+ const ExclamationTriangle: React.FC<Props> = ({
11
+ size = 24,
12
+ color = '#909090',
13
+ style,
14
+ }) => (
15
+ <Svg width={size} height={size} viewBox="0 0 16 16" fill="none" style={style}>
16
+ <Path
17
+ d="M14.4046 11.4345L9.99996 3.197C9.14662 1.601 6.85396 1.601 5.99996 3.197L1.59533 11.4345C0.812667 12.8985 1.87536 14.6664 3.53869 14.6664H12.4612C14.1239 14.6664 15.1872 12.8978 14.4046 11.4345ZM7.49996 6.6664C7.49996 6.3904 7.72396 6.1664 7.99996 6.1664C8.27596 6.1664 8.49996 6.3904 8.49996 6.6664V9.33307C8.49996 9.60907 8.27596 9.83307 7.99996 9.83307C7.72396 9.83307 7.49996 9.60907 7.49996 9.33307V6.6664ZM8.0133 11.9997C7.6453 11.9997 7.34322 11.7011 7.34322 11.3331C7.34322 10.9651 7.63863 10.6664 8.00663 10.6664H8.0133C8.38197 10.6664 8.67997 10.9651 8.67997 11.3331C8.67997 11.7011 8.3813 11.9997 8.0133 11.9997Z"
18
+ fill={color}
19
+ />
20
+ </Svg>
21
+ );
22
+
23
+ export default ExclamationTriangle;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import Svg, { Path } from 'react-native-svg';
3
+
4
+ interface Props {
5
+ size?: number;
6
+ bgColor?: string;
7
+ cornerColor?: string;
8
+ textColor?: string;
9
+ style?: object;
10
+ }
11
+
12
+ const PdfFile: React.FC<Props> = ({
13
+ size = 24,
14
+ style,
15
+ bgColor = '#F04438',
16
+ cornerColor = '#FF8689',
17
+ textColor = '#fff',
18
+ }) => (
19
+ <Svg width={size} height={size} viewBox="0 0 44 44" fill="none" style={style}>
20
+ <Path
21
+ d="M8.5957 10.8281C8.5957 7.12609 11.5968 4.125 15.2988 4.125H25.2488L35.4058 14.6875V33.1719C35.4058 36.8739 32.4047 39.875 28.7027 39.875H15.2988C11.5968 39.875 8.5957 36.8739 8.5957 33.1719V10.8281Z"
22
+ fill={bgColor}
23
+ />
24
+ <Path d="M25.25 14.6875V4.125L35.4062 14.6875H25.25Z" fill={cornerColor} />
25
+ <Path
26
+ d="M16.5114 25.9497C17.2466 25.9497 17.7968 26.1097 18.1617 26.4297C18.5294 26.7498 18.7132 27.2047 18.7132 27.7945C18.7132 28.059 18.6748 28.3129 18.5981 28.5562C18.5241 28.7995 18.4011 29.0164 18.2292 29.2068C18.0599 29.3973 17.8338 29.548 17.5508 29.6591C17.2704 29.7702 16.924 29.8257 16.5114 29.8257H16.071V31.7499H14.5039V25.9497H16.5114ZM16.4756 27.2153H16.071V28.5483H16.3804C16.5153 28.5483 16.641 28.5258 16.7573 28.4808C16.8737 28.4332 16.9663 28.3578 17.035 28.2547C17.1064 28.1489 17.1422 28.0087 17.1422 27.8342C17.1422 27.6517 17.0879 27.5036 16.9795 27.3898C16.8711 27.2735 16.7031 27.2153 16.4756 27.2153Z"
27
+ fill={textColor}
28
+ />
29
+ <Path
30
+ d="M24.3985 28.7268C24.3985 29.4012 24.2728 29.962 24.0216 30.4089C23.7703 30.8559 23.4159 31.1918 22.9584 31.4166C22.5034 31.6388 21.9679 31.7499 21.3516 31.7499H19.4751V25.9497H21.4825C22.1067 25.9497 22.6357 26.0568 23.0694 26.2711C23.5032 26.4853 23.8325 26.7987 24.0573 27.2113C24.2847 27.6239 24.3985 28.1291 24.3985 28.7268ZM22.7719 28.7823C22.7719 28.4306 22.7243 28.1396 22.6291 27.9095C22.5365 27.6768 22.3963 27.5036 22.2085 27.3898C22.0207 27.2735 21.784 27.2153 21.4984 27.2153H21.0422V30.4645H21.3913C21.8673 30.4645 22.2165 30.3269 22.4386 30.0519C22.6608 29.7742 22.7719 29.351 22.7719 28.7823Z"
31
+ fill={textColor}
32
+ />
33
+ <Path
34
+ d="M26.8226 31.7499H25.2794V25.9497H28.7071V27.2073H26.8226V28.3142H28.5603V29.5718H26.8226V31.7499Z"
35
+ fill={textColor}
36
+ />
37
+ </Svg>
38
+ );
39
+
40
+ export default PdfFile;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import Svg, { Path } from 'react-native-svg';
3
+
4
+ interface Props {
5
+ size?: number;
6
+ color?: string;
7
+ style?: object;
8
+ }
9
+
10
+ const RotateRight: React.FC<Props> = ({
11
+ size = 24,
12
+ color = '#909090',
13
+ style,
14
+ }) => (
15
+ <Svg width={size} height={size} viewBox="0 0 16 16" fill="none" style={style}>
16
+ <Path
17
+ d="M14.6663 2.66699V6.00033C14.6663 6.36833 14.3683 6.66699 13.9997 6.66699H10.6663C10.2977 6.66699 9.99967 6.36833 9.99967 6.00033C9.99967 5.63233 10.2977 5.33366 10.6663 5.33366H12.6063C11.6683 3.71033 9.92434 2.66699 7.99967 2.66699C5.05901 2.66699 2.66634 5.05966 2.66634 8.00033C2.66634 10.941 5.05901 13.3337 7.99967 13.3337C10.0383 13.3337 11.8684 12.1983 12.7757 10.3703C12.939 10.0409 13.3403 9.90499 13.6689 10.0697C13.9989 10.2337 14.1337 10.6337 13.9697 10.9631C12.8357 13.2477 10.5477 14.6663 7.99967 14.6663C4.32367 14.6663 1.33301 11.6757 1.33301 7.99967C1.33301 4.32367 4.32367 1.33301 7.99967 1.33301C10.135 1.33301 12.0977 2.35638 13.333 4.00505V2.66699C13.333 2.29899 13.631 2.00033 13.9997 2.00033C14.3683 2.00033 14.6663 2.29899 14.6663 2.66699Z"
18
+ fill={color}
19
+ />
20
+ </Svg>
21
+ );
22
+
23
+ export default RotateRight;
package/src/Icon/type.tsx CHANGED
@@ -12,11 +12,13 @@ export type IconNameProps =
12
12
  | 'Document'
13
13
  | 'Calendar'
14
14
  | 'ExclamationMark'
15
+ | 'exclamation-triangle'
15
16
  | 'Download'
16
17
  | 'x-circle'
17
18
  | 'StickyNote'
18
19
  | 'RadioButton'
19
20
  | 'Pdf'
21
+ | 'pdf-file'
20
22
  | 'ArrowBackAlt'
21
23
  | 'ArrowForwardAlt'
22
24
  | 'ArrowDown'
@@ -64,6 +66,7 @@ export type IconNameProps =
64
66
  | 'location-pin-fill'
65
67
  | 'discount-fill'
66
68
  | 'rotate-square-fill'
69
+ | 'rotate-right'
67
70
  | 'copy-fill'
68
71
  | 'copy-text-fill'
69
72
  | 'shield-checked-fill'