@herca/rn-kit 0.1.32 → 0.1.34
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/README.md +5 -3
- package/lib/module/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/Chip/README_CHIP_ITEM.md +73 -0
- package/lib/module/Icon/Icon.js +7 -1
- package/lib/module/Icon/Icon.js.map +1 -1
- package/lib/module/Icon/README.md +4 -0
- package/lib/module/Icon/icons/DiscountFill.js +23 -0
- package/lib/module/Icon/icons/DiscountFill.js.map +1 -0
- package/lib/module/Icon/icons/LocationPinFill.js +21 -0
- package/lib/module/Icon/icons/LocationPinFill.js.map +1 -0
- package/lib/module/Icon/icons/RotateSquareFill.js +21 -0
- package/lib/module/Icon/icons/RotateSquareFill.js.map +1 -0
- package/lib/module/Select/README.md +26 -17
- package/lib/module/Select/Select.js +8 -2
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Skeleton/README.md +79 -0
- package/lib/module/Skeleton/Skeleton.js +73 -0
- package/lib/module/Skeleton/Skeleton.js.map +1 -0
- package/lib/module/Skeleton/type.js +4 -0
- package/lib/module/Skeleton/type.js.map +1 -0
- package/lib/module/Tab/README.md +49 -6
- package/lib/module/Tab/Tab.js +3 -3
- package/lib/module/Tab/Tab.js.map +1 -1
- package/lib/module/Tab/TabItem.js.map +1 -1
- package/lib/module/Timeline/README.md +18 -19
- package/lib/module/Timeline/TimelineItem.js +10 -8
- package/lib/module/Timeline/TimelineItem.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/Icon/icons/DiscountFill.d.ts +8 -0
- package/lib/typescript/src/Icon/icons/DiscountFill.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/LocationPinFill.d.ts +8 -0
- package/lib/typescript/src/Icon/icons/LocationPinFill.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/RotateSquareFill.d.ts +8 -0
- package/lib/typescript/src/Icon/icons/RotateSquareFill.d.ts.map +1 -0
- package/lib/typescript/src/Icon/type.d.ts +1 -1
- package/lib/typescript/src/Icon/type.d.ts.map +1 -1
- package/lib/typescript/src/Select/Select.d.ts +1 -1
- package/lib/typescript/src/Select/Select.d.ts.map +1 -1
- package/lib/typescript/src/Select/type.d.ts +2 -0
- package/lib/typescript/src/Select/type.d.ts.map +1 -1
- package/lib/typescript/src/Skeleton/Skeleton.d.ts +5 -0
- package/lib/typescript/src/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/src/Skeleton/type.d.ts +10 -0
- package/lib/typescript/src/Skeleton/type.d.ts.map +1 -0
- package/lib/typescript/src/Tab/Tab.d.ts.map +1 -1
- package/lib/typescript/src/Tab/TabItem.d.ts.map +1 -1
- package/lib/typescript/src/Tab/type.d.ts +1 -1
- package/lib/typescript/src/Tab/type.d.ts.map +1 -1
- package/lib/typescript/src/Timeline/TimelineItem.d.ts +2 -1
- package/lib/typescript/src/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BottomSheet/BottomSheet.tsx +3 -1
- package/src/Chip/README_CHIP_ITEM.md +73 -0
- package/src/Icon/Icon.tsx +6 -0
- package/src/Icon/README.md +4 -0
- package/src/Icon/icons/DiscountFill.tsx +26 -0
- package/src/Icon/icons/LocationPinFill.tsx +28 -0
- package/src/Icon/icons/RotateSquareFill.tsx +22 -0
- package/src/Icon/type.tsx +3 -0
- package/src/Select/README.md +26 -17
- package/src/Select/Select.tsx +8 -1
- package/src/Select/type.tsx +2 -0
- package/src/Skeleton/README.md +79 -0
- package/src/Skeleton/Skeleton.tsx +99 -0
- package/src/Skeleton/type.ts +10 -0
- package/src/Tab/README.md +49 -6
- package/src/Tab/Tab.tsx +2 -3
- package/src/Tab/TabItem.tsx +1 -1
- package/src/Tab/type.tsx +1 -1
- package/src/Timeline/README.md +18 -19
- package/src/Timeline/TimelineItem.tsx +12 -10
- package/src/index.tsx +4 -0
package/src/Timeline/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# 🗂️ Timeline & TimelineItem
|
|
2
|
+
|
|
2
3
|
Timeline menampilkan rangkaian peristiwa secara vertikal—mirip “stepper” atau “activity feed”.
|
|
3
4
|
Setiap node diwakili oleh TimelineItem yang menampilkan titik (bullet icon) dan garis vertikal terhubung.
|
|
4
5
|
|
|
@@ -31,50 +32,48 @@ export default function OrderHistory() {
|
|
|
31
32
|
</Timeline>
|
|
32
33
|
);
|
|
33
34
|
}
|
|
34
|
-
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Props
|
|
38
38
|
|
|
39
39
|
### Timeline
|
|
40
|
+
|
|
40
41
|
| Prop | Type | Wajib | Default | Deskripsi |
|
|
41
42
|
| ---------- | ----------- | ----- | ------- | ---------------------------------- |
|
|
42
|
-
| `children` | `ReactNode` | ✅
|
|
43
|
-
|
|
43
|
+
| `children` | `ReactNode` | ✅ | — | Satu atau beberapa `TimelineItem`. |
|
|
44
44
|
|
|
45
45
|
### TimelineItem
|
|
46
|
-
| Prop | Type | Wajib | Default | Deskripsi |
|
|
47
|
-
| ---------- | ------------------------------------------------------------- | ----- | ----------- | ----------------------------------------------------- |
|
|
48
|
-
| `children` | `ReactNode` | ✅ | — | Konten untuk node timeline: teks, ikon tambahan, dsb. |
|
|
49
|
-
| `color` | `'primary' \| 'success' \| 'warning' \| 'danger' \| 'purple'` | ❌ | `'primary'` | Skema warna titik (`RadioButton`) dan garis vertikal. |
|
|
50
46
|
|
|
47
|
+
| Prop | Type | Wajib | Default | Deskripsi |
|
|
48
|
+
| ---------- | ------------------------------------------------------------- | ----- | ----------- | ---------------------------------------------------------------- |
|
|
49
|
+
| `children` | `ReactNode` | ✅ | — | Konten untuk node timeline: teks, ikon tambahan, dsb. |
|
|
50
|
+
| `color` | `'primary' \| 'success' \| 'warning' \| 'danger' \| 'purple'` | ❌ | `'primary'` | Skema warna titik (`RadioButton`) dan garis vertikal. |
|
|
51
|
+
| `isLast` | `boolean` | ❌ | `false` | Menentukan apakah garis garis di kiri itu dimunculkan atau tidak |
|
|
51
52
|
|
|
52
53
|
## ⚙️ Cara Kerja
|
|
53
54
|
|
|
54
55
|
1. Bullet & Line
|
|
56
|
+
- Bullet dirender dengan komponen Icon (name="RadioButton") memakai warna dari color.
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- Garis vertikal (borderLeftWidth: 1) menggunakan borderStyle: 'dashed'. Tingginya dihitung secara dinamis (contentHeight - 20) agar garis mulai tepat di bawah bullet.
|
|
58
|
+
- Garis vertikal (borderLeftWidth: 1) menggunakan borderStyle: 'dashed'. Tingginya dihitung secara dinamis (contentHeight - 20) agar garis mulai tepat di bawah bullet.
|
|
59
59
|
|
|
60
60
|
2. Penghitungan Tinggi
|
|
61
|
+
- onLayout pada wrapper konten mengukur tinggi aktual item.
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- Hasil pengukuran dipakai untuk menyesuaikan panjang garis, menjaga visual konsisten meskipun konten memiliki tinggi berbeda.
|
|
63
|
+
- Hasil pengukuran dipakai untuk menyesuaikan panjang garis, menjaga visual konsisten meskipun konten memiliki tinggi berbeda.
|
|
65
64
|
|
|
66
65
|
3. Layout
|
|
66
|
+
- Komponen dibangun dengan flexDirection: 'row', bullet di kiri, konten di kanan (flex: 1).
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- Margin horizontal (marginRight: 8) menjaga jarak antara bullet dan konten.
|
|
68
|
+
- Margin horizontal (marginRight: 8) menjaga jarak antara bullet dan konten.
|
|
71
69
|
|
|
72
70
|
## 💡 Tips Penggunaan
|
|
71
|
+
|
|
73
72
|
- Item Terakhir Tanpa Garis
|
|
74
|
-
Bila ingin menghilangkan garis pada item terakhir, buat prop opsional mis. isLast dan kondisikan tinggi garis menjadi 0.
|
|
73
|
+
Bila ingin menghilangkan garis pada item terakhir, buat prop opsional mis. isLast dan kondisikan tinggi garis menjadi 0.
|
|
75
74
|
|
|
76
75
|
- Interaktif
|
|
77
|
-
Anda bebas menambahkan tombol, TouchableOpacity, atau ikon status di dalam children.
|
|
76
|
+
Anda bebas menambahkan tombol, TouchableOpacity, atau ikon status di dalam children.
|
|
78
77
|
|
|
79
78
|
- Kustomisasi Warna
|
|
80
|
-
Untuk warna tambahan, update COLOR_MAP dan tipe ColorKey pada TimelineItem.
|
|
79
|
+
Untuk warna tambahan, update COLOR_MAP dan tipe ColorKey pada TimelineItem.
|
|
@@ -15,24 +15,18 @@ type ColorKey = keyof typeof COLOR_MAP;
|
|
|
15
15
|
interface TimelineItemProps {
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
color?: ColorKey;
|
|
18
|
+
isLast?: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export default function TimelineItem({
|
|
21
22
|
children,
|
|
22
23
|
color = 'primary',
|
|
24
|
+
isLast = false,
|
|
23
25
|
}: TimelineItemProps) {
|
|
24
26
|
const [contentHeight, setContentHeight] = useState(0);
|
|
25
27
|
const renderDashes = (count: number) => {
|
|
26
28
|
return Array.from({ length: count }).map((_, index) => (
|
|
27
|
-
<View
|
|
28
|
-
key={index}
|
|
29
|
-
style={{
|
|
30
|
-
width: 1,
|
|
31
|
-
height: 4,
|
|
32
|
-
backgroundColor: Color.gray[400],
|
|
33
|
-
marginVertical: 2,
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
29
|
+
<View key={index} style={styles.dashes} />
|
|
36
30
|
));
|
|
37
31
|
};
|
|
38
32
|
|
|
@@ -40,7 +34,9 @@ export default function TimelineItem({
|
|
|
40
34
|
<View style={styles.container}>
|
|
41
35
|
<View style={styles.contentLeft}>
|
|
42
36
|
<Icon name="RadioButton" color={COLOR_MAP[color]} />
|
|
43
|
-
<View>
|
|
37
|
+
<View>
|
|
38
|
+
{!isLast && renderDashes(Math.floor((contentHeight - 20) / 6))}
|
|
39
|
+
</View>
|
|
44
40
|
</View>
|
|
45
41
|
<View
|
|
46
42
|
style={styles.flex}
|
|
@@ -73,4 +69,10 @@ const styles = StyleSheet.create({
|
|
|
73
69
|
flex: {
|
|
74
70
|
flex: 1,
|
|
75
71
|
},
|
|
72
|
+
dashes: {
|
|
73
|
+
width: 1,
|
|
74
|
+
height: 4,
|
|
75
|
+
backgroundColor: Color.gray[400],
|
|
76
|
+
marginVertical: 2,
|
|
77
|
+
},
|
|
76
78
|
});
|
package/src/index.tsx
CHANGED
|
@@ -26,6 +26,7 @@ export { default as Gap } from './Ui/Gap';
|
|
|
26
26
|
export { default as Grid } from './Ui/Grid';
|
|
27
27
|
export { default as Col } from './Ui/Col';
|
|
28
28
|
export { default as Chip } from './Chip/Chip';
|
|
29
|
+
export { default as ChipItem } from './Chip/ChipItem';
|
|
29
30
|
export type {
|
|
30
31
|
ChipSelectedProps,
|
|
31
32
|
ChipOnSelectProps,
|
|
@@ -82,3 +83,6 @@ export { default as TextArea } from './Input/TextArea';
|
|
|
82
83
|
export { default as TextEditor } from './TextEditor/TextEditor';
|
|
83
84
|
// export { default as PdfView } from './FileView/PdfView';
|
|
84
85
|
export { ToastProvider, useToast } from './Toast/ToastContext';
|
|
86
|
+
export { default as Skeleton } from './Skeleton/Skeleton';
|
|
87
|
+
export type { SkeletonProps } from './Skeleton/type';
|
|
88
|
+
export { default as CounterButton } from './CounterButton/CounterButton';
|