@herca/rn-kit 0.1.33 → 0.1.35

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 (115) hide show
  1. package/lib/module/Accordion/Accordion.js +11 -2
  2. package/lib/module/Accordion/Accordion.js.map +1 -1
  3. package/lib/module/Accordion/AccordionItem.js +1 -0
  4. package/lib/module/Accordion/AccordionItem.js.map +1 -1
  5. package/lib/module/Accordion/README.md +14 -11
  6. package/lib/module/BadgeIcon/BadgeIcon.js +117 -0
  7. package/lib/module/BadgeIcon/BadgeIcon.js.map +1 -0
  8. package/lib/module/BadgeIcon/README.md +77 -0
  9. package/lib/module/BadgeIcon/type.js +2 -0
  10. package/lib/module/BadgeIcon/type.js.map +1 -0
  11. package/lib/module/BottomSheet/BottomSheet.js +1 -1
  12. package/lib/module/BottomSheet/BottomSheet.js.map +1 -1
  13. package/lib/module/CheckBox/CheckBox.js +65 -32
  14. package/lib/module/CheckBox/CheckBox.js.map +1 -1
  15. package/lib/module/CheckBox/CheckBoxList.js +10 -2
  16. package/lib/module/CheckBox/CheckBoxList.js.map +1 -1
  17. package/lib/module/CheckBox/README_CHECKBOX.md +10 -7
  18. package/lib/module/CheckBox/README_CHECKBOXLIST.md +13 -7
  19. package/lib/module/CheckBox/type.js +2 -0
  20. package/lib/module/CheckBox/type.js.map +1 -0
  21. package/lib/module/Icon/Icon.js +13 -1
  22. package/lib/module/Icon/Icon.js.map +1 -1
  23. package/lib/module/Icon/README.md +7 -0
  24. package/lib/module/Icon/icons/CopyFill.js +25 -0
  25. package/lib/module/Icon/icons/CopyFill.js.map +1 -0
  26. package/lib/module/Icon/icons/CopyTextFill.js +22 -0
  27. package/lib/module/Icon/icons/CopyTextFill.js.map +1 -0
  28. package/lib/module/Icon/icons/DiscountFill.js +23 -0
  29. package/lib/module/Icon/icons/DiscountFill.js.map +1 -0
  30. package/lib/module/Icon/icons/LocationPinFill.js +21 -0
  31. package/lib/module/Icon/icons/LocationPinFill.js.map +1 -0
  32. package/lib/module/Icon/icons/RadioButton.js +0 -1
  33. package/lib/module/Icon/icons/RadioButton.js.map +1 -1
  34. package/lib/module/Icon/icons/RotateSquareFill.js +21 -0
  35. package/lib/module/Icon/icons/RotateSquareFill.js.map +1 -0
  36. package/lib/module/Icon/icons/ShieldFillChecked.js +22 -0
  37. package/lib/module/Icon/icons/ShieldFillChecked.js.map +1 -0
  38. package/lib/module/Input/Input.js +19 -23
  39. package/lib/module/Input/Input.js.map +1 -1
  40. package/lib/module/Input/README_INPUT.md +17 -15
  41. package/lib/module/Tab/README.md +49 -6
  42. package/lib/module/Timeline/README.md +18 -19
  43. package/lib/module/Timeline/TimelineItem.js +14 -9
  44. package/lib/module/Timeline/TimelineItem.js.map +1 -1
  45. package/lib/module/index.js +1 -0
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/typescript/src/Accordion/Accordion.d.ts +1 -1
  48. package/lib/typescript/src/Accordion/Accordion.d.ts.map +1 -1
  49. package/lib/typescript/src/Accordion/AccordionItem.d.ts.map +1 -1
  50. package/lib/typescript/src/Accordion/type.d.ts +1 -0
  51. package/lib/typescript/src/Accordion/type.d.ts.map +1 -1
  52. package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts +20 -0
  53. package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts.map +1 -0
  54. package/lib/typescript/src/BadgeIcon/type.d.ts +11 -0
  55. package/lib/typescript/src/BadgeIcon/type.d.ts.map +1 -0
  56. package/lib/typescript/src/BottomSheet/BottomSheet.d.ts.map +1 -1
  57. package/lib/typescript/src/CheckBox/CheckBox.d.ts +4 -0
  58. package/lib/typescript/src/CheckBox/CheckBox.d.ts.map +1 -1
  59. package/lib/typescript/src/CheckBox/CheckBoxList.d.ts +3 -0
  60. package/lib/typescript/src/CheckBox/CheckBoxList.d.ts.map +1 -1
  61. package/lib/typescript/src/CheckBox/type.d.ts +2 -0
  62. package/lib/typescript/src/CheckBox/type.d.ts.map +1 -0
  63. package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
  64. package/lib/typescript/src/Icon/icons/CopyFill.d.ts +9 -0
  65. package/lib/typescript/src/Icon/icons/CopyFill.d.ts.map +1 -0
  66. package/lib/typescript/src/Icon/icons/CopyTextFill.d.ts +9 -0
  67. package/lib/typescript/src/Icon/icons/CopyTextFill.d.ts.map +1 -0
  68. package/lib/typescript/src/Icon/icons/DiscountFill.d.ts +8 -0
  69. package/lib/typescript/src/Icon/icons/DiscountFill.d.ts.map +1 -0
  70. package/lib/typescript/src/Icon/icons/LocationPinFill.d.ts +8 -0
  71. package/lib/typescript/src/Icon/icons/LocationPinFill.d.ts.map +1 -0
  72. package/lib/typescript/src/Icon/icons/RotateSquareFill.d.ts +8 -0
  73. package/lib/typescript/src/Icon/icons/RotateSquareFill.d.ts.map +1 -0
  74. package/lib/typescript/src/Icon/icons/ShieldFillChecked.d.ts +9 -0
  75. package/lib/typescript/src/Icon/icons/ShieldFillChecked.d.ts.map +1 -0
  76. package/lib/typescript/src/Icon/type.d.ts +1 -1
  77. package/lib/typescript/src/Icon/type.d.ts.map +1 -1
  78. package/lib/typescript/src/Input/Input.d.ts.map +1 -1
  79. package/lib/typescript/src/Input/type.d.ts +1 -0
  80. package/lib/typescript/src/Input/type.d.ts.map +1 -1
  81. package/lib/typescript/src/Timeline/TimelineItem.d.ts +5 -1
  82. package/lib/typescript/src/Timeline/TimelineItem.d.ts.map +1 -1
  83. package/lib/typescript/src/index.d.ts +1 -0
  84. package/lib/typescript/src/index.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/src/Accordion/Accordion.tsx +15 -3
  87. package/src/Accordion/AccordionItem.tsx +5 -1
  88. package/src/Accordion/README.md +14 -11
  89. package/src/Accordion/type.tsx +1 -0
  90. package/src/BadgeIcon/BadgeIcon.tsx +126 -0
  91. package/src/BadgeIcon/README.md +77 -0
  92. package/src/BadgeIcon/type.tsx +21 -0
  93. package/src/BottomSheet/BottomSheet.tsx +5 -1
  94. package/src/CheckBox/CheckBox.tsx +45 -29
  95. package/src/CheckBox/CheckBoxList.tsx +12 -0
  96. package/src/CheckBox/README_CHECKBOX.md +10 -7
  97. package/src/CheckBox/README_CHECKBOXLIST.md +13 -7
  98. package/src/CheckBox/type.ts +9 -0
  99. package/src/Icon/Icon.tsx +12 -0
  100. package/src/Icon/README.md +7 -0
  101. package/src/Icon/icons/CopyFill.tsx +23 -0
  102. package/src/Icon/icons/CopyTextFill.tsx +29 -0
  103. package/src/Icon/icons/DiscountFill.tsx +26 -0
  104. package/src/Icon/icons/LocationPinFill.tsx +28 -0
  105. package/src/Icon/icons/RadioButton.tsx +1 -1
  106. package/src/Icon/icons/RotateSquareFill.tsx +22 -0
  107. package/src/Icon/icons/ShieldFillChecked.tsx +23 -0
  108. package/src/Icon/type.tsx +6 -0
  109. package/src/Input/Input.tsx +17 -25
  110. package/src/Input/README_INPUT.md +17 -15
  111. package/src/Input/type.tsx +1 -0
  112. package/src/Tab/README.md +49 -6
  113. package/src/Timeline/README.md +18 -19
  114. package/src/Timeline/TimelineItem.tsx +15 -10
  115. package/src/index.tsx +1 -0
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import Color from '../Color/Color';
4
+ import Icon, { type IconNameProps } from '../Icon';
5
+ import { hexToRGBA } from '../helpers/hexToRgba';
6
+ import type { HexColor, IconSizeStyle, Size, Variant } from './type';
7
+
8
+ interface BaseBadgeProps {
9
+ color?: Variant | HexColor;
10
+ size?: Size;
11
+ variant?: Variant;
12
+ }
13
+
14
+ interface IconBadgeProps extends BaseBadgeProps {
15
+ icon: IconNameProps;
16
+ children?: never;
17
+ }
18
+
19
+ interface ChildrenBadgeProps extends BaseBadgeProps {
20
+ icon?: never;
21
+ children: React.ReactNode;
22
+ }
23
+
24
+ // Union tipe
25
+ export type BadgeProps = IconBadgeProps | ChildrenBadgeProps;
26
+
27
+ const COLORS: Record<Variant, { background: string; fontColor: string }> = {
28
+ default: { background: Color.gray[100], fontColor: Color.gray[800] },
29
+ primary: { background: Color.primary[50], fontColor: Color.primary[1000] },
30
+ success: { background: Color.success[50], fontColor: Color.success[500] },
31
+ info: { background: Color.info[50], fontColor: Color.info[500] },
32
+ danger: { background: Color.danger[50], fontColor: Color.danger[600] },
33
+ warning: { background: Color.warning[50], fontColor: Color.warning[300] },
34
+ orange: { background: Color.orange[50], fontColor: Color.orange[500] },
35
+ purple: { background: Color.purple[50], fontColor: Color.purple[500] },
36
+ };
37
+
38
+ const SIZE_MAP: Record<Size, IconSizeStyle> = {
39
+ small: {
40
+ minHeight: 24,
41
+ minWidth: 24,
42
+ padding: 4,
43
+ borderRadius: 4,
44
+ },
45
+ medium: {
46
+ minHeight: 32,
47
+ minWidth: 32,
48
+ padding: 4,
49
+ borderRadius: 4,
50
+ },
51
+ large: {
52
+ minHeight: 40,
53
+ minWidth: 40,
54
+ padding: 8,
55
+ borderRadius: 4,
56
+ },
57
+ };
58
+
59
+ const ICON_SIZE_MAP: Record<Size, number> = {
60
+ small: 16,
61
+ medium: 24,
62
+ large: 24,
63
+ };
64
+
65
+ const BadgeIcon: React.FC<BadgeProps> = ({
66
+ icon,
67
+ size = 'medium',
68
+ color = 'default',
69
+ children,
70
+ }) => {
71
+ const safeSize: Size = ['small', 'medium', 'large'].includes(size)
72
+ ? size
73
+ : 'medium';
74
+
75
+ const isVariant = Object.prototype.hasOwnProperty.call(COLORS, color);
76
+
77
+ const { background, fontColor } = isVariant
78
+ ? COLORS[color as Variant]
79
+ : { background: color, fontColor: '#fff' };
80
+
81
+ const { minHeight, padding, minWidth, borderRadius } = SIZE_MAP[safeSize];
82
+
83
+ const iconSize = ICON_SIZE_MAP[safeSize];
84
+
85
+ const bgRgba = hexToRGBA(
86
+ typeof color === 'string' && color.startsWith('#') ? color : background,
87
+ 0.1
88
+ );
89
+
90
+ const isHex = typeof color === 'string' && color.startsWith('#');
91
+
92
+ return (
93
+ <View
94
+ style={[
95
+ styles.badge,
96
+ {
97
+ minHeight: minHeight,
98
+ minWidth: minWidth,
99
+ backgroundColor: isHex ? bgRgba : background,
100
+ padding: padding,
101
+ borderRadius: borderRadius,
102
+ },
103
+ ]}
104
+ >
105
+ {children
106
+ ? children
107
+ : icon && (
108
+ <Icon
109
+ name={icon}
110
+ color={isHex ? color : fontColor}
111
+ size={iconSize}
112
+ />
113
+ )}
114
+ </View>
115
+ );
116
+ };
117
+
118
+ const styles = StyleSheet.create({
119
+ badge: {
120
+ justifyContent: 'center',
121
+ alignItems: 'center',
122
+ alignSelf: 'flex-start',
123
+ },
124
+ });
125
+
126
+ export default BadgeIcon;
@@ -0,0 +1,77 @@
1
+ # BadgeIcon Component
2
+
3
+ `BadgeIcon` adalah komponen React Native untuk menampilkan **badge** yang dapat berisi **ikon** atau **konten custom** (children). Komponen ini fleksibel dalam ukuran (`size`), warna (`color`), dan varian (`variant`).
4
+
5
+ ---
6
+
7
+ ## ⚙️ Props
8
+
9
+ ### **BaseBadgeProps**
10
+
11
+ | Prop | Tipe | Default | Deskripsi |
12
+ | --------- | ------------------------------------ | ----------- | ------------------------------------------------------------------------- |
13
+ | `color` | `Variant` \| `HexColor` | `"default"` | Warna badge. Bisa berupa nama varian yang tersedia atau kode warna HEX. |
14
+ | `size` | `"small"` \| `"medium"` \| `"large"` | `"medium"` | Ukuran badge. Mengatur tinggi, lebar minimum, padding, dan radius border. |
15
+ | `variant` | `Variant` | - | Alias untuk varian warna (tidak digunakan langsung di komponen ini). |
16
+
17
+ ---
18
+
19
+ ### **IconBadgeProps** (Badge dengan Icon)
20
+
21
+ | Prop | Tipe | Deskripsi |
22
+ | ---------- | --------------- | ----------------------------------------------- |
23
+ | `icon` | `IconNameProps` | Nama ikon yang akan ditampilkan. |
24
+ | `children` | `never` | Tidak boleh ada children jika menggunakan ikon. |
25
+
26
+ ---
27
+
28
+ ### **ChildrenBadgeProps** (Badge dengan Konten Custom)
29
+
30
+ | Prop | Tipe | Deskripsi |
31
+ | ---------- | ----------------- | ----------------------------------------------- |
32
+ | `children` | `React.ReactNode` | Konten yang akan ditampilkan di dalam badge. |
33
+ | `icon` | `never` | Tidak boleh ada icon jika menggunakan children. |
34
+
35
+ ---
36
+
37
+ ## 🎨 Varian Warna (`Variant`)
38
+
39
+ | Nama Varian | Background | Font Color |
40
+ | ----------- | ------------------- | --------------------- |
41
+ | `default` | `Color.gray[100]` | `Color.gray[800]` |
42
+ | `primary` | `Color.primary[50]` | `Color.primary[1000]` |
43
+ | `success` | `Color.success[50]` | `Color.success[500]` |
44
+ | `info` | `Color.info[50]` | `Color.info[500]` |
45
+ | `danger` | `Color.danger[50]` | `Color.danger[600]` |
46
+ | `warning` | `Color.warning[50]` | `Color.warning[300]` |
47
+ | `orange` | `Color.orange[50]` | `Color.orange[500]` |
48
+ | `purple` | `Color.purple[50]` | `Color.purple[500]` |
49
+
50
+ > Jika `color` berupa kode HEX, maka background badge akan otomatis diubah menjadi warna transparan (`opacity 0.1`) menggunakan helper `hexToRGBA`.
51
+
52
+ ---
53
+
54
+ ## 📏 Ukuran Badge (`size`)
55
+
56
+ | Ukuran | minHeight | minWidth | Padding | BorderRadius | Icon Size |
57
+ | -------- | --------- | -------- | ------- | ------------ | --------- |
58
+ | `small` | 24 | 24 | 4 | 4 | 16 |
59
+ | `medium` | 32 | 32 | 4 | 4 | 24 |
60
+ | `large` | 40 | 40 | 8 | 4 | 24 |
61
+
62
+ ---
63
+
64
+ ## 💻 Contoh Penggunaan
65
+
66
+ ```tsx
67
+ <BadgeIcon icon="check" size="small" color="success" />
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 🛠 Catatan Implementasi
73
+
74
+ - Jika `color` adalah varian (`default`, `primary`, dsb.), warna background dan font color akan diambil dari konstanta `COLORS`.
75
+ - Jika `color` adalah kode HEX (`#rrggbb`), maka background akan menggunakan versi transparan dari warna tersebut.
76
+ - Menggunakan helper `hexToRGBA` untuk mengubah HEX menjadi warna RGBA.
77
+ - Komponen `Icon` digunakan untuk menampilkan ikon sesuai ukuran badge.
@@ -0,0 +1,21 @@
1
+ type Variant =
2
+ | 'default'
3
+ | 'primary'
4
+ | 'info'
5
+ | 'success'
6
+ | 'warning'
7
+ | 'danger'
8
+ | 'orange'
9
+ | 'purple';
10
+
11
+ type Size = 'small' | 'medium' | 'large';
12
+ type HexColor = `#${string}`;
13
+
14
+ export type { HexColor, Size, Variant };
15
+
16
+ export interface IconSizeStyle {
17
+ minHeight: number;
18
+ minWidth: number;
19
+ padding: number;
20
+ borderRadius: number;
21
+ }
@@ -20,7 +20,11 @@ import Color from '../Color/Color';
20
20
  import type { BottomSheetHeighProps, BottomSheetProops } from './type';
21
21
 
22
22
  const statusBarHeight =
23
- Platform.OS === 'android' ? (StatusBar.currentHeight ?? 24) : 65;
23
+ Platform.OS === 'android' && Platform.Version < 35
24
+ ? (StatusBar.currentHeight ?? 24)
25
+ : Platform.OS === 'android' && Platform.Version >= 35
26
+ ? 80
27
+ : 65;
24
28
  const screenHeight = Dimensions.get('window').height;
25
29
  const actualScreenHeight = screenHeight - statusBarHeight;
26
30
  const DEFAULT_PADDING_BOTTOM = 40;
@@ -1,43 +1,46 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { Pressable, View, Text, StyleSheet } from 'react-native';
3
- import { Color, Icon } from '@herca/rn-kit';
1
+ import { Color, Icon, Typography } from '@herca/rn-kit';
2
+ import React, { useEffect, useState } from 'react';
3
+ import { Pressable, StyleSheet, View } from 'react-native';
4
+ import type { Variant } from './type';
4
5
  // import type { ColorVariantType } from '../Color/type';
5
6
 
6
7
  interface CheckBoxProps {
7
8
  checked?: boolean;
8
9
  onChange?: (checked: boolean) => void;
9
10
  label?: string | React.ReactNode;
11
+ hint?: string;
10
12
  disabled?: boolean;
11
13
  renderLabel?: () => React.ReactNode;
12
- // color?: ColorVariantType;
14
+ renderHint?: () => React.ReactNode;
15
+ color?: Variant;
13
16
  }
14
17
 
15
- // const COLOR_MAP: Record<
16
- // ColorVariantType,
17
- // {
18
- // backgroundColor: ColorValue;
19
- // backgroundColorDisabled: ColorValue;
20
- // }
21
- // > = {
22
- // primary : {
23
- // backgroundColor : Color.primary[1000],
24
- // backgroundColorDisabled : Color.primary[100],
25
- // },
26
- // danger: {
27
- // backgroundColor : Color.danger[500],
28
- // backgroundColorDisabled : Color.danger[100],
29
- // },
30
- // }
18
+ const COLORS: Record<Variant, { background: string; borderColor: string }> = {
19
+ default: { background: Color.gray[100], borderColor: Color.gray[500] },
20
+ primary: {
21
+ background: Color.primary[1000],
22
+ borderColor: Color.primary[1000],
23
+ },
24
+ success: { background: Color.success[500], borderColor: Color.success[500] },
25
+ info: { background: Color.info[500], borderColor: Color.info[500] },
26
+ danger: { background: Color.danger[500], borderColor: Color.danger[500] },
27
+ warning: { background: Color.warning[500], borderColor: Color.warning[500] },
28
+ orange: { background: Color.orange[500], borderColor: Color.orange[500] },
29
+ purple: { background: Color.purple[500], borderColor: Color.purple[500] },
30
+ };
31
+
31
32
  const CheckBox: React.FC<CheckBoxProps> = ({
32
33
  checked = false,
33
34
  onChange,
34
35
  label,
36
+ hint,
35
37
  disabled = false,
36
38
  renderLabel,
37
- // color= 'primary'
39
+ renderHint,
40
+ color = 'primary',
38
41
  }) => {
39
42
  const [value, setValue] = useState<boolean>(false);
40
- // const _selectedColor = COLOR_MAP[color];
43
+ const { background, borderColor } = COLORS[color];
41
44
 
42
45
  const handlePress = () => {
43
46
  const newValue = !value;
@@ -57,14 +60,31 @@ const CheckBox: React.FC<CheckBoxProps> = ({
57
60
  <View
58
61
  style={[
59
62
  styles.checkBox,
60
- value && styles.checked,
63
+ value && {
64
+ backgroundColor: background,
65
+ borderColor,
66
+ },
61
67
  disabled && styles.disabled,
62
68
  ]}
63
69
  >
64
70
  {value && <Icon name="Check" size={14} color={Color.base.white100} />}
65
71
  </View>
66
- {label && <Text style={styles.label}>{label}</Text>}
67
- {renderLabel?.()}
72
+ <View>
73
+ {label && (
74
+ <Typography variant="t2" weight="medium" color={Color.gray[900]}>
75
+ {label}
76
+ </Typography>
77
+ )}
78
+ {hint && (
79
+ <Typography variant="t3" weight="medium" color={Color.gray[600]}>
80
+ {hint}
81
+ </Typography>
82
+ )}
83
+ </View>
84
+ <View>
85
+ {renderLabel?.()}
86
+ {renderHint?.()}
87
+ </View>
68
88
  </Pressable>
69
89
  );
70
90
  };
@@ -91,10 +111,6 @@ const styles = StyleSheet.create({
91
111
  disabled: {
92
112
  opacity: 0.5,
93
113
  },
94
- label: {
95
- fontSize: 14,
96
- color: '#333',
97
- },
98
114
  });
99
115
 
100
116
  export default CheckBox;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
3
  import { Typography, Color, CheckBox } from '@herca/rn-kit';
4
+ import type { Variant } from './type';
4
5
 
5
6
  interface CheckBoxListItem {
6
7
  label: string;
7
8
  value: string;
9
+ hint?: string;
8
10
  }
9
11
 
10
12
  interface CheckBoxListProps {
@@ -12,6 +14,7 @@ interface CheckBoxListProps {
12
14
  selectedValues: string[];
13
15
  onChange: (selected: string[]) => void;
14
16
  direction?: 'vertical' | 'horizontal';
17
+ color?: Variant;
15
18
  }
16
19
 
17
20
  const CheckBoxList: React.FC<CheckBoxListProps> = ({
@@ -19,6 +22,7 @@ const CheckBoxList: React.FC<CheckBoxListProps> = ({
19
22
  selectedValues,
20
23
  onChange,
21
24
  direction = 'vertical',
25
+ color = 'primary',
22
26
  }) => {
23
27
  const toggleValue = (value: string) => {
24
28
  const newSelected = selectedValues.includes(value)
@@ -39,12 +43,20 @@ const CheckBoxList: React.FC<CheckBoxListProps> = ({
39
43
  <CheckBox
40
44
  key={item.value}
41
45
  checked={selectedValues.includes(item.value)}
46
+ color={color}
42
47
  onChange={() => toggleValue(item.value)}
43
48
  renderLabel={() => (
44
49
  <Typography variant="t2" weight="medium" color={Color.gray[800]}>
45
50
  {item.label}
46
51
  </Typography>
47
52
  )}
53
+ renderHint={() =>
54
+ item.hint ? (
55
+ <Typography variant="t3" weight="medium" color={Color.gray[700]}>
56
+ {item.hint}
57
+ </Typography>
58
+ ) : undefined
59
+ }
48
60
  />
49
61
  ))}
50
62
  </View>
@@ -37,10 +37,13 @@ export default function App() {
37
37
 
38
38
  ##⚙️ Props
39
39
 
40
- | Prop | Tipe | Deskripsi | |
41
- | ------------- | ---------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------- |
42
- | `checked` | `boolean` | Status awal checkbox (centang atau tidak). Default: `false`. | |
43
- | `onChange` | `(checked: boolean) => void` | Fungsi callback saat status checkbox berubah. | |
44
- | `label` | \`string \\ | React.ReactNode\` | Label teks atau komponen yang ditampilkan di samping checkbox. |
45
- | `disabled` | `boolean` | Jika `true`, checkbox tidak bisa ditekan. Default: `false`. | |
46
- | `renderLabel` | `() => React.ReactNode` | Alternatif render untuk label kustom selain `label`. | |
40
+ | Prop | Tipe | Deskripsi |
41
+ | ------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
42
+ | `checked` | `boolean` | Status awal checkbox (centang atau tidak). Default: `false`. |
43
+ | `onChange` | `(checked: boolean) => void` | Fungsi callback saat status checkbox berubah. |
44
+ | `label` | `string ` | Label teks atau komponen yang ditampilkan di samping checkbox. |
45
+ | `hint` | `string ` | Label teks atau komponen yang ditampilkan di samping checkbox dibawah label. |
46
+ | `color` | `primary \| danger \| warning \| orange \| info \| success \| purple ` | warna background jika checkbox di centang |
47
+ | `disabled` | `boolean` | Jika `true`, checkbox tidak bisa ditekan. Default: `false`. |
48
+ | `renderLabel` | `() => React.ReactNode` | Alternatif render untuk label kustom selain `label`. |
49
+ | `renderHint` | `() => React.ReactNode` | Alternatif render untuk hint kustom selain `hint`. |
@@ -14,6 +14,12 @@ import CheckBoxList from './CheckBoxList';
14
14
  export default function App() {
15
15
  const [selected, setSelected] = useState<string[]>([]);
16
16
 
17
+ interface CheckBoxListItem {
18
+ label: string;
19
+ value: string;
20
+ hint?: string;
21
+ }
22
+
17
23
  return (
18
24
  <View>
19
25
  <CheckBoxList
@@ -33,10 +39,10 @@ export default function App() {
33
39
 
34
40
  ## ⚙️ Props
35
41
 
36
- | Prop | Tipe | Deskripsi | |
37
- | ---------------- | ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------- |
38
- | `items` | `CheckBoxListItem[]` | Daftar item yang akan ditampilkan. Setiap item memiliki `label` dan `value`. | |
39
- | `selectedValues` | `string[]` | Nilai-nilai yang saat ini sedang dipilih. | |
40
- | `onChange` | `(selected: string[]) => void` | Callback saat nilai pilihan berubah. | |
41
- | `direction` | \`'vertical' | 'horizontal'\` (opsional) | Arah tampilan checkbox (default: `'vertical'`). |
42
-
42
+ | Prop | Tipe | Deskripsi | |
43
+ | ---------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------- |
44
+ | `items` | `CheckBoxListItem[]` | Daftar item yang akan ditampilkan. Setiap item memiliki `label` dan `value`. | |
45
+ | `selectedValues` | `string[]` | Nilai-nilai yang saat ini sedang dipilih. | |
46
+ | `onChange` | `(selected: string[]) => void` | Callback saat nilai pilihan berubah. | |
47
+ | `direction` | \`'vertical' | 'horizontal'\` (opsional) | Arah tampilan checkbox (default: `'vertical'`). |
48
+ | `color` | `primary \| danger \| warning \| orange \| info \| success \| purple ` | warna background jika checkbox di centang | Arah tampilan checkbox (default: `'vertical'`). |
@@ -0,0 +1,9 @@
1
+ export type Variant =
2
+ | 'default'
3
+ | 'primary'
4
+ | 'info'
5
+ | 'success'
6
+ | 'warning'
7
+ | 'danger'
8
+ | 'orange'
9
+ | 'purple';
package/src/Icon/Icon.tsx CHANGED
@@ -60,6 +60,12 @@ import Bold from './icons/Bold';
60
60
  import Italic from './icons/Italic';
61
61
  import UnderLine from './icons/UnderLine';
62
62
  import SettingsSlider from './icons/SettingsSlider';
63
+ import RotateSquareFill from './icons/RotateSquareFill';
64
+ import LocationPinFill from './icons/LocationPinFill';
65
+ import DiscountFill from './icons/DiscountFill';
66
+ import CopyFill from './icons/CopyFill';
67
+ import CopyTextFill from './icons/CopyTextFill';
68
+ import ShieldCheckedFill from './icons/ShieldFillChecked';
63
69
 
64
70
  const icons: Record<
65
71
  IconNameProps,
@@ -124,6 +130,12 @@ const icons: Record<
124
130
  'Italic': Italic,
125
131
  'UnderLine': UnderLine,
126
132
  'settings-slider': SettingsSlider,
133
+ 'rotate-square-fill': RotateSquareFill,
134
+ 'location-pin-fill': LocationPinFill,
135
+ 'discount-fill': DiscountFill,
136
+ 'copy-fill': CopyFill,
137
+ 'copy-text-fill': CopyTextFill,
138
+ 'shield-checked-fill': ShieldCheckedFill,
127
139
  };
128
140
 
129
141
  const Icon: React.FC<IconProps> = ({
@@ -106,3 +106,10 @@ export default function App() {
106
106
  - Bold
107
107
  - UnderLine
108
108
  - Italic
109
+ - settings-slider
110
+ - rotate-square-fill
111
+ - discount-fill
112
+ - location-pin-fill
113
+ - copy-fill
114
+ - copy-text-fill
115
+ - shield-checked-fill
@@ -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 CopyFill: React.FC<Props> = ({ size = 24, color = '#000', style }) => (
11
+ <Svg width={size} height={size} viewBox="0 0 16 16" fill="none" style={style}>
12
+ <Path
13
+ d="M9.03333 13.3364C8.86 13.4098 8.67333 13.4764 8.47333 13.5431L7.42 13.8898C4.77333 14.7431 3.38 14.0298 2.52 11.3831L1.66667 8.74977C0.813332 6.1031 1.52 4.7031 4.16667 3.84977L5.19333 3.50977C5.06667 3.82977 4.96 4.19643 4.86 4.60977L4.20667 7.4031C3.47333 10.5431 4.54667 12.2764 7.68667 13.0231L8.80667 13.2898C8.88 13.3098 8.96 13.3231 9.03333 13.3364Z"
14
+ fill={color}
15
+ />
16
+ <Path
17
+ d="M11.4467 2.03682L10.3333 1.77682C8.10666 1.25015 6.78 1.68348 6 3.29682C5.8 3.70348 5.64 4.19682 5.50667 4.76348L4.85333 7.55682C4.2 10.3435 5.06 11.7168 7.84 12.3768L8.96 12.6435C9.34666 12.7368 9.70667 12.7968 10.04 12.8235C12.12 13.0235 13.2267 12.0501 13.7867 9.64348L14.44 6.85682C15.0933 4.07015 14.24 2.69015 11.4467 2.03682Z"
18
+ fill={color}
19
+ />
20
+ </Svg>
21
+ );
22
+
23
+ export default CopyFill;
@@ -0,0 +1,29 @@
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 CopyTextFill: React.FC<Props> = ({
11
+ size = 24,
12
+ color = '#000',
13
+ style,
14
+ }) => (
15
+ <Svg
16
+ width={size}
17
+ height={size + 1}
18
+ viewBox="0 0 24 25"
19
+ style={style}
20
+ fill="none"
21
+ >
22
+ <Path
23
+ d="M15.2601 21.1611C14.9161 21.3251 14.5141 21.4471 14.0591 21.5291L7.48907 22.6792C5.29907 23.0692 4.00896 22.1692 3.62896 19.9792L2.08917 11.2292C1.69917 9.03916 2.59912 7.74916 4.78912 7.35916L6.58697 7.04312C6.79197 7.00712 6.97114 7.18615 6.93414 7.39115L5.75811 14.0492C5.22811 17.0792 6.65803 19.1191 9.67803 19.6491C9.67803 19.6491 14.8971 20.5661 15.1661 20.6181C15.4981 20.6781 15.5511 21.0321 15.2601 21.1611ZM21.9131 7.87516L20.3689 16.6291C19.997 18.7371 18.7811 19.6381 16.7361 19.3581C16.6581 19.3471 16.5881 19.3472 16.5071 19.3332L9.94195 18.1751C7.75295 17.7891 6.85209 16.5021 7.23809 14.3131L8.58111 6.69712L8.78204 5.55912C9.16804 3.37012 10.4551 2.46914 12.6441 2.85514L19.21 4.01316C21.398 4.39916 22.2991 5.68716 21.9131 7.87516ZM15.554 14.6651C15.626 14.2571 15.3541 13.8681 14.9461 13.7961L10.8421 13.0721C10.4361 12.9991 10.0452 13.2731 9.97418 13.6801C9.90218 14.0881 10.1741 14.4772 10.5821 14.5492L14.6861 15.2732C14.7301 15.2812 14.7739 15.2842 14.8169 15.2842C15.1739 15.2852 15.49 15.0291 15.554 14.6651ZM18.597 11.8041C18.669 11.3961 18.3971 11.0072 17.9891 10.9352L11.4241 9.77713C11.0201 9.70613 10.627 9.97817 10.556 10.3852C10.484 10.7932 10.7561 11.1821 11.1641 11.2541L17.7291 12.4121C17.7731 12.4201 17.8172 12.4231 17.8602 12.4231C18.2172 12.4231 18.533 12.1671 18.597 11.8041ZM19.2972 8.54215C19.3692 8.13415 19.097 7.74513 18.689 7.67313L12.1241 6.51511C11.7201 6.44311 11.3272 6.71614 11.2562 7.12314C11.1842 7.53114 11.4561 7.92016 11.8641 7.99216L18.429 9.15012C18.473 9.15812 18.5171 9.16117 18.5601 9.16117C18.9171 9.16217 19.2332 8.90615 19.2972 8.54215Z"
24
+ fill={color}
25
+ />
26
+ </Svg>
27
+ );
28
+
29
+ export default CopyTextFill;
@@ -0,0 +1,26 @@
1
+ import Svg, { Path } from 'react-native-svg';
2
+
3
+ interface Props {
4
+ size?: number;
5
+ color?: string;
6
+ style?: object;
7
+ }
8
+
9
+ const DiscountFill: React.FC<Props> = ({ size = 24, color, style }: Props) => (
10
+ <Svg
11
+ width={size + 1}
12
+ height={size}
13
+ viewBox="0 0 24 25"
14
+ fill="none"
15
+ style={style}
16
+ >
17
+ <Path
18
+ fill-rule="evenodd"
19
+ clip-rule="evenodd"
20
+ d="M20.5589 11.3975L19.243 10.0815C18.962 9.80047 18.8039 9.41847 18.8039 9.02047V7.16247C18.8039 6.33147 18.1299 5.65749 17.2989 5.65749H15.441C15.043 5.65749 14.662 5.49947 14.38 5.21847L13.0639 3.90249C12.4759 3.31449 11.524 3.31449 10.936 3.90249L9.61996 5.21847C9.33895 5.49947 8.95692 5.65749 8.55892 5.65749H6.70101C5.87001 5.65749 5.196 6.33147 5.196 7.16247V9.02047C5.196 9.41847 5.03792 9.79947 4.75692 10.0815L3.441 11.3975C2.853 11.9855 2.853 12.9375 3.441 13.5255L4.75692 14.8415C5.03792 15.1225 5.196 15.5045 5.196 15.9025V17.7605C5.196 18.5915 5.87001 19.2655 6.70101 19.2655H8.55892C8.95692 19.2655 9.33795 19.4235 9.61996 19.7045L10.936 21.0205C11.524 21.6085 12.4759 21.6085 13.0639 21.0205L14.38 19.7045C14.661 19.4235 15.043 19.2655 15.441 19.2655H17.2989C18.1299 19.2655 18.8039 18.5915 18.8039 17.7605V15.9025C18.8039 15.5045 18.962 15.1235 19.243 14.8415L20.5589 13.5255C21.1469 12.9375 21.1469 11.9855 20.5589 11.3975ZM8.51497 9.96148C8.51497 9.40948 8.95797 8.96148 9.50997 8.96148H9.51998C10.073 8.96148 10.52 9.40948 10.52 9.96148C10.52 10.5135 10.073 10.9615 9.51998 10.9615C8.96798 10.9615 8.51497 10.5135 8.51497 9.96148ZM10.03 15.4915C9.88399 15.6375 9.69196 15.7115 9.49996 15.7115C9.30796 15.7115 9.11593 15.6385 8.96993 15.4915C8.67693 15.1985 8.67693 14.7235 8.96993 14.4305L13.9699 9.43047C14.2629 9.13747 14.738 9.13747 15.031 9.43047C15.324 9.72347 15.324 10.1985 15.031 10.4915L10.03 15.4915ZM14.52 15.9615C13.968 15.9615 13.515 15.5135 13.515 14.9615C13.515 14.4095 13.958 13.9615 14.51 13.9615H14.52C15.073 13.9615 15.52 14.4095 15.52 14.9615C15.52 15.5135 15.072 15.9615 14.52 15.9615Z"
21
+ fill={color}
22
+ />
23
+ </Svg>
24
+ );
25
+
26
+ export default DiscountFill;
@@ -0,0 +1,28 @@
1
+ import Svg, { Path } from 'react-native-svg';
2
+
3
+ interface Props {
4
+ size?: number;
5
+ color?: string;
6
+ style?: object;
7
+ }
8
+
9
+ const LocationPinFill: React.FC<Props> = ({
10
+ size = 24,
11
+ color,
12
+ style,
13
+ }: Props) => (
14
+ <Svg
15
+ width={size}
16
+ height={size + 1}
17
+ viewBox="0 0 24 25"
18
+ fill="none"
19
+ style={style}
20
+ >
21
+ <Path
22
+ d="M12 2.96149C7.313 2.96149 3.5 6.77449 3.5 11.4615C3.5 16.4445 8.129 19.5025 11.192 21.5255L11.722 21.8775C11.806 21.9335 11.903 21.9615 11.999 21.9615C12.095 21.9615 12.192 21.9335 12.276 21.8775L12.806 21.5255C15.869 19.5025 20.498 16.4445 20.498 11.4615C20.5 6.77449 16.687 2.96149 12 2.96149ZM12 13.9615C10.619 13.9615 9.5 12.8425 9.5 11.4615C9.5 10.0805 10.619 8.96149 12 8.96149C13.381 8.96149 14.5 10.0805 14.5 11.4615C14.5 12.8425 13.381 13.9615 12 13.9615Z"
23
+ fill={color}
24
+ />
25
+ </Svg>
26
+ );
27
+
28
+ export default LocationPinFill;
@@ -14,7 +14,7 @@ const RadioButton: React.FC<Props> = ({ size = 24, color = '#000', style }) => (
14
14
  d="M18 3.37V9.84998C18 10.07 17.9799 10.29 17.9299 10.5H13.8799C12.0099 10.5 10.5 12.01 10.5 13.88V17.9301C10.29 17.9801 10.0701 18 9.8501 18H3.37988C1.11988 18 0 16.87 0 14.62V3.37C0 1.12 1.11988 0 3.37988 0H14.6201C16.8801 0 18 1.12 18 3.37ZM12 13.88V17.22C12.09 17.16 12.16 17.09 12.24 17.01L17.01 12.24C17.09 12.16 17.16 12.09 17.22 12H13.8799C12.8399 12 12 12.84 12 13.88Z"
15
15
  fill={Color.base.white100}
16
16
  />
17
- <Circle cx="10" cy="10" r="9.5" fill="#FFFAEB" stroke={color} />
17
+ <Circle cx="10" cy="10" r="9.5" stroke={color} />
18
18
  <Circle cx="10" cy="10" r="4" fill={color} />
19
19
  </Svg>
20
20
  );
@@ -0,0 +1,22 @@
1
+ import Svg, { Path } from 'react-native-svg';
2
+
3
+ interface Props {
4
+ size?: number;
5
+ color?: string;
6
+ style?: object;
7
+ }
8
+
9
+ const RotateSquareFill: React.FC<Props> = ({
10
+ size = 24,
11
+ color,
12
+ style,
13
+ }: Props) => (
14
+ <Svg width={size} height={size} viewBox="0 0 20 20" fill="none" style={style}>
15
+ <Path
16
+ d="M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM14.2251 11.0891C13.7409 13.0232 12.0033 14.375 10 14.375C8.79667 14.375 7.68167 13.8733 6.875 13.0467V13.3333C6.875 13.6783 6.595 13.9583 6.25 13.9583C5.905 13.9583 5.625 13.6783 5.625 13.3333V11.25C5.625 10.905 5.905 10.625 6.25 10.625H6.4858C6.49413 10.625 6.5033 10.6242 6.51164 10.625H8.33333C8.67833 10.625 8.95833 10.905 8.95833 11.25C8.95833 11.595 8.67833 11.875 8.33333 11.875H7.50407C8.08407 12.6467 9.00167 13.125 10 13.125C11.4292 13.125 12.6675 12.1634 13.0125 10.7859C13.0967 10.4509 13.4424 10.25 13.7699 10.3316C14.1058 10.415 14.3092 10.7541 14.2251 11.0891ZM14.375 8.75C14.375 9.095 14.095 9.375 13.75 9.375H13.5067C13.5017 9.375 13.4966 9.375 13.4908 9.375H11.6667C11.3217 9.375 11.0417 9.095 11.0417 8.75C11.0417 8.405 11.3217 8.125 11.6667 8.125H12.4959C11.9159 7.35333 10.9983 6.875 10 6.875C8.57083 6.875 7.33251 7.83657 6.98751 9.21407C6.91667 9.49824 6.66163 9.6875 6.38163 9.6875C6.3308 9.6875 6.28008 9.68169 6.22925 9.66919C5.89425 9.58502 5.6908 9.24593 5.77413 8.91093C6.2583 6.97676 7.99585 5.625 9.99919 5.625C11.2025 5.625 12.3175 6.12666 13.1242 6.95333V6.66667C13.1242 6.32167 13.4042 6.04167 13.7492 6.04167C14.0942 6.04167 14.3742 6.32167 14.3742 6.66667V8.75H14.375Z"
17
+ fill={color}
18
+ />
19
+ </Svg>
20
+ );
21
+
22
+ export default RotateSquareFill;