@herca/rn-kit 0.1.0
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/LICENSE +20 -0
- package/README.md +33 -0
- package/RnKit.podspec +21 -0
- package/android/build.gradle +83 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/herca/rnkit/RnKitModule.kt +23 -0
- package/android/src/main/java/com/herca/rnkit/RnKitPackage.kt +33 -0
- package/ios/RnKit.h +5 -0
- package/ios/RnKit.mm +18 -0
- package/lib/module/Accordion/Accordion.js +33 -0
- package/lib/module/Accordion/Accordion.js.map +1 -0
- package/lib/module/Accordion/AccordionItem.js +13 -0
- package/lib/module/Accordion/AccordionItem.js.map +1 -0
- package/lib/module/Accordion/README.md +48 -0
- package/lib/module/Accordion/type.js +4 -0
- package/lib/module/Accordion/type.js.map +1 -0
- package/lib/module/Alert/Alert.js +121 -0
- package/lib/module/Alert/Alert.js.map +1 -0
- package/lib/module/Alert/README.md +68 -0
- package/lib/module/Avatar/Avatar.js +56 -0
- package/lib/module/Avatar/Avatar.js.map +1 -0
- package/lib/module/Avatar/AvatarGroup.js +118 -0
- package/lib/module/Avatar/AvatarGroup.js.map +1 -0
- package/lib/module/Avatar/README_AVATAR.md +57 -0
- package/lib/module/Avatar/README_AVATARGROUP.md +58 -0
- package/lib/module/Avatar/type.js +4 -0
- package/lib/module/Avatar/type.js.map +1 -0
- package/lib/module/Badge/Badge.js +119 -0
- package/lib/module/Badge/Badge.js.map +1 -0
- package/lib/module/Badge/README.md +64 -0
- package/lib/module/Badge/type.js +2 -0
- package/lib/module/Badge/type.js.map +1 -0
- package/lib/module/BottomSheet/BottomSheet.js +211 -0
- package/lib/module/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/module/BottomSheet/README.md +64 -0
- package/lib/module/BottomSheet/type.js +2 -0
- package/lib/module/BottomSheet/type.js.map +1 -0
- package/lib/module/Button/Button.js +138 -0
- package/lib/module/Button/Button.js.map +1 -0
- package/lib/module/Button/README.md +94 -0
- package/lib/module/Button/type.js +262 -0
- package/lib/module/Button/type.js.map +1 -0
- package/lib/module/Calendar/Calendar.js +356 -0
- package/lib/module/Calendar/Calendar.js.map +1 -0
- package/lib/module/Calendar/CalendarPropsType.js +4 -0
- package/lib/module/Calendar/CalendarPropsType.js.map +1 -0
- package/lib/module/Calendar/README.md +73 -0
- package/lib/module/CheckBox/CheckBox.js +67 -0
- package/lib/module/CheckBox/CheckBox.js.map +1 -0
- package/lib/module/CheckBox/CheckBoxList.js +41 -0
- package/lib/module/CheckBox/CheckBoxList.js.map +1 -0
- package/lib/module/CheckBox/README_CHECKBOX.md +46 -0
- package/lib/module/CheckBox/README_CHECKBOXLIST.md +41 -0
- package/lib/module/Chip/Chip.js +109 -0
- package/lib/module/Chip/Chip.js.map +1 -0
- package/lib/module/Chip/ChipItem.js +89 -0
- package/lib/module/Chip/ChipItem.js.map +1 -0
- package/lib/module/Chip/README.md +89 -0
- package/lib/module/Chip/type.js +94 -0
- package/lib/module/Chip/type.js.map +1 -0
- package/lib/module/Color/Color.js +126 -0
- package/lib/module/Color/Color.js.map +1 -0
- package/lib/module/Color/README.md +54 -0
- package/lib/module/Color/type.js +2 -0
- package/lib/module/Color/type.js.map +1 -0
- package/lib/module/DatePicker/DatePicker.js +69 -0
- package/lib/module/DatePicker/DatePicker.js.map +1 -0
- package/lib/module/DatePicker/MonthPicker.js +179 -0
- package/lib/module/DatePicker/MonthPicker.js.map +1 -0
- package/lib/module/DatePicker/README.md +51 -0
- package/lib/module/DatePicker/TimePicker.js +200 -0
- package/lib/module/DatePicker/TimePicker.js.map +1 -0
- package/lib/module/DatePicker/YearPicker.js +217 -0
- package/lib/module/DatePicker/YearPicker.js.map +1 -0
- package/lib/module/DatePicker/helpers.js +33 -0
- package/lib/module/DatePicker/helpers.js.map +1 -0
- package/lib/module/Drawing/Drawing.js +26 -0
- package/lib/module/Drawing/Drawing.js.map +1 -0
- package/lib/module/DropDown/DropDown.js +107 -0
- package/lib/module/DropDown/DropDown.js.map +1 -0
- package/lib/module/DropDown/type.js +4 -0
- package/lib/module/DropDown/type.js.map +1 -0
- package/lib/module/FileView/Image.js +8 -0
- package/lib/module/FileView/Image.js.map +1 -0
- package/lib/module/FileView/PdfView.js +37 -0
- package/lib/module/FileView/PdfView.js.map +1 -0
- package/lib/module/Icon/Icon.js +74 -0
- package/lib/module/Icon/Icon.js.map +1 -0
- package/lib/module/Icon/icons/AirPlane.js +22 -0
- package/lib/module/Icon/icons/AirPlane.js.map +1 -0
- package/lib/module/Icon/icons/ArrowBackAlt.js +22 -0
- package/lib/module/Icon/icons/ArrowBackAlt.js.map +1 -0
- package/lib/module/Icon/icons/ArrowDown.js +22 -0
- package/lib/module/Icon/icons/ArrowDown.js.map +1 -0
- package/lib/module/Icon/icons/ArrowForwardAlt.js +22 -0
- package/lib/module/Icon/icons/ArrowForwardAlt.js.map +1 -0
- package/lib/module/Icon/icons/ArrowLeft.js +22 -0
- package/lib/module/Icon/icons/ArrowLeft.js.map +1 -0
- package/lib/module/Icon/icons/ArrowRight.js +22 -0
- package/lib/module/Icon/icons/ArrowRight.js.map +1 -0
- package/lib/module/Icon/icons/ArrowUp.js +22 -0
- package/lib/module/Icon/icons/ArrowUp.js.map +1 -0
- package/lib/module/Icon/icons/Calendar.js +22 -0
- package/lib/module/Icon/icons/Calendar.js.map +1 -0
- package/lib/module/Icon/icons/Camera.js +22 -0
- package/lib/module/Icon/icons/Camera.js.map +1 -0
- package/lib/module/Icon/icons/Check.js +22 -0
- package/lib/module/Icon/icons/Check.js.map +1 -0
- package/lib/module/Icon/icons/Document.js +22 -0
- package/lib/module/Icon/icons/Document.js.map +1 -0
- package/lib/module/Icon/icons/Download.js +22 -0
- package/lib/module/Icon/icons/Download.js.map +1 -0
- package/lib/module/Icon/icons/ExlmationMark.js +22 -0
- package/lib/module/Icon/icons/ExlmationMark.js.map +1 -0
- package/lib/module/Icon/icons/Eye.js +22 -0
- package/lib/module/Icon/icons/Eye.js.map +1 -0
- package/lib/module/Icon/icons/EyeOpen.js +22 -0
- package/lib/module/Icon/icons/EyeOpen.js.map +1 -0
- package/lib/module/Icon/icons/Filter.js +22 -0
- package/lib/module/Icon/icons/Filter.js.map +1 -0
- package/lib/module/Icon/icons/Home.js +8 -0
- package/lib/module/Icon/icons/Home.js.map +1 -0
- package/lib/module/Icon/icons/Image.js +22 -0
- package/lib/module/Icon/icons/Image.js.map +1 -0
- package/lib/module/Icon/icons/Pdf.js +22 -0
- package/lib/module/Icon/icons/Pdf.js.map +1 -0
- package/lib/module/Icon/icons/RadioButton.js +34 -0
- package/lib/module/Icon/icons/RadioButton.js.map +1 -0
- package/lib/module/Icon/icons/Search.js +22 -0
- package/lib/module/Icon/icons/Search.js.map +1 -0
- package/lib/module/Icon/icons/StickyNote.js +22 -0
- package/lib/module/Icon/icons/StickyNote.js.map +1 -0
- package/lib/module/Icon/icons/Times.js +22 -0
- package/lib/module/Icon/icons/Times.js.map +1 -0
- package/lib/module/Icon/icons/User.js +22 -0
- package/lib/module/Icon/icons/User.js.map +1 -0
- package/lib/module/Icon/icons/XCircle.js +22 -0
- package/lib/module/Icon/icons/XCircle.js.map +1 -0
- package/lib/module/Icon/index.js +6 -0
- package/lib/module/Icon/index.js.map +1 -0
- package/lib/module/Icon/type.js +4 -0
- package/lib/module/Icon/type.js.map +1 -0
- package/lib/module/Input/Input.js +125 -0
- package/lib/module/Input/Input.js.map +1 -0
- package/lib/module/Input/Input.md +51 -0
- package/lib/module/Input/InputFile.js +319 -0
- package/lib/module/Input/InputFile.js.map +1 -0
- package/lib/module/Input/InputMonth.js +4 -0
- package/lib/module/Input/InputMonth.js.map +1 -0
- package/lib/module/Input/InputNumber.js +2 -0
- package/lib/module/Input/InputNumber.js.map +1 -0
- package/lib/module/Input/InputOtp.js +74 -0
- package/lib/module/Input/InputOtp.js.map +1 -0
- package/lib/module/Input/InputPassword.js +18 -0
- package/lib/module/Input/InputPassword.js.map +1 -0
- package/lib/module/Input/InputSelect.js +8 -0
- package/lib/module/Input/InputSelect.js.map +1 -0
- package/lib/module/Input/Switch.js +91 -0
- package/lib/module/Input/Switch.js.map +1 -0
- package/lib/module/Input/TextArea.js +61 -0
- package/lib/module/Input/TextArea.js.map +1 -0
- package/lib/module/Input/assets/Ilustrasi.svg +14 -0
- package/lib/module/Input/assets/input-file.png +0 -0
- package/lib/module/Input/type.js +4 -0
- package/lib/module/Input/type.js.map +1 -0
- package/lib/module/Label/Label.js +87 -0
- package/lib/module/Label/Label.js.map +1 -0
- package/lib/module/LabelForm/LabelForm.js +17 -0
- package/lib/module/LabelForm/LabelForm.js.map +1 -0
- package/lib/module/List/List.js +31 -0
- package/lib/module/List/List.js.map +1 -0
- package/lib/module/List/ListItem.js +31 -0
- package/lib/module/List/ListItem.js.map +1 -0
- package/lib/module/List/type.js +4 -0
- package/lib/module/List/type.js.map +1 -0
- package/lib/module/Loading/Loading.js +50 -0
- package/lib/module/Loading/Loading.js.map +1 -0
- package/lib/module/Modal/Modal.js +149 -0
- package/lib/module/Modal/Modal.js.map +1 -0
- package/lib/module/NativeRnKit.js +5 -0
- package/lib/module/NativeRnKit.js.map +1 -0
- package/lib/module/Provider/FooterProvider.js +25 -0
- package/lib/module/Provider/FooterProvider.js.map +1 -0
- package/lib/module/Provider/LayoutWithFooter.js +34 -0
- package/lib/module/Provider/LayoutWithFooter.js.map +1 -0
- package/lib/module/Provider/Provider.js +43 -0
- package/lib/module/Provider/Provider.js.map +1 -0
- package/lib/module/Provider/RequiredUpdateAppsProvider.js +60 -0
- package/lib/module/Provider/RequiredUpdateAppsProvider.js.map +1 -0
- package/lib/module/Provider/type.js +2 -0
- package/lib/module/Provider/type.js.map +1 -0
- package/lib/module/RadioButton/README.md +43 -0
- package/lib/module/RadioButton/RadioButton.js +97 -0
- package/lib/module/RadioButton/RadioButton.js.map +1 -0
- package/lib/module/Select/README.md +78 -0
- package/lib/module/Select/README_Select.md +78 -0
- package/lib/module/Select/Select.js +101 -0
- package/lib/module/Select/Select.js.map +1 -0
- package/lib/module/Select/type.js +4 -0
- package/lib/module/Select/type.js.map +1 -0
- package/lib/module/Step/Step.js +83 -0
- package/lib/module/Step/Step.js.map +1 -0
- package/lib/module/Step/StepItem.js +78 -0
- package/lib/module/Step/StepItem.js.map +1 -0
- package/lib/module/Step/type.js +4 -0
- package/lib/module/Step/type.js.map +1 -0
- package/lib/module/SwitchButton/SwitchButton.js +8 -0
- package/lib/module/SwitchButton/SwitchButton.js.map +1 -0
- package/lib/module/TextArea/TextArea.js +2 -0
- package/lib/module/TextArea/TextArea.js.map +1 -0
- package/lib/module/Theme/Theme.js +31 -0
- package/lib/module/Theme/Theme.js.map +1 -0
- package/lib/module/Timeline/Timeline.js +12 -0
- package/lib/module/Timeline/Timeline.js.map +1 -0
- package/lib/module/Timeline/TimelineItem.js +66 -0
- package/lib/module/Timeline/TimelineItem.js.map +1 -0
- package/lib/module/Toast/Toast.js +143 -0
- package/lib/module/Toast/Toast.js.map +1 -0
- package/lib/module/Toast/ToastContext.js +40 -0
- package/lib/module/Toast/ToastContext.js.map +1 -0
- package/lib/module/Typography/README.md +71 -0
- package/lib/module/Typography/Typography.js +39 -0
- package/lib/module/Typography/Typography.js.map +1 -0
- package/lib/module/Typography/type.js +33 -0
- package/lib/module/Typography/type.js.map +1 -0
- package/lib/module/Ui/Card.js +50 -0
- package/lib/module/Ui/Card.js.map +1 -0
- package/lib/module/Ui/Center.js +21 -0
- package/lib/module/Ui/Center.js.map +1 -0
- package/lib/module/Ui/Col.js +20 -0
- package/lib/module/Ui/Col.js.map +1 -0
- package/lib/module/Ui/Container.js +20 -0
- package/lib/module/Ui/Container.js.map +1 -0
- package/lib/module/Ui/Devider.js +18 -0
- package/lib/module/Ui/Devider.js.map +1 -0
- package/lib/module/Ui/Footer.js +36 -0
- package/lib/module/Ui/Footer.js.map +1 -0
- package/lib/module/Ui/Gap.js +13 -0
- package/lib/module/Ui/Gap.js.map +1 -0
- package/lib/module/Ui/Grid.js +31 -0
- package/lib/module/Ui/Grid.js.map +1 -0
- package/lib/module/index.js +61 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/Accordion/Accordion.d.ts +3 -0
- package/lib/typescript/src/Accordion/Accordion.d.ts.map +1 -0
- package/lib/typescript/src/Accordion/AccordionItem.d.ts +3 -0
- package/lib/typescript/src/Accordion/AccordionItem.d.ts.map +1 -0
- package/lib/typescript/src/Accordion/type.d.ts +17 -0
- package/lib/typescript/src/Accordion/type.d.ts.map +1 -0
- package/lib/typescript/src/Alert/Alert.d.ts +16 -0
- package/lib/typescript/src/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/src/Avatar/Avatar.d.ts +5 -0
- package/lib/typescript/src/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/src/Avatar/AvatarGroup.d.ts +4 -0
- package/lib/typescript/src/Avatar/AvatarGroup.d.ts.map +1 -0
- package/lib/typescript/src/Avatar/type.d.ts +16 -0
- package/lib/typescript/src/Avatar/type.d.ts.map +1 -0
- package/lib/typescript/src/Badge/Badge.d.ts +14 -0
- package/lib/typescript/src/Badge/Badge.d.ts.map +1 -0
- package/lib/typescript/src/Badge/type.d.ts +1 -0
- package/lib/typescript/src/Badge/type.d.ts.map +1 -0
- package/lib/typescript/src/BottomSheet/BottomSheet.d.ts +3 -0
- package/lib/typescript/src/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/BottomSheet/type.d.ts +15 -0
- package/lib/typescript/src/BottomSheet/type.d.ts.map +1 -0
- package/lib/typescript/src/Button/Button.d.ts +5 -0
- package/lib/typescript/src/Button/Button.d.ts.map +1 -0
- package/lib/typescript/src/Button/type.d.ts +49 -0
- package/lib/typescript/src/Button/type.d.ts.map +1 -0
- package/lib/typescript/src/Calendar/Calendar.d.ts +4 -0
- package/lib/typescript/src/Calendar/Calendar.d.ts.map +1 -0
- package/lib/typescript/src/Calendar/CalendarPropsType.d.ts +52 -0
- package/lib/typescript/src/Calendar/CalendarPropsType.d.ts.map +1 -0
- package/lib/typescript/src/CheckBox/CheckBox.d.ts +11 -0
- package/lib/typescript/src/CheckBox/CheckBox.d.ts.map +1 -0
- package/lib/typescript/src/CheckBox/CheckBoxList.d.ts +14 -0
- package/lib/typescript/src/CheckBox/CheckBoxList.d.ts.map +1 -0
- package/lib/typescript/src/Chip/Chip.d.ts +5 -0
- package/lib/typescript/src/Chip/Chip.d.ts.map +1 -0
- package/lib/typescript/src/Chip/ChipItem.d.ts +3 -0
- package/lib/typescript/src/Chip/ChipItem.d.ts.map +1 -0
- package/lib/typescript/src/Chip/type.d.ts +50 -0
- package/lib/typescript/src/Chip/type.d.ts.map +1 -0
- package/lib/typescript/src/Color/Color.d.ts +122 -0
- package/lib/typescript/src/Color/Color.d.ts.map +1 -0
- package/lib/typescript/src/Color/type.d.ts +2 -0
- package/lib/typescript/src/Color/type.d.ts.map +1 -0
- package/lib/typescript/src/DatePicker/DatePicker.d.ts +10 -0
- package/lib/typescript/src/DatePicker/DatePicker.d.ts.map +1 -0
- package/lib/typescript/src/DatePicker/MonthPicker.d.ts +13 -0
- package/lib/typescript/src/DatePicker/MonthPicker.d.ts.map +1 -0
- package/lib/typescript/src/DatePicker/TimePicker.d.ts +11 -0
- package/lib/typescript/src/DatePicker/TimePicker.d.ts.map +1 -0
- package/lib/typescript/src/DatePicker/YearPicker.d.ts +13 -0
- package/lib/typescript/src/DatePicker/YearPicker.d.ts.map +1 -0
- package/lib/typescript/src/DatePicker/helpers.d.ts +21 -0
- package/lib/typescript/src/DatePicker/helpers.d.ts.map +1 -0
- package/lib/typescript/src/Drawing/Drawing.d.ts +2 -0
- package/lib/typescript/src/Drawing/Drawing.d.ts.map +1 -0
- package/lib/typescript/src/DropDown/DropDown.d.ts +4 -0
- package/lib/typescript/src/DropDown/DropDown.d.ts.map +1 -0
- package/lib/typescript/src/DropDown/type.d.ts +9 -0
- package/lib/typescript/src/DropDown/type.d.ts.map +1 -0
- package/lib/typescript/src/FileView/Image.d.ts +2 -0
- package/lib/typescript/src/FileView/Image.d.ts.map +1 -0
- package/lib/typescript/src/FileView/PdfView.d.ts +5 -0
- package/lib/typescript/src/FileView/PdfView.d.ts.map +1 -0
- package/lib/typescript/src/Icon/Icon.d.ts +5 -0
- package/lib/typescript/src/Icon/Icon.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/AirPlane.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/AirPlane.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowBackAlt.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowBackAlt.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowDown.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowDown.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowForwardAlt.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowForwardAlt.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowLeft.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowLeft.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowRight.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowRight.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ArrowUp.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ArrowUp.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Calendar.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Calendar.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Camera.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Camera.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Check.d.ts +6 -0
- package/lib/typescript/src/Icon/icons/Check.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Document.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Document.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Download.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Download.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/ExlmationMark.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ExlmationMark.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Eye.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Eye.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/EyeOpen.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/EyeOpen.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Filter.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Filter.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Home.d.ts +2 -0
- package/lib/typescript/src/Icon/icons/Home.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Image.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Image.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Pdf.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Pdf.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/RadioButton.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/RadioButton.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Search.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Search.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/StickyNote.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/StickyNote.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/Times.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/Times.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/User.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/User.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/XCircle.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/XCircle.d.ts.map +1 -0
- package/lib/typescript/src/Icon/index.d.ts +5 -0
- package/lib/typescript/src/Icon/index.d.ts.map +1 -0
- package/lib/typescript/src/Icon/type.d.ts +9 -0
- package/lib/typescript/src/Icon/type.d.ts.map +1 -0
- package/lib/typescript/src/Input/Input.d.ts +5 -0
- package/lib/typescript/src/Input/Input.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputFile.d.ts +11 -0
- package/lib/typescript/src/Input/InputFile.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputMonth.d.ts +2 -0
- package/lib/typescript/src/Input/InputMonth.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputNumber.d.ts +1 -0
- package/lib/typescript/src/Input/InputNumber.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputOtp.d.ts +11 -0
- package/lib/typescript/src/Input/InputOtp.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputPassword.d.ts +15 -0
- package/lib/typescript/src/Input/InputPassword.d.ts.map +1 -0
- package/lib/typescript/src/Input/InputSelect.d.ts +2 -0
- package/lib/typescript/src/Input/InputSelect.d.ts.map +1 -0
- package/lib/typescript/src/Input/Switch.d.ts +12 -0
- package/lib/typescript/src/Input/Switch.d.ts.map +1 -0
- package/lib/typescript/src/Input/TextArea.d.ts +3 -0
- package/lib/typescript/src/Input/TextArea.d.ts.map +1 -0
- package/lib/typescript/src/Input/type.d.ts +18 -0
- package/lib/typescript/src/Input/type.d.ts.map +1 -0
- package/lib/typescript/src/Label/Label.d.ts +12 -0
- package/lib/typescript/src/Label/Label.d.ts.map +1 -0
- package/lib/typescript/src/LabelForm/LabelForm.d.ts +4 -0
- package/lib/typescript/src/LabelForm/LabelForm.d.ts.map +1 -0
- package/lib/typescript/src/List/List.d.ts +3 -0
- package/lib/typescript/src/List/List.d.ts.map +1 -0
- package/lib/typescript/src/List/ListItem.d.ts +3 -0
- package/lib/typescript/src/List/ListItem.d.ts.map +1 -0
- package/lib/typescript/src/List/type.d.ts +14 -0
- package/lib/typescript/src/List/type.d.ts.map +1 -0
- package/lib/typescript/src/Loading/Loading.d.ts +10 -0
- package/lib/typescript/src/Loading/Loading.d.ts.map +1 -0
- package/lib/typescript/src/Modal/Modal.d.ts +18 -0
- package/lib/typescript/src/Modal/Modal.d.ts.map +1 -0
- package/lib/typescript/src/NativeRnKit.d.ts +7 -0
- package/lib/typescript/src/NativeRnKit.d.ts.map +1 -0
- package/lib/typescript/src/Provider/FooterProvider.d.ts +11 -0
- package/lib/typescript/src/Provider/FooterProvider.d.ts.map +1 -0
- package/lib/typescript/src/Provider/LayoutWithFooter.d.ts +5 -0
- package/lib/typescript/src/Provider/LayoutWithFooter.d.ts.map +1 -0
- package/lib/typescript/src/Provider/Provider.d.ts +15 -0
- package/lib/typescript/src/Provider/Provider.d.ts.map +1 -0
- package/lib/typescript/src/Provider/RequiredUpdateAppsProvider.d.ts +3 -0
- package/lib/typescript/src/Provider/RequiredUpdateAppsProvider.d.ts.map +1 -0
- package/lib/typescript/src/Provider/type.d.ts +7 -0
- package/lib/typescript/src/Provider/type.d.ts.map +1 -0
- package/lib/typescript/src/RadioButton/RadioButton.d.ts +15 -0
- package/lib/typescript/src/RadioButton/RadioButton.d.ts.map +1 -0
- package/lib/typescript/src/Select/Select.d.ts +3 -0
- package/lib/typescript/src/Select/Select.d.ts.map +1 -0
- package/lib/typescript/src/Select/type.d.ts +24 -0
- package/lib/typescript/src/Select/type.d.ts.map +1 -0
- package/lib/typescript/src/Step/Step.d.ts +4 -0
- package/lib/typescript/src/Step/Step.d.ts.map +1 -0
- package/lib/typescript/src/Step/StepItem.d.ts +4 -0
- package/lib/typescript/src/Step/StepItem.d.ts.map +1 -0
- package/lib/typescript/src/Step/type.d.ts +18 -0
- package/lib/typescript/src/Step/type.d.ts.map +1 -0
- package/lib/typescript/src/SwitchButton/SwitchButton.d.ts +2 -0
- package/lib/typescript/src/SwitchButton/SwitchButton.d.ts.map +1 -0
- package/lib/typescript/src/TextArea/TextArea.d.ts +1 -0
- package/lib/typescript/src/TextArea/TextArea.d.ts.map +1 -0
- package/lib/typescript/src/Theme/Theme.d.ts +29 -0
- package/lib/typescript/src/Theme/Theme.d.ts.map +1 -0
- package/lib/typescript/src/Timeline/Timeline.d.ts +6 -0
- package/lib/typescript/src/Timeline/Timeline.d.ts.map +1 -0
- package/lib/typescript/src/Timeline/TimelineItem.d.ts +15 -0
- package/lib/typescript/src/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/typescript/src/Toast/Toast.d.ts +14 -0
- package/lib/typescript/src/Toast/Toast.d.ts.map +1 -0
- package/lib/typescript/src/Toast/ToastContext.d.ts +17 -0
- package/lib/typescript/src/Toast/ToastContext.d.ts.map +1 -0
- package/lib/typescript/src/Typography/Typography.d.ts +5 -0
- package/lib/typescript/src/Typography/Typography.d.ts.map +1 -0
- package/lib/typescript/src/Typography/type.d.ts +19 -0
- package/lib/typescript/src/Typography/type.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Card.d.ts +11 -0
- package/lib/typescript/src/Ui/Card.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Center.d.ts +9 -0
- package/lib/typescript/src/Ui/Center.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Col.d.ts +10 -0
- package/lib/typescript/src/Ui/Col.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Container.d.ts +2 -0
- package/lib/typescript/src/Ui/Container.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Devider.d.ts +3 -0
- package/lib/typescript/src/Ui/Devider.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Footer.d.ts +9 -0
- package/lib/typescript/src/Ui/Footer.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Gap.d.ts +6 -0
- package/lib/typescript/src/Ui/Gap.d.ts.map +1 -0
- package/lib/typescript/src/Ui/Grid.d.ts +9 -0
- package/lib/typescript/src/Ui/Grid.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +59 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +172 -0
- package/src/Accordion/Accordion.tsx +38 -0
- package/src/Accordion/AccordionItem.tsx +9 -0
- package/src/Accordion/README.md +48 -0
- package/src/Accordion/type.tsx +19 -0
- package/src/Alert/Alert.tsx +141 -0
- package/src/Alert/README.md +68 -0
- package/src/Avatar/Avatar.tsx +68 -0
- package/src/Avatar/AvatarGroup.tsx +135 -0
- package/src/Avatar/README_AVATAR.md +57 -0
- package/src/Avatar/README_AVATARGROUP.md +58 -0
- package/src/Avatar/type.tsx +17 -0
- package/src/Badge/Badge.tsx +135 -0
- package/src/Badge/README.md +64 -0
- package/src/Badge/type.tsx +0 -0
- package/src/BottomSheet/BottomSheet.tsx +259 -0
- package/src/BottomSheet/README.md +64 -0
- package/src/BottomSheet/type.tsx +15 -0
- package/src/Button/Button.tsx +195 -0
- package/src/Button/README.md +94 -0
- package/src/Button/type.tsx +329 -0
- package/src/Calendar/Calendar.tsx +382 -0
- package/src/Calendar/CalendarPropsType.tsx +60 -0
- package/src/Calendar/README.md +73 -0
- package/src/CheckBox/CheckBox.tsx +80 -0
- package/src/CheckBox/CheckBoxList.tsx +64 -0
- package/src/CheckBox/README_CHECKBOX.md +46 -0
- package/src/CheckBox/README_CHECKBOXLIST.md +41 -0
- package/src/Chip/Chip.tsx +134 -0
- package/src/Chip/ChipItem.tsx +124 -0
- package/src/Chip/README.md +89 -0
- package/src/Chip/type.tsx +152 -0
- package/src/Color/Color.tsx +133 -0
- package/src/Color/README.md +54 -0
- package/src/Color/type.tsx +9 -0
- package/src/DatePicker/DatePicker.tsx +78 -0
- package/src/DatePicker/MonthPicker.tsx +204 -0
- package/src/DatePicker/README.md +51 -0
- package/src/DatePicker/TimePicker.tsx +234 -0
- package/src/DatePicker/YearPicker.tsx +238 -0
- package/src/DatePicker/helpers.tsx +53 -0
- package/src/Drawing/Drawing.tsx +23 -0
- package/src/DropDown/DropDown.tsx +136 -0
- package/src/DropDown/type.tsx +9 -0
- package/src/FileView/Image.tsx +5 -0
- package/src/FileView/PdfView.tsx +33 -0
- package/src/Icon/Icon.tsx +76 -0
- package/src/Icon/icons/AirPlane.tsx +19 -0
- package/src/Icon/icons/ArrowBackAlt.tsx +23 -0
- package/src/Icon/icons/ArrowDown.tsx +19 -0
- package/src/Icon/icons/ArrowForwardAlt.tsx +23 -0
- package/src/Icon/icons/ArrowLeft.tsx +19 -0
- package/src/Icon/icons/ArrowRight.tsx +19 -0
- package/src/Icon/icons/ArrowUp.tsx +19 -0
- package/src/Icon/icons/Calendar.tsx +19 -0
- package/src/Icon/icons/Camera.tsx +19 -0
- package/src/Icon/icons/Check.tsx +15 -0
- package/src/Icon/icons/Document.tsx +19 -0
- package/src/Icon/icons/Download.tsx +19 -0
- package/src/Icon/icons/ExlmationMark.tsx +23 -0
- package/src/Icon/icons/Eye.tsx +19 -0
- package/src/Icon/icons/EyeOpen.tsx +19 -0
- package/src/Icon/icons/Filter.tsx +19 -0
- package/src/Icon/icons/Home.tsx +5 -0
- package/src/Icon/icons/Image.tsx +19 -0
- package/src/Icon/icons/Pdf.tsx +19 -0
- package/src/Icon/icons/RadioButton.tsx +22 -0
- package/src/Icon/icons/Search.tsx +19 -0
- package/src/Icon/icons/StickyNote.tsx +19 -0
- package/src/Icon/icons/Times.tsx +19 -0
- package/src/Icon/icons/User.tsx +19 -0
- package/src/Icon/icons/XCircle.tsx +19 -0
- package/src/Icon/index.tsx +5 -0
- package/src/Icon/type.tsx +37 -0
- package/src/Input/Input.md +51 -0
- package/src/Input/Input.tsx +134 -0
- package/src/Input/InputFile.tsx +320 -0
- package/src/Input/InputMonth.tsx +1 -0
- package/src/Input/InputNumber.tsx +0 -0
- package/src/Input/InputOtp.tsx +96 -0
- package/src/Input/InputPassword.tsx +31 -0
- package/src/Input/InputSelect.tsx +5 -0
- package/src/Input/Switch.tsx +111 -0
- package/src/Input/TextArea.tsx +67 -0
- package/src/Input/assets/Ilustrasi.svg +14 -0
- package/src/Input/assets/input-file.png +0 -0
- package/src/Input/type.tsx +19 -0
- package/src/Label/Label.tsx +119 -0
- package/src/LabelForm/LabelForm.tsx +12 -0
- package/src/List/List.tsx +31 -0
- package/src/List/ListItem.tsx +34 -0
- package/src/List/type.tsx +14 -0
- package/src/Loading/Loading.tsx +56 -0
- package/src/Modal/Modal.tsx +179 -0
- package/src/NativeRnKit.ts +8 -0
- package/src/Provider/FooterProvider.tsx +26 -0
- package/src/Provider/LayoutWithFooter.tsx +27 -0
- package/src/Provider/Provider.tsx +53 -0
- package/src/Provider/RequiredUpdateAppsProvider.tsx +58 -0
- package/src/Provider/type.tsx +6 -0
- package/src/RadioButton/README.md +43 -0
- package/src/RadioButton/RadioButton.tsx +119 -0
- package/src/Select/README.md +78 -0
- package/src/Select/README_Select.md +78 -0
- package/src/Select/Select.tsx +115 -0
- package/src/Select/type.tsx +30 -0
- package/src/Step/Step.tsx +92 -0
- package/src/Step/StepItem.tsx +86 -0
- package/src/Step/type.tsx +18 -0
- package/src/SwitchButton/SwitchButton.tsx +5 -0
- package/src/TextArea/TextArea.tsx +0 -0
- package/src/Theme/Theme.tsx +28 -0
- package/src/Timeline/Timeline.tsx +9 -0
- package/src/Timeline/TimelineItem.tsx +63 -0
- package/src/Toast/Toast.tsx +179 -0
- package/src/Toast/ToastContext.tsx +51 -0
- package/src/Typography/README.md +71 -0
- package/src/Typography/Typography.tsx +44 -0
- package/src/Typography/type.tsx +60 -0
- package/src/Ui/Card.tsx +70 -0
- package/src/Ui/Center.tsx +20 -0
- package/src/Ui/Col.tsx +17 -0
- package/src/Ui/Container.tsx +12 -0
- package/src/Ui/Devider.tsx +15 -0
- package/src/Ui/Footer.tsx +37 -0
- package/src/Ui/Gap.tsx +8 -0
- package/src/Ui/Grid.tsx +36 -0
- package/src/index.tsx +68 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, StyleSheet, Pressable } from 'react-native';
|
|
3
|
+
import { Typography, Color } from '@herca/rn-kit';
|
|
4
|
+
|
|
5
|
+
interface RadioButtonItem {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface RadioButtonProps {
|
|
12
|
+
items: RadioButtonItem[];
|
|
13
|
+
selectedValue: string | null;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
direction?: 'vertical' | 'horizontal';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const RadioButton: React.FC<RadioButtonProps> = ({
|
|
19
|
+
items,
|
|
20
|
+
selectedValue,
|
|
21
|
+
onChange,
|
|
22
|
+
direction = 'vertical',
|
|
23
|
+
}) => {
|
|
24
|
+
const [internalValue, setInternalValue] = useState<string | null>(
|
|
25
|
+
selectedValue
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
// If no value is selected, set the first non-disabled item as selected
|
|
30
|
+
if (selectedValue === null) {
|
|
31
|
+
const firstValidItem = items.find((item) => !item.disabled);
|
|
32
|
+
if (firstValidItem) {
|
|
33
|
+
setInternalValue(firstValidItem.value);
|
|
34
|
+
onChange?.(firstValidItem.value);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
setInternalValue(selectedValue);
|
|
38
|
+
}
|
|
39
|
+
}, [selectedValue, items, onChange]);
|
|
40
|
+
|
|
41
|
+
const handleOnPress = (item: RadioButtonItem) => {
|
|
42
|
+
if (!item.disabled) {
|
|
43
|
+
setInternalValue(item.value);
|
|
44
|
+
onChange?.(item.value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<View
|
|
50
|
+
style={[
|
|
51
|
+
styles.container,
|
|
52
|
+
direction === 'horizontal' && styles.horizontal,
|
|
53
|
+
]}
|
|
54
|
+
>
|
|
55
|
+
{items.map((item) => {
|
|
56
|
+
const isChecked = internalValue === item.value;
|
|
57
|
+
return (
|
|
58
|
+
<View key={item.value} style={styles.item}>
|
|
59
|
+
<Pressable
|
|
60
|
+
onPress={() => handleOnPress(item)}
|
|
61
|
+
style={[styles.radioContainer, item.disabled && styles.disabled]}
|
|
62
|
+
>
|
|
63
|
+
<View
|
|
64
|
+
style={[styles.outerCircle, isChecked && styles.checkedOuter]}
|
|
65
|
+
>
|
|
66
|
+
{isChecked && <View style={styles.innerCircle} />}
|
|
67
|
+
</View>
|
|
68
|
+
<Typography variant="t2" weight="medium" color={Color.gray[800]}>
|
|
69
|
+
{item.label}
|
|
70
|
+
</Typography>
|
|
71
|
+
</Pressable>
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
container: {
|
|
81
|
+
gap: 8,
|
|
82
|
+
},
|
|
83
|
+
horizontal: {
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
flexWrap: 'wrap',
|
|
86
|
+
},
|
|
87
|
+
item: {
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
marginRight: 16,
|
|
91
|
+
},
|
|
92
|
+
radioContainer: {
|
|
93
|
+
gap: 8,
|
|
94
|
+
flexDirection: 'row',
|
|
95
|
+
},
|
|
96
|
+
outerCircle: {
|
|
97
|
+
width: 20,
|
|
98
|
+
height: 20,
|
|
99
|
+
borderRadius: 10,
|
|
100
|
+
borderWidth: 2,
|
|
101
|
+
borderColor: Color.gray[500] || '#ccc',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
},
|
|
105
|
+
checkedOuter: {
|
|
106
|
+
borderColor: Color.primary[1000] || '#007bff',
|
|
107
|
+
},
|
|
108
|
+
innerCircle: {
|
|
109
|
+
width: 10,
|
|
110
|
+
height: 10,
|
|
111
|
+
borderRadius: 5,
|
|
112
|
+
backgroundColor: Color.primary[1000] || '#007bff',
|
|
113
|
+
},
|
|
114
|
+
disabled: {
|
|
115
|
+
opacity: 0.5,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export default RadioButton;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 📦 Select Component
|
|
2
|
+
|
|
3
|
+
Komponen `Select` adalah komponen pemilihan data berbasis bottom sheet dengan dukungan pencarian, multiple select, custom item renderer, dan pull-to-refresh.
|
|
4
|
+
|
|
5
|
+
## 🚀 Fitur
|
|
6
|
+
|
|
7
|
+
- ✅ Bottom Sheet
|
|
8
|
+
- 🔍 Pencarian dengan debounce
|
|
9
|
+
- 🔁 Pull-to-refresh support
|
|
10
|
+
- 🔘 Multiple/Single select
|
|
11
|
+
- 🎨 Custom render item
|
|
12
|
+
- ⚠️ Validasi jika required
|
|
13
|
+
- 🔄 Loading state
|
|
14
|
+
|
|
15
|
+
## 📦 Props
|
|
16
|
+
|
|
17
|
+
| Prop | Tipe | Default | Keterangan |
|
|
18
|
+
|--------------|--------------------------------------------------|---------------|------------|
|
|
19
|
+
| `isOpen` | `boolean` | `false` | Menentukan apakah bottom sheet terbuka |
|
|
20
|
+
| `data` | `ChipOptionProps[]` | - | Data pilihan untuk ditampilkan |
|
|
21
|
+
| `multiple` | `boolean` | `false` | Mengizinkan multiple selection |
|
|
22
|
+
| `renderItem` | `(item, selected, disabled) => React.ReactNode` | - | Kustom tampilan item |
|
|
23
|
+
| `onSubmit` | `(selected: ChipSelectedProps) => void` | - | Callback saat tombol submit ditekan |
|
|
24
|
+
| `onClose` | `(val: boolean) => void` | - | Callback saat bottom sheet ditutup |
|
|
25
|
+
| `onSearch` | `(val: string) => void` | - | Callback saat input pencarian berubah |
|
|
26
|
+
| `required` | `boolean` | `false` | Jika `true`, validasi input saat submit |
|
|
27
|
+
| `loading` | `boolean` | `false` | Menampilkan loading saat data di-fetch |
|
|
28
|
+
| `delaySearch`| `number` | `300` | Delay pencarian dalam milidetik |
|
|
29
|
+
| `height` | `BottomSheetHeighProps` | - | Ukuran tinggi BottomSheet |
|
|
30
|
+
| `onRefresh` | `() => void` | - | Callback saat pull-to-refresh dilakukan |
|
|
31
|
+
|
|
32
|
+
## 📌 Contoh Penggunaan
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import Select from './components/Select/Select';
|
|
36
|
+
|
|
37
|
+
const MyScreen = () => {
|
|
38
|
+
const [open, setOpen] = useState(false);
|
|
39
|
+
|
|
40
|
+
const data = [
|
|
41
|
+
{ label: 'Option 1', value: '1' },
|
|
42
|
+
{ label: 'Option 2', value: '2' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const handleSubmit = (selected) => {
|
|
46
|
+
console.log('Selected:', selected);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Button title="Pilih Data" onPress={() => setOpen(true)} />
|
|
52
|
+
<Select
|
|
53
|
+
isOpen={open}
|
|
54
|
+
data={data}
|
|
55
|
+
multiple={true}
|
|
56
|
+
onClose={() => setOpen(false)}
|
|
57
|
+
onSubmit={handleSubmit}
|
|
58
|
+
onSearch={(val) => console.log('Search:', val)}
|
|
59
|
+
onRefresh={() => console.log('Refresh triggered')}
|
|
60
|
+
required={true}
|
|
61
|
+
loading={false}
|
|
62
|
+
/>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 🔧 Catatan
|
|
69
|
+
|
|
70
|
+
- Komponen ini membutuhkan komponen-komponen pendukung:
|
|
71
|
+
- `BottomSheet`
|
|
72
|
+
- `Input`
|
|
73
|
+
- `Button`
|
|
74
|
+
- `Chip`
|
|
75
|
+
- `Loading`
|
|
76
|
+
- `Toast` (untuk validasi/error)
|
|
77
|
+
|
|
78
|
+
- Jika ingin menambahkan animasi shimmer saat loading, bisa modifikasi komponen `Loading`.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 📦 Select Component
|
|
2
|
+
|
|
3
|
+
Komponen `Select` adalah komponen pemilihan data berbasis bottom sheet dengan dukungan pencarian, multiple select, custom item renderer, dan pull-to-refresh.
|
|
4
|
+
|
|
5
|
+
## 🚀 Fitur
|
|
6
|
+
|
|
7
|
+
- ✅ Bottom Sheet
|
|
8
|
+
- 🔍 Pencarian dengan debounce
|
|
9
|
+
- 🔁 Pull-to-refresh support
|
|
10
|
+
- 🔘 Multiple/Single select
|
|
11
|
+
- 🎨 Custom render item
|
|
12
|
+
- ⚠️ Validasi jika required
|
|
13
|
+
- 🔄 Loading state
|
|
14
|
+
|
|
15
|
+
## 📦 Props
|
|
16
|
+
|
|
17
|
+
| Prop | Tipe | Default | Keterangan |
|
|
18
|
+
|--------------|--------------------------------------------------|---------------|------------|
|
|
19
|
+
| `isOpen` | `boolean` | `false` | Menentukan apakah bottom sheet terbuka |
|
|
20
|
+
| `data` | `ChipOptionProps[]` | - | Data pilihan untuk ditampilkan |
|
|
21
|
+
| `multiple` | `boolean` | `false` | Mengizinkan multiple selection |
|
|
22
|
+
| `renderItem` | `(item, selected, disabled) => React.ReactNode` | - | Kustom tampilan item |
|
|
23
|
+
| `onSubmit` | `(selected: ChipSelectedProps) => void` | - | Callback saat tombol submit ditekan |
|
|
24
|
+
| `onClose` | `(val: boolean) => void` | - | Callback saat bottom sheet ditutup |
|
|
25
|
+
| `onSearch` | `(val: string) => void` | - | Callback saat input pencarian berubah |
|
|
26
|
+
| `required` | `boolean` | `false` | Jika `true`, validasi input saat submit |
|
|
27
|
+
| `loading` | `boolean` | `false` | Menampilkan loading saat data di-fetch |
|
|
28
|
+
| `delaySearch`| `number` | `300` | Delay pencarian dalam milidetik |
|
|
29
|
+
| `height` | `BottomSheetHeighProps` | - | Ukuran tinggi BottomSheet |
|
|
30
|
+
| `onRefresh` | `() => void` | - | Callback saat pull-to-refresh dilakukan |
|
|
31
|
+
|
|
32
|
+
## 📌 Contoh Penggunaan
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import Select from './components/Select/Select';
|
|
36
|
+
|
|
37
|
+
const MyScreen = () => {
|
|
38
|
+
const [open, setOpen] = useState(false);
|
|
39
|
+
|
|
40
|
+
const data = [
|
|
41
|
+
{ label: 'Option 1', value: '1' },
|
|
42
|
+
{ label: 'Option 2', value: '2' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const handleSubmit = (selected) => {
|
|
46
|
+
console.log('Selected:', selected);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Button title="Pilih Data" onPress={() => setOpen(true)} />
|
|
52
|
+
<Select
|
|
53
|
+
isOpen={open}
|
|
54
|
+
data={data}
|
|
55
|
+
multiple={true}
|
|
56
|
+
onClose={() => setOpen(false)}
|
|
57
|
+
onSubmit={handleSubmit}
|
|
58
|
+
onSearch={(val) => console.log('Search:', val)}
|
|
59
|
+
onRefresh={() => console.log('Refresh triggered')}
|
|
60
|
+
required={true}
|
|
61
|
+
loading={false}
|
|
62
|
+
/>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 🔧 Catatan
|
|
69
|
+
|
|
70
|
+
- Komponen ini membutuhkan komponen-komponen pendukung:
|
|
71
|
+
- `BottomSheet`
|
|
72
|
+
- `Input`
|
|
73
|
+
- `Button`
|
|
74
|
+
- `Chip`
|
|
75
|
+
- `Loading`
|
|
76
|
+
- `Toast` (untuk validasi/error)
|
|
77
|
+
|
|
78
|
+
- Jika ingin menambahkan animasi shimmer saat loading, bisa modifikasi komponen `Loading`.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
StyleSheet,
|
|
4
|
+
TouchableWithoutFeedback,
|
|
5
|
+
Keyboard,
|
|
6
|
+
} from 'react-native';
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { type SelectProps } from './type';
|
|
9
|
+
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
10
|
+
import Button from '../Button/Button';
|
|
11
|
+
import Input from '../Input/Input';
|
|
12
|
+
import Chip from '../Chip/Chip';
|
|
13
|
+
import { type ChipSelectedProps } from '../Chip/type';
|
|
14
|
+
import { useToast } from '../Toast/ToastContext';
|
|
15
|
+
import Loading from '../Loading/Loading';
|
|
16
|
+
export default function Select({
|
|
17
|
+
isOpen,
|
|
18
|
+
data,
|
|
19
|
+
renderItem,
|
|
20
|
+
onClose,
|
|
21
|
+
onSubmit,
|
|
22
|
+
multiple,
|
|
23
|
+
onSearch,
|
|
24
|
+
required = false,
|
|
25
|
+
loading = false,
|
|
26
|
+
delaySearch = 300,
|
|
27
|
+
height,
|
|
28
|
+
onRefresh,
|
|
29
|
+
refreshing,
|
|
30
|
+
}: SelectProps) {
|
|
31
|
+
const [isOpenSelect, setIsOpenSelect] = useState<boolean | undefined>(false);
|
|
32
|
+
const [selected, setSelected] = useState<ChipSelectedProps>();
|
|
33
|
+
const { show } = useToast();
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setIsOpenSelect(isOpen);
|
|
36
|
+
}, [isOpen]);
|
|
37
|
+
|
|
38
|
+
const handleOnCloseBottom = (val: boolean) => {
|
|
39
|
+
onClose?.(val);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleOnPresSubmitSelect = (): boolean => {
|
|
43
|
+
if (required && (!selected || selected.length === 0)) {
|
|
44
|
+
show('Please fill a item');
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
setIsOpenSelect(false);
|
|
48
|
+
onSubmit?.(selected ? selected : []);
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleOnSearch = (val: string) => {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
onSearch?.(val);
|
|
55
|
+
}, delaySearch);
|
|
56
|
+
};
|
|
57
|
+
return (
|
|
58
|
+
<BottomSheet
|
|
59
|
+
onClose={handleOnCloseBottom}
|
|
60
|
+
isOpen={isOpenSelect}
|
|
61
|
+
height={height}
|
|
62
|
+
footer={
|
|
63
|
+
<Button
|
|
64
|
+
title="lanjutkan"
|
|
65
|
+
color="primary"
|
|
66
|
+
onPress={handleOnPresSubmitSelect}
|
|
67
|
+
/>
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
<View style={styles.container}>
|
|
71
|
+
<View style={styles.containerSearch}>
|
|
72
|
+
<TouchableWithoutFeedback
|
|
73
|
+
onPress={Keyboard.dismiss}
|
|
74
|
+
accessible={false}
|
|
75
|
+
>
|
|
76
|
+
<Input
|
|
77
|
+
submitBehavior="submit"
|
|
78
|
+
icon="Search"
|
|
79
|
+
placeholder="Search"
|
|
80
|
+
onChangeText={(val) => handleOnSearch(val)}
|
|
81
|
+
/>
|
|
82
|
+
</TouchableWithoutFeedback>
|
|
83
|
+
</View>
|
|
84
|
+
{loading ? (
|
|
85
|
+
<Loading />
|
|
86
|
+
) : (
|
|
87
|
+
<Chip
|
|
88
|
+
options={data}
|
|
89
|
+
direction="vertical"
|
|
90
|
+
scrollable={true}
|
|
91
|
+
selected={selected}
|
|
92
|
+
multiple={multiple}
|
|
93
|
+
onSelect={setSelected}
|
|
94
|
+
color="primary"
|
|
95
|
+
size="large"
|
|
96
|
+
renderItem={renderItem}
|
|
97
|
+
onRefresh={onRefresh}
|
|
98
|
+
block
|
|
99
|
+
refreshing={refreshing}
|
|
100
|
+
/>
|
|
101
|
+
)}
|
|
102
|
+
</View>
|
|
103
|
+
</BottomSheet>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
marginBottom: 190,
|
|
110
|
+
},
|
|
111
|
+
containerSearch: {
|
|
112
|
+
gap: 14,
|
|
113
|
+
padding: 12,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChipOnSelectProps, ChipOptionProps } from '../Chip/type';
|
|
3
|
+
import type { BottomSheetHeighProps } from '../BottomSheet/type';
|
|
4
|
+
|
|
5
|
+
export interface SelectDataProps {
|
|
6
|
+
value: string | number;
|
|
7
|
+
label: string | number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type SelectRenderItemProps = (
|
|
11
|
+
item: ChipOptionProps,
|
|
12
|
+
selected: boolean,
|
|
13
|
+
disabled: boolean
|
|
14
|
+
) => React.ReactNode;
|
|
15
|
+
|
|
16
|
+
export interface SelectProps {
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
data: ChipOptionProps[];
|
|
20
|
+
renderItem?: SelectRenderItemProps;
|
|
21
|
+
onSubmit?: ChipOnSelectProps;
|
|
22
|
+
onClose?: (val: boolean) => void;
|
|
23
|
+
onSearch?: (val: string) => void;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
delaySearch?: number;
|
|
27
|
+
height?: BottomSheetHeighProps;
|
|
28
|
+
onRefresh?: () => void;
|
|
29
|
+
refreshing?: boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { View, StyleSheet, Dimensions, ScrollView } from 'react-native';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import type { StepItemProps, StepProps } from './type';
|
|
5
|
+
|
|
6
|
+
const { width: screenWidth } = Dimensions.get('window');
|
|
7
|
+
|
|
8
|
+
const Step = ({ children, current = 0, onChangeStep }: StepProps) => {
|
|
9
|
+
const childrenArray = React.Children.toArray(children).filter(
|
|
10
|
+
React.isValidElement
|
|
11
|
+
) as React.ReactElement<StepItemProps>[];
|
|
12
|
+
const totalSteps = childrenArray.length;
|
|
13
|
+
|
|
14
|
+
const scrollRef = useRef<ScrollView>(null);
|
|
15
|
+
const stepWidth = 100;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
onChangeStep?.(current);
|
|
18
|
+
|
|
19
|
+
if (scrollRef.current) {
|
|
20
|
+
scrollRef.current.scrollTo({
|
|
21
|
+
x: Math.max(0, current * stepWidth) - screenWidth / 2 + stepWidth / 2,
|
|
22
|
+
animated: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, [current, onChangeStep]);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View style={styles.container}>
|
|
29
|
+
{/* Header */}
|
|
30
|
+
<View style={[styles.headerContainer]}>
|
|
31
|
+
<ScrollView
|
|
32
|
+
ref={scrollRef}
|
|
33
|
+
horizontal
|
|
34
|
+
showsHorizontalScrollIndicator={false}
|
|
35
|
+
contentContainerStyle={[
|
|
36
|
+
styles.containerScrollView,
|
|
37
|
+
{
|
|
38
|
+
justifyContent:
|
|
39
|
+
totalSteps * stepWidth < screenWidth ? 'center' : 'flex-start',
|
|
40
|
+
},
|
|
41
|
+
]}
|
|
42
|
+
>
|
|
43
|
+
{childrenArray.map((child, index) =>
|
|
44
|
+
React.cloneElement(child, {
|
|
45
|
+
index,
|
|
46
|
+
isActive: index === current,
|
|
47
|
+
isCompleted: index < current,
|
|
48
|
+
isLast: index === totalSteps - 1,
|
|
49
|
+
isHeader: true,
|
|
50
|
+
style: { width: stepWidth },
|
|
51
|
+
})
|
|
52
|
+
)}
|
|
53
|
+
</ScrollView>
|
|
54
|
+
</View>
|
|
55
|
+
|
|
56
|
+
{/* Content */}
|
|
57
|
+
<View style={styles.content}>
|
|
58
|
+
{childrenArray[current] &&
|
|
59
|
+
React.cloneElement(childrenArray[current], {
|
|
60
|
+
index: current,
|
|
61
|
+
isActive: true,
|
|
62
|
+
isCompleted: false,
|
|
63
|
+
isLast: current === totalSteps - 1,
|
|
64
|
+
isHeader: false,
|
|
65
|
+
})}
|
|
66
|
+
</View>
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
container: {
|
|
73
|
+
flex: 1,
|
|
74
|
+
},
|
|
75
|
+
headerContainer: {
|
|
76
|
+
paddingHorizontal: 24,
|
|
77
|
+
width: screenWidth,
|
|
78
|
+
backgroundColor: Color.info[50],
|
|
79
|
+
paddingVertical: 16,
|
|
80
|
+
},
|
|
81
|
+
contentContainer: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
},
|
|
84
|
+
content: {
|
|
85
|
+
flex: 1,
|
|
86
|
+
},
|
|
87
|
+
containerScrollView: {
|
|
88
|
+
flexGrow: 1,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export default Step;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
FlatList,
|
|
7
|
+
type FlatListProps,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import Color from '../Color/Color';
|
|
10
|
+
import type { StepItemProps } from './type';
|
|
11
|
+
|
|
12
|
+
const StepItem = ({
|
|
13
|
+
index = 0,
|
|
14
|
+
isActive,
|
|
15
|
+
isCompleted,
|
|
16
|
+
isLast,
|
|
17
|
+
isHeader,
|
|
18
|
+
children,
|
|
19
|
+
style,
|
|
20
|
+
}: StepItemProps) => {
|
|
21
|
+
if (isHeader) {
|
|
22
|
+
return (
|
|
23
|
+
<View style={[styles.headerItem, style]}>
|
|
24
|
+
<View
|
|
25
|
+
style={[
|
|
26
|
+
styles.circle,
|
|
27
|
+
isCompleted && styles.completed,
|
|
28
|
+
isActive && styles.active,
|
|
29
|
+
]}
|
|
30
|
+
>
|
|
31
|
+
<Text style={styles.circleText}>{index + 1}</Text>
|
|
32
|
+
</View>
|
|
33
|
+
{!isLast && <View style={styles.line} />}
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (React.isValidElement(children) && children.type === FlatList) {
|
|
39
|
+
const flatListElement = children as React.ReactElement<FlatListProps<any>>;
|
|
40
|
+
return React.cloneElement(flatListElement, {
|
|
41
|
+
style: [styles.content, flatListElement.props.style],
|
|
42
|
+
contentContainerStyle: [
|
|
43
|
+
styles.listContent,
|
|
44
|
+
flatListElement.props.contentContainerStyle,
|
|
45
|
+
],
|
|
46
|
+
nestedScrollEnabled: true,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return <View style={styles.content}>{children}</View>;
|
|
51
|
+
};
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
headerItem: {
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
},
|
|
57
|
+
circle: {
|
|
58
|
+
width: 30,
|
|
59
|
+
height: 30,
|
|
60
|
+
borderRadius: 15,
|
|
61
|
+
backgroundColor: '#ccc',
|
|
62
|
+
justifyContent: 'center',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
},
|
|
65
|
+
circleText: {
|
|
66
|
+
color: '#fff',
|
|
67
|
+
fontWeight: 'bold',
|
|
68
|
+
},
|
|
69
|
+
active: {
|
|
70
|
+
backgroundColor: Color.info[500],
|
|
71
|
+
},
|
|
72
|
+
completed: {
|
|
73
|
+
backgroundColor: Color.info[500],
|
|
74
|
+
},
|
|
75
|
+
line: {
|
|
76
|
+
width: 40,
|
|
77
|
+
height: 2,
|
|
78
|
+
backgroundColor: Color.info[500],
|
|
79
|
+
marginHorizontal: 8,
|
|
80
|
+
},
|
|
81
|
+
content: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
},
|
|
84
|
+
listContent: {},
|
|
85
|
+
});
|
|
86
|
+
export default StepItem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React, { type ReactElement } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface StepItemProps {
|
|
5
|
+
index?: number;
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
isCompleted?: boolean;
|
|
8
|
+
isLast?: boolean;
|
|
9
|
+
isHeader?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface StepProps {
|
|
15
|
+
children: ReactElement<StepItemProps> | ReactElement<StepItemProps>[];
|
|
16
|
+
current: number;
|
|
17
|
+
onChangeStep: (e: any) => void;
|
|
18
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const Theme = {
|
|
2
|
+
spacing: {
|
|
3
|
+
xs: 4,
|
|
4
|
+
sm: 8,
|
|
5
|
+
md: 12,
|
|
6
|
+
lg: 16,
|
|
7
|
+
xl: 24,
|
|
8
|
+
xxl: 32,
|
|
9
|
+
},
|
|
10
|
+
radius: {
|
|
11
|
+
sm: 4,
|
|
12
|
+
md: 8,
|
|
13
|
+
lg: 12,
|
|
14
|
+
full: 999,
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
icon: 24,
|
|
18
|
+
inputHeight: 40,
|
|
19
|
+
buttonHeight: 48,
|
|
20
|
+
},
|
|
21
|
+
zIndex: {
|
|
22
|
+
base: 1,
|
|
23
|
+
dropdown: 10,
|
|
24
|
+
modal: 100,
|
|
25
|
+
toast: 999,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export default Theme;
|