@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,54 @@
|
|
|
1
|
+
# 📦 Konstanta: Color
|
|
2
|
+
Konstanta Color berisi daftar token warna yang digunakan untuk styling antarmuka aplikasi menggunakan React Native. Warna-warna ini disusun berdasarkan tema dan gradasi, cocok digunakan bersama desain sistem seperti Design Token.
|
|
3
|
+
|
|
4
|
+
## 🎨 Struktur Warna
|
|
5
|
+
✅ Base
|
|
6
|
+
Warna dasar utama:
|
|
7
|
+
|
|
8
|
+
white100: putih solid
|
|
9
|
+
|
|
10
|
+
white60: putih transparan 60%
|
|
11
|
+
|
|
12
|
+
black100: hitam solid
|
|
13
|
+
|
|
14
|
+
black60: hitam transparan 60%
|
|
15
|
+
|
|
16
|
+
### ⚪ Gray (abu-abu)
|
|
17
|
+
Gradasi abu-abu dari terang (gray.50) hingga gelap (gray.950), cocok untuk teks, latar, border, dsb.
|
|
18
|
+
|
|
19
|
+
### 🔵 Primary
|
|
20
|
+
Gradasi warna utama (biru), digunakan untuk tombol, highlight, atau elemen penting lainnya.
|
|
21
|
+
|
|
22
|
+
### 🟠 Warning
|
|
23
|
+
Warna peringatan, digunakan untuk menandai hal-hal seperti alert, notifikasi kuning, dll.
|
|
24
|
+
|
|
25
|
+
### 🔴 Danger
|
|
26
|
+
Warna untuk kondisi berbahaya atau error (merah).
|
|
27
|
+
|
|
28
|
+
### 🟢 Success
|
|
29
|
+
Digunakan untuk kondisi berhasil atau sukses (hijau).
|
|
30
|
+
|
|
31
|
+
### 🔷 Info
|
|
32
|
+
Warna tambahan untuk informasi, notifikasi, atau status sekunder.
|
|
33
|
+
|
|
34
|
+
### 🟧 Orange
|
|
35
|
+
Warna oranye, alternatif dari primary/warning.
|
|
36
|
+
|
|
37
|
+
### 🟣 Purple
|
|
38
|
+
Warna ungu, bisa digunakan untuk status spesial atau branding.
|
|
39
|
+
|
|
40
|
+
🧱 Divider
|
|
41
|
+
divider.25: Warna pembatas antar elemen UI.
|
|
42
|
+
|
|
43
|
+
📴 Disabled
|
|
44
|
+
disabled.25: Warna untuk elemen non-aktif.
|
|
45
|
+
|
|
46
|
+
## Cara menggunakan
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import Color from '@herca/rn-kit';
|
|
50
|
+
|
|
51
|
+
<View style={{ backgroundColor: Color.primary[500] }} />
|
|
52
|
+
<Text style={{ color: Color.gray[900] }}>Teks</Text>
|
|
53
|
+
|
|
54
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
4
|
+
import Calendar from '../Calendar/Calendar';
|
|
5
|
+
import Button from '../Button/Button';
|
|
6
|
+
import { type DateRangeProps } from '../Calendar/CalendarPropsType';
|
|
7
|
+
interface DatePickerProps {
|
|
8
|
+
onChange: (selectedDate: DateRangeProps) => void;
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function DatePicker({
|
|
15
|
+
onChange,
|
|
16
|
+
isOpen,
|
|
17
|
+
onClose,
|
|
18
|
+
...calendarProps
|
|
19
|
+
}: DatePickerProps) {
|
|
20
|
+
const [valueDatepicker, setValueDatepicker] = useState<DateRangeProps>({
|
|
21
|
+
startDate: null,
|
|
22
|
+
endDate: null,
|
|
23
|
+
date: null,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const handleOnChangeCalendar = useCallback((value: DateRangeProps) => {
|
|
27
|
+
setValueDatepicker(value);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
const handleOnPressSubmitButton = useCallback(() => {
|
|
31
|
+
onChange?.(valueDatepicker);
|
|
32
|
+
onClose?.();
|
|
33
|
+
}, [valueDatepicker, onChange, onClose]);
|
|
34
|
+
|
|
35
|
+
const handleOnPressCancelButton = useCallback(() => {
|
|
36
|
+
onClose?.();
|
|
37
|
+
}, [onClose]);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<View>
|
|
41
|
+
<BottomSheet
|
|
42
|
+
isOpen={isOpen}
|
|
43
|
+
onClose={onClose}
|
|
44
|
+
footer={
|
|
45
|
+
<View style={styles.footerContainer}>
|
|
46
|
+
<View style={styles.buttonWrapper}>
|
|
47
|
+
<Button
|
|
48
|
+
variant="tertiary"
|
|
49
|
+
title="Batalkan"
|
|
50
|
+
color="primary"
|
|
51
|
+
onPress={handleOnPressCancelButton}
|
|
52
|
+
/>
|
|
53
|
+
</View>
|
|
54
|
+
<View style={styles.buttonWrapper}>
|
|
55
|
+
<Button
|
|
56
|
+
title="Terapkan"
|
|
57
|
+
color="primary"
|
|
58
|
+
onPress={handleOnPressSubmitButton}
|
|
59
|
+
/>
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
}
|
|
63
|
+
>
|
|
64
|
+
<Calendar onChange={handleOnChangeCalendar} {...calendarProps} />
|
|
65
|
+
</BottomSheet>
|
|
66
|
+
</View>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
footerContainer: {
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
justifyContent: 'space-between',
|
|
74
|
+
},
|
|
75
|
+
buttonWrapper: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react';
|
|
2
|
+
import { View, FlatList, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
4
|
+
import Typography from '../Typography/Typography';
|
|
5
|
+
import Button from '../Button/Button';
|
|
6
|
+
import Color from '../Color/Color';
|
|
7
|
+
import { generateMonthOptions } from './helpers';
|
|
8
|
+
|
|
9
|
+
type PickerMode = 'single' | 'range' | 'multiple';
|
|
10
|
+
|
|
11
|
+
interface MonthPickerProps {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
onChange?: (
|
|
15
|
+
value: number[] | { startDate: number | null; endDate: number | null }
|
|
16
|
+
) => void;
|
|
17
|
+
mode?: PickerMode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function MonthPicker({
|
|
21
|
+
isOpen,
|
|
22
|
+
onClose,
|
|
23
|
+
onChange,
|
|
24
|
+
mode = 'single',
|
|
25
|
+
}: MonthPickerProps) {
|
|
26
|
+
const [rangeValue, setRangeValue] = useState<{
|
|
27
|
+
startDate: number | null;
|
|
28
|
+
endDate: number | null;
|
|
29
|
+
}>({ startDate: null, endDate: null });
|
|
30
|
+
const [multipleValue, setMultipleValue] = useState<number[]>([]);
|
|
31
|
+
const [singleValue, setSingleValue] = useState<number | null>(null);
|
|
32
|
+
|
|
33
|
+
const handleSelectMonth = useCallback(
|
|
34
|
+
(month: number) => {
|
|
35
|
+
if (mode === 'single') {
|
|
36
|
+
setSingleValue(month);
|
|
37
|
+
} else if (mode === 'range') {
|
|
38
|
+
if (
|
|
39
|
+
rangeValue.startDate === null ||
|
|
40
|
+
(rangeValue.startDate !== null && rangeValue.endDate !== null)
|
|
41
|
+
) {
|
|
42
|
+
setRangeValue({ startDate: month, endDate: null });
|
|
43
|
+
} else if (month < rangeValue.startDate) {
|
|
44
|
+
setRangeValue({ startDate: month, endDate: rangeValue.startDate });
|
|
45
|
+
} else {
|
|
46
|
+
setRangeValue({ startDate: rangeValue.startDate, endDate: month });
|
|
47
|
+
}
|
|
48
|
+
} else if (mode === 'multiple') {
|
|
49
|
+
setMultipleValue((prev) =>
|
|
50
|
+
prev.includes(month)
|
|
51
|
+
? prev.filter((m) => m !== month)
|
|
52
|
+
: [...prev, month]
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[mode, rangeValue]
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const isSelected = (month: number) => {
|
|
60
|
+
if (mode === 'single') return month === singleValue;
|
|
61
|
+
if (mode === 'range') {
|
|
62
|
+
const { startDate, endDate } = rangeValue;
|
|
63
|
+
return (
|
|
64
|
+
(startDate === month && endDate === null) ||
|
|
65
|
+
(startDate !== null &&
|
|
66
|
+
endDate !== null &&
|
|
67
|
+
month >= startDate &&
|
|
68
|
+
month <= endDate)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (mode === 'multiple') return multipleValue.includes(month);
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const handleSubmit = () => {
|
|
76
|
+
if (mode === 'single') {
|
|
77
|
+
onChange?.(singleValue !== null ? [singleValue] : []);
|
|
78
|
+
} else if (mode === 'range') {
|
|
79
|
+
onChange?.(rangeValue);
|
|
80
|
+
} else {
|
|
81
|
+
onChange?.(multipleValue);
|
|
82
|
+
}
|
|
83
|
+
onClose?.();
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<BottomSheet
|
|
88
|
+
isOpen={isOpen}
|
|
89
|
+
onClose={onClose}
|
|
90
|
+
footer={
|
|
91
|
+
<View style={styles.containerBottomSheetFooter}>
|
|
92
|
+
<View style={styles.flex1}>
|
|
93
|
+
<Button
|
|
94
|
+
title="Batal"
|
|
95
|
+
variant="tertiary"
|
|
96
|
+
size="medium"
|
|
97
|
+
color="primary"
|
|
98
|
+
onPress={onClose}
|
|
99
|
+
/>
|
|
100
|
+
</View>
|
|
101
|
+
<View style={styles.flex1}>
|
|
102
|
+
<Button
|
|
103
|
+
title="Pilih"
|
|
104
|
+
color="primary"
|
|
105
|
+
size="medium"
|
|
106
|
+
onPress={handleSubmit}
|
|
107
|
+
/>
|
|
108
|
+
</View>
|
|
109
|
+
</View>
|
|
110
|
+
}
|
|
111
|
+
>
|
|
112
|
+
<View style={styles.header}>
|
|
113
|
+
<Typography
|
|
114
|
+
variant="t1"
|
|
115
|
+
weight="semibold"
|
|
116
|
+
color={Color.gray[900]}
|
|
117
|
+
center
|
|
118
|
+
>
|
|
119
|
+
Pilih Bulan
|
|
120
|
+
</Typography>
|
|
121
|
+
</View>
|
|
122
|
+
|
|
123
|
+
<View style={styles.container}>
|
|
124
|
+
<FlatList
|
|
125
|
+
data={generateMonthOptions()}
|
|
126
|
+
numColumns={3}
|
|
127
|
+
keyExtractor={(item) => item.value.toString()}
|
|
128
|
+
contentContainerStyle={styles.yearList}
|
|
129
|
+
renderItem={({ item }) => {
|
|
130
|
+
const selected = isSelected(item.value);
|
|
131
|
+
return (
|
|
132
|
+
<View style={styles.yearItem}>
|
|
133
|
+
<TouchableOpacity
|
|
134
|
+
onPress={() => handleSelectMonth(item.value)}
|
|
135
|
+
style={[
|
|
136
|
+
styles.option,
|
|
137
|
+
selected ? styles.optionSelected : null,
|
|
138
|
+
]}
|
|
139
|
+
>
|
|
140
|
+
<Typography
|
|
141
|
+
variant="p2"
|
|
142
|
+
center
|
|
143
|
+
weight="semibold"
|
|
144
|
+
color={selected ? Color.gray[900] : Color.gray[700]}
|
|
145
|
+
>
|
|
146
|
+
{item.label}
|
|
147
|
+
</Typography>
|
|
148
|
+
</TouchableOpacity>
|
|
149
|
+
</View>
|
|
150
|
+
);
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
154
|
+
</BottomSheet>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const styles = StyleSheet.create({
|
|
159
|
+
container: {
|
|
160
|
+
gap: 10,
|
|
161
|
+
},
|
|
162
|
+
yearList: {
|
|
163
|
+
paddingBottom: 12,
|
|
164
|
+
},
|
|
165
|
+
yearItem: {
|
|
166
|
+
width: '30%',
|
|
167
|
+
margin: '1.66%',
|
|
168
|
+
},
|
|
169
|
+
pagination: {
|
|
170
|
+
marginTop: 8,
|
|
171
|
+
flexDirection: 'row',
|
|
172
|
+
justifyContent: 'space-between',
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
gap: 8,
|
|
175
|
+
},
|
|
176
|
+
header: {
|
|
177
|
+
marginBottom: 10,
|
|
178
|
+
},
|
|
179
|
+
buttonNav: {
|
|
180
|
+
backgroundColor: Color.gray[500],
|
|
181
|
+
borderRadius: 8,
|
|
182
|
+
padding: 8,
|
|
183
|
+
},
|
|
184
|
+
containerBottomSheetFooter: {
|
|
185
|
+
flexDirection: 'row',
|
|
186
|
+
flex: 1,
|
|
187
|
+
gap: 12,
|
|
188
|
+
},
|
|
189
|
+
flex1: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
},
|
|
192
|
+
option: {
|
|
193
|
+
gap: 8,
|
|
194
|
+
paddingVertical: 8,
|
|
195
|
+
paddingHorizontal: 12,
|
|
196
|
+
borderWidth: 1,
|
|
197
|
+
borderRadius: 8,
|
|
198
|
+
borderColor: Color.base.white100,
|
|
199
|
+
},
|
|
200
|
+
optionSelected: {
|
|
201
|
+
backgroundColor: Color.primary[50],
|
|
202
|
+
borderColor: Color.primary[300],
|
|
203
|
+
},
|
|
204
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# 📅 DatePicker Component
|
|
2
|
+
|
|
3
|
+
Komponen `DatePicker` adalah antarmuka pemilih tanggal yang dibungkus dalam sebuah **BottomSheet**, dan menggunakan komponen `Calendar` di dalamnya. Pengguna dapat memilih tanggal (tunggal atau rentang), lalu mengonfirmasi atau membatalkan pemilihan dengan tombol aksi.
|
|
4
|
+
|
|
5
|
+
Komponen ini extend dari Calendar, jadi kalian bisa menggunakan semua props yang ada di Calendar [Calendar](../Calendar/README.md)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✨ Fitur
|
|
10
|
+
|
|
11
|
+
- Pilih tanggal dalam mode **single** atau **range**
|
|
12
|
+
- Tersedia dalam tampilan **BottomSheet**
|
|
13
|
+
- Terdapat tombol **Batalkan** dan **Terapkan**
|
|
14
|
+
- Terintegrasi dengan `Calendar` dan `Button` custom
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ⚙️ Props
|
|
19
|
+
|
|
20
|
+
| Prop | Tipe Data | Keterangan |
|
|
21
|
+
|-------------|----------------------------------|------------|
|
|
22
|
+
| `mode` | `'single'` \| `'range'` | Menentukan mode pemilihan tanggal |
|
|
23
|
+
| `onChange` | `(value: Date \| [Date, Date]) => void` | Callback saat tanggal dipilih dan tombol **Terapkan** ditekan |
|
|
24
|
+
| `onClose` | `() => void` | Callback saat BottomSheet ditutup |
|
|
25
|
+
| `isOpen` | `boolean` | Menentukan apakah BottomSheet sedang terbuka |
|
|
26
|
+
| `hasError` | `boolean` | (Opsional) Menandai jika terjadi kesalahan validasi |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 🧪 Contoh Penggunaan
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
import DatePicker from "./components/DatePicker";
|
|
34
|
+
|
|
35
|
+
function App() {
|
|
36
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
37
|
+
const [selectedDate, setSelectedDate] = useState(null);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<Button title="Pilih Tanggal" onPress={() => setIsOpen(true)} />
|
|
42
|
+
|
|
43
|
+
<DatePicker
|
|
44
|
+
isOpen={isOpen}
|
|
45
|
+
onClose={() => setIsOpen(false)}
|
|
46
|
+
mode="range"
|
|
47
|
+
onChange={(date) => setSelectedDate(date)}
|
|
48
|
+
/>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
ScrollView,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
type NativeScrollEvent,
|
|
8
|
+
type NativeSyntheticEvent,
|
|
9
|
+
Dimensions,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
12
|
+
import Button from '../Button/Button';
|
|
13
|
+
import Typography from '../Typography/Typography';
|
|
14
|
+
import Color from '../Color/Color';
|
|
15
|
+
|
|
16
|
+
const ITEM_HEIGHT = 40;
|
|
17
|
+
const SCREEN_WIDTH = Dimensions.get('window').width;
|
|
18
|
+
const VISIBLE_ITEMS = 5;
|
|
19
|
+
const MIDDLE_INDEX = Math.floor(VISIBLE_ITEMS / 2);
|
|
20
|
+
|
|
21
|
+
interface TimePickerProps {
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
onChange?: (value: { hour: number; minute: number }) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const generateItems = (max: number) => Array.from({ length: max }, (_, i) => i);
|
|
28
|
+
|
|
29
|
+
export default function TimePickerWheel({
|
|
30
|
+
isOpen,
|
|
31
|
+
onClose,
|
|
32
|
+
onChange,
|
|
33
|
+
}: TimePickerProps) {
|
|
34
|
+
const [selectedHour, setSelectedHour] = useState(0);
|
|
35
|
+
const [selectedMinute, setSelectedMinute] = useState(0);
|
|
36
|
+
|
|
37
|
+
const hourRef = useRef<ScrollView>(null);
|
|
38
|
+
const minuteRef = useRef<ScrollView>(null);
|
|
39
|
+
|
|
40
|
+
const padItems = (items: number[], padCount: number) => {
|
|
41
|
+
return [
|
|
42
|
+
...items.slice(-padCount).map((i) => i - items.length),
|
|
43
|
+
...items,
|
|
44
|
+
...items.slice(0, padCount).map((i) => i + items.length),
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const hours = padItems(generateItems(24), MIDDLE_INDEX);
|
|
49
|
+
const minutes = padItems(generateItems(60), MIDDLE_INDEX);
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (isOpen) {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
scrollToIndex(hourRef, selectedHour + MIDDLE_INDEX);
|
|
55
|
+
scrollToIndex(minuteRef, selectedMinute + MIDDLE_INDEX);
|
|
56
|
+
}, 100);
|
|
57
|
+
}
|
|
58
|
+
}, [isOpen, selectedMinute, selectedHour]);
|
|
59
|
+
|
|
60
|
+
const scrollToIndex = (
|
|
61
|
+
ref: React.RefObject<ScrollView | null>,
|
|
62
|
+
index: number
|
|
63
|
+
) => {
|
|
64
|
+
ref.current?.scrollTo({ y: index * ITEM_HEIGHT, animated: true });
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const handleScrollEnd = (
|
|
68
|
+
event: NativeSyntheticEvent<NativeScrollEvent>,
|
|
69
|
+
type: 'hour' | 'minute'
|
|
70
|
+
) => {
|
|
71
|
+
const offsetY = event.nativeEvent.contentOffset.y;
|
|
72
|
+
const index = Math.round(offsetY / ITEM_HEIGHT);
|
|
73
|
+
if (type === 'hour') {
|
|
74
|
+
const realIndex = (((index - MIDDLE_INDEX) % 24) + 24) % 24;
|
|
75
|
+
setSelectedHour(realIndex);
|
|
76
|
+
setTimeout(() => scrollToIndex(hourRef, realIndex + MIDDLE_INDEX), 50);
|
|
77
|
+
} else {
|
|
78
|
+
const realIndex = (((index - MIDDLE_INDEX) % 60) + 60) % 60;
|
|
79
|
+
setSelectedMinute(realIndex);
|
|
80
|
+
setTimeout(() => scrollToIndex(minuteRef, realIndex + MIDDLE_INDEX), 50);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleSubmit = () => {
|
|
85
|
+
onChange?.({ hour: selectedHour, minute: selectedMinute });
|
|
86
|
+
onClose?.();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const renderItem = (value: number, type: 'hour' | 'minute') => {
|
|
90
|
+
const isSelected =
|
|
91
|
+
type === 'hour'
|
|
92
|
+
? ((value % 24) + 24) % 24 === selectedHour
|
|
93
|
+
: (value % 60) + (60 % 60) === selectedMinute;
|
|
94
|
+
const displayValue =
|
|
95
|
+
type === 'hour'
|
|
96
|
+
? (((value % 24) + 24) % 24).toString().padStart(2, '0')
|
|
97
|
+
: (((value % 60) + 60) % 60).toString().padStart(2, '0');
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<View key={`${type}-${value}`} style={styles.item}>
|
|
101
|
+
<Text style={[styles.itemText, isSelected && styles.selectedItemText]}>
|
|
102
|
+
{displayValue}
|
|
103
|
+
</Text>
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<BottomSheet
|
|
110
|
+
isOpen={isOpen}
|
|
111
|
+
onClose={onClose}
|
|
112
|
+
footer={
|
|
113
|
+
<View style={styles.footer}>
|
|
114
|
+
<View style={styles.flex1}>
|
|
115
|
+
<Button
|
|
116
|
+
title="Batal"
|
|
117
|
+
variant="tertiary"
|
|
118
|
+
onPress={onClose}
|
|
119
|
+
color="primary"
|
|
120
|
+
size="medium"
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
<View style={styles.flex1}>
|
|
124
|
+
<Button
|
|
125
|
+
title="Pilih"
|
|
126
|
+
onPress={handleSubmit}
|
|
127
|
+
color="primary"
|
|
128
|
+
size="medium"
|
|
129
|
+
/>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
}
|
|
133
|
+
>
|
|
134
|
+
<Typography
|
|
135
|
+
variant="t1"
|
|
136
|
+
weight="semibold"
|
|
137
|
+
color={Color.gray[900]}
|
|
138
|
+
center
|
|
139
|
+
style={{ marginBottom: 16 }}
|
|
140
|
+
>
|
|
141
|
+
Pilih Waktu
|
|
142
|
+
</Typography>
|
|
143
|
+
|
|
144
|
+
<View style={styles.container}>
|
|
145
|
+
{/* Highlight overlay */}
|
|
146
|
+
<View style={styles.highlightOverlay} pointerEvents="none">
|
|
147
|
+
<View style={styles.highlight} />
|
|
148
|
+
</View>
|
|
149
|
+
<View style={styles.scrollContainer}>
|
|
150
|
+
<View style={styles.pickerColumn}>
|
|
151
|
+
<ScrollView
|
|
152
|
+
ref={hourRef}
|
|
153
|
+
showsVerticalScrollIndicator={false}
|
|
154
|
+
snapToInterval={ITEM_HEIGHT}
|
|
155
|
+
decelerationRate="fast"
|
|
156
|
+
onMomentumScrollEnd={(e) => handleScrollEnd(e, 'hour')}
|
|
157
|
+
contentContainerStyle={styles.scrollContent}
|
|
158
|
+
>
|
|
159
|
+
{hours.map((h) => renderItem(h, 'hour'))}
|
|
160
|
+
</ScrollView>
|
|
161
|
+
</View>
|
|
162
|
+
|
|
163
|
+
<View style={styles.pickerColumn}>
|
|
164
|
+
<ScrollView
|
|
165
|
+
ref={minuteRef}
|
|
166
|
+
showsVerticalScrollIndicator={false}
|
|
167
|
+
snapToInterval={ITEM_HEIGHT}
|
|
168
|
+
decelerationRate="fast"
|
|
169
|
+
onMomentumScrollEnd={(e) => handleScrollEnd(e, 'minute')}
|
|
170
|
+
contentContainerStyle={styles.scrollContent}
|
|
171
|
+
>
|
|
172
|
+
{minutes.map((m) => renderItem(m, 'minute'))}
|
|
173
|
+
</ScrollView>
|
|
174
|
+
</View>
|
|
175
|
+
</View>
|
|
176
|
+
</View>
|
|
177
|
+
</BottomSheet>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const styles = StyleSheet.create({
|
|
182
|
+
container: {
|
|
183
|
+
position: 'relative',
|
|
184
|
+
height: ITEM_HEIGHT * VISIBLE_ITEMS,
|
|
185
|
+
marginBottom: 16,
|
|
186
|
+
},
|
|
187
|
+
footer: {
|
|
188
|
+
flexDirection: 'row',
|
|
189
|
+
gap: 12,
|
|
190
|
+
},
|
|
191
|
+
flex1: {
|
|
192
|
+
flex: 1,
|
|
193
|
+
},
|
|
194
|
+
scrollContainer: {
|
|
195
|
+
flexDirection: 'row',
|
|
196
|
+
justifyContent: 'space-evenly',
|
|
197
|
+
},
|
|
198
|
+
scrollContent: {
|
|
199
|
+
paddingVertical: ITEM_HEIGHT * MIDDLE_INDEX,
|
|
200
|
+
},
|
|
201
|
+
pickerColumn: {
|
|
202
|
+
width: SCREEN_WIDTH / 10.5,
|
|
203
|
+
height: ITEM_HEIGHT * VISIBLE_ITEMS,
|
|
204
|
+
overflow: 'hidden',
|
|
205
|
+
},
|
|
206
|
+
item: {
|
|
207
|
+
height: ITEM_HEIGHT,
|
|
208
|
+
justifyContent: 'center',
|
|
209
|
+
alignItems: 'center',
|
|
210
|
+
},
|
|
211
|
+
itemText: {
|
|
212
|
+
fontSize: 18,
|
|
213
|
+
color: Color.gray[400],
|
|
214
|
+
},
|
|
215
|
+
selectedItemText: {
|
|
216
|
+
color: Color.gray[900],
|
|
217
|
+
fontWeight: 'bold',
|
|
218
|
+
fontSize: 22,
|
|
219
|
+
},
|
|
220
|
+
highlightOverlay: {
|
|
221
|
+
position: 'absolute',
|
|
222
|
+
zIndex: -1,
|
|
223
|
+
top: 0,
|
|
224
|
+
left: 0,
|
|
225
|
+
right: 0,
|
|
226
|
+
bottom: 0,
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
},
|
|
229
|
+
highlight: {
|
|
230
|
+
height: ITEM_HEIGHT,
|
|
231
|
+
zIndex: -1,
|
|
232
|
+
backgroundColor: Color.primary[50],
|
|
233
|
+
},
|
|
234
|
+
});
|