@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 { StyleSheet, View } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import type { ColorVariantType } from '../Color/type';
|
|
5
|
+
import Typography from '../Typography/Typography';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import type { IconNameProps } from '../Icon';
|
|
8
|
+
|
|
9
|
+
interface LabelProps {
|
|
10
|
+
label?: string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
color?: string;
|
|
13
|
+
icon?: IconNameProps;
|
|
14
|
+
size?: 'medium' | 'small';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type LabelColor = ColorVariantType;
|
|
18
|
+
|
|
19
|
+
const validColors: LabelColor[] = [
|
|
20
|
+
'default',
|
|
21
|
+
'success',
|
|
22
|
+
'danger',
|
|
23
|
+
'primary',
|
|
24
|
+
'warning',
|
|
25
|
+
'info',
|
|
26
|
+
'purple',
|
|
27
|
+
'orange',
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const LABEL_COLOR_MAP: Record<
|
|
31
|
+
LabelColor,
|
|
32
|
+
{
|
|
33
|
+
backgroundColor: string;
|
|
34
|
+
textColor: string;
|
|
35
|
+
}
|
|
36
|
+
> = {
|
|
37
|
+
default: {
|
|
38
|
+
backgroundColor: Color.gray[50],
|
|
39
|
+
textColor: Color.gray[900],
|
|
40
|
+
},
|
|
41
|
+
success: {
|
|
42
|
+
backgroundColor: Color.success[50],
|
|
43
|
+
textColor: Color.success[300],
|
|
44
|
+
},
|
|
45
|
+
danger: {
|
|
46
|
+
backgroundColor: Color.danger[50],
|
|
47
|
+
textColor: Color.danger[300],
|
|
48
|
+
},
|
|
49
|
+
primary: {
|
|
50
|
+
backgroundColor: Color.primary[50],
|
|
51
|
+
textColor: Color.primary[300],
|
|
52
|
+
},
|
|
53
|
+
warning: {
|
|
54
|
+
backgroundColor: Color.warning[50],
|
|
55
|
+
textColor: Color.warning[300],
|
|
56
|
+
},
|
|
57
|
+
info: {
|
|
58
|
+
backgroundColor: Color.info[50],
|
|
59
|
+
textColor: Color.info[300],
|
|
60
|
+
},
|
|
61
|
+
orange: {
|
|
62
|
+
backgroundColor: Color.orange[50],
|
|
63
|
+
textColor: Color.orange[300],
|
|
64
|
+
},
|
|
65
|
+
purple: {
|
|
66
|
+
backgroundColor: Color.purple[50],
|
|
67
|
+
textColor: Color.purple[300],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default function Label({
|
|
72
|
+
label,
|
|
73
|
+
icon,
|
|
74
|
+
children,
|
|
75
|
+
color = 'default',
|
|
76
|
+
}: LabelProps) {
|
|
77
|
+
const safeColor = validColors.includes(color as LabelColor)
|
|
78
|
+
? (color as LabelColor)
|
|
79
|
+
: 'default';
|
|
80
|
+
const colors = LABEL_COLOR_MAP[safeColor];
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<View
|
|
84
|
+
style={[styles.container, { backgroundColor: colors.backgroundColor }]}
|
|
85
|
+
>
|
|
86
|
+
{children ? (
|
|
87
|
+
children
|
|
88
|
+
) : (
|
|
89
|
+
<View style={styles.content}>
|
|
90
|
+
{icon && (
|
|
91
|
+
<Icon name={icon} color={colors.textColor} style={styles.icon} />
|
|
92
|
+
)}
|
|
93
|
+
<Typography
|
|
94
|
+
variant="t2"
|
|
95
|
+
color={colors.textColor}
|
|
96
|
+
style={{ color: colors.textColor }}
|
|
97
|
+
>
|
|
98
|
+
{label}
|
|
99
|
+
</Typography>
|
|
100
|
+
</View>
|
|
101
|
+
)}
|
|
102
|
+
</View>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const styles = StyleSheet.create({
|
|
107
|
+
container: {
|
|
108
|
+
paddingVertical: 4,
|
|
109
|
+
borderRadius: 4,
|
|
110
|
+
alignSelf: 'flex-start',
|
|
111
|
+
},
|
|
112
|
+
content: {
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
},
|
|
116
|
+
icon: {
|
|
117
|
+
marginLeft: 4,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import Typography from '../Typography/Typography';
|
|
3
|
+
|
|
4
|
+
export default function LabelForm({ title }: { title: string }) {
|
|
5
|
+
return (
|
|
6
|
+
<View>
|
|
7
|
+
<Typography variant="t2" weight="semibold">
|
|
8
|
+
{title}
|
|
9
|
+
</Typography>
|
|
10
|
+
</View>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import Theme from '../Theme/Theme';
|
|
5
|
+
import type { ListItemProps, ListProps } from './type';
|
|
6
|
+
|
|
7
|
+
export default function List({ children, style }: ListProps) {
|
|
8
|
+
const validChildren = React.Children.toArray(children).filter((child) =>
|
|
9
|
+
React.isValidElement(child)
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<View style={[styles.container, style]}>
|
|
14
|
+
{React.Children.map(validChildren, (child, index) => {
|
|
15
|
+
const isLast = index === validChildren.length - 1;
|
|
16
|
+
return React.isValidElement<ListItemProps>(child)
|
|
17
|
+
? React.cloneElement(child, { isLast })
|
|
18
|
+
: child;
|
|
19
|
+
})}
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
container: {
|
|
26
|
+
borderWidth: 1,
|
|
27
|
+
borderRadius: Theme.radius.md,
|
|
28
|
+
borderColor: Color.gray[100],
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
2
|
+
import Color from '../Color/Color';
|
|
3
|
+
import Theme from '../Theme/Theme';
|
|
4
|
+
import type { ListItemProps } from './type';
|
|
5
|
+
|
|
6
|
+
export default function ListItem({
|
|
7
|
+
children,
|
|
8
|
+
onPress,
|
|
9
|
+
style,
|
|
10
|
+
isLast = false,
|
|
11
|
+
}: ListItemProps) {
|
|
12
|
+
const Wrapper = onPress ? TouchableOpacity : View;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Wrapper
|
|
16
|
+
onPress={onPress}
|
|
17
|
+
style={[styles.container, !isLast && styles.withBorder, style]}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</Wrapper>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
container: {
|
|
26
|
+
paddingHorizontal: Theme.spacing.md,
|
|
27
|
+
paddingVertical: Theme.spacing.sm,
|
|
28
|
+
backgroundColor: Color.base.white100,
|
|
29
|
+
},
|
|
30
|
+
withBorder: {
|
|
31
|
+
borderBottomWidth: 1,
|
|
32
|
+
borderBottomColor: Color.gray[100],
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ListItemProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
isLast?: boolean;
|
|
8
|
+
index?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ListProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
style?: ViewStyle;
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, ActivityIndicator, StyleSheet, Text } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface LoadingProps {
|
|
5
|
+
message?: string;
|
|
6
|
+
size?: 'small' | 'large' | number;
|
|
7
|
+
color?: string;
|
|
8
|
+
variant?: 'circle' | 'square';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Loading: React.FC<LoadingProps> = ({
|
|
12
|
+
message = 'Loading...',
|
|
13
|
+
size = 'large',
|
|
14
|
+
color = '#007AFF',
|
|
15
|
+
variant = 'circle',
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.wrapper}>
|
|
19
|
+
<View
|
|
20
|
+
style={[
|
|
21
|
+
styles.container,
|
|
22
|
+
variant === 'square' ? styles.square : styles.circle,
|
|
23
|
+
]}
|
|
24
|
+
>
|
|
25
|
+
<ActivityIndicator size={size} color={color} />
|
|
26
|
+
</View>
|
|
27
|
+
<Text style={styles.message}>{message}</Text>
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const styles = StyleSheet.create({
|
|
33
|
+
wrapper: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
zIndex: 2000,
|
|
36
|
+
},
|
|
37
|
+
container: {
|
|
38
|
+
padding: 20,
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
},
|
|
42
|
+
circle: {},
|
|
43
|
+
square: {
|
|
44
|
+
backgroundColor: '#F0F0F0',
|
|
45
|
+
borderRadius: 12,
|
|
46
|
+
width: 100,
|
|
47
|
+
height: 100,
|
|
48
|
+
},
|
|
49
|
+
message: {
|
|
50
|
+
marginTop: 12,
|
|
51
|
+
fontSize: 16,
|
|
52
|
+
color: '#333',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export default Loading;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Modal,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
Animated,
|
|
8
|
+
type DimensionValue,
|
|
9
|
+
SafeAreaView,
|
|
10
|
+
Platform,
|
|
11
|
+
type ViewStyle,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
|
|
14
|
+
interface ModalPopUpProps {
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
onClose?: (isOpen?: boolean) => void;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
backdrop?: boolean;
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
onRequestClose?: () => void;
|
|
21
|
+
bgColor?: string;
|
|
22
|
+
width?: DimensionValue;
|
|
23
|
+
height?: DimensionValue; // tetap ada, tapi tidak akan digunakan kalau ingin auto height
|
|
24
|
+
containerStyle?: ViewStyle;
|
|
25
|
+
modalStyle?: ViewStyle;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ModalPopUp: React.FC<ModalPopUpProps> = ({
|
|
29
|
+
isOpen,
|
|
30
|
+
onClose,
|
|
31
|
+
children,
|
|
32
|
+
backdrop = true,
|
|
33
|
+
closable = true,
|
|
34
|
+
onRequestClose,
|
|
35
|
+
bgColor = '#fff',
|
|
36
|
+
width = '90%',
|
|
37
|
+
containerStyle,
|
|
38
|
+
modalStyle,
|
|
39
|
+
}) => {
|
|
40
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
41
|
+
const scaleAnim = useState(() => new Animated.Value(0))[0];
|
|
42
|
+
|
|
43
|
+
const showModal = useCallback(() => {
|
|
44
|
+
setIsVisible(true);
|
|
45
|
+
Animated.spring(scaleAnim, {
|
|
46
|
+
toValue: 1,
|
|
47
|
+
useNativeDriver: true,
|
|
48
|
+
damping: 15,
|
|
49
|
+
stiffness: 100,
|
|
50
|
+
}).start();
|
|
51
|
+
}, [scaleAnim]);
|
|
52
|
+
|
|
53
|
+
const hideModal = useCallback(() => {
|
|
54
|
+
Animated.spring(scaleAnim, {
|
|
55
|
+
toValue: 0,
|
|
56
|
+
useNativeDriver: true,
|
|
57
|
+
}).start();
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
setIsVisible(false);
|
|
60
|
+
onClose?.(false);
|
|
61
|
+
}, 200);
|
|
62
|
+
}, [scaleAnim, onClose]);
|
|
63
|
+
|
|
64
|
+
const handleBackdropPress = useCallback(() => {
|
|
65
|
+
if (closable) {
|
|
66
|
+
if (onRequestClose) {
|
|
67
|
+
onRequestClose();
|
|
68
|
+
} else {
|
|
69
|
+
hideModal();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, [closable, onRequestClose, hideModal]);
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (isOpen) {
|
|
76
|
+
showModal();
|
|
77
|
+
} else {
|
|
78
|
+
hideModal();
|
|
79
|
+
}
|
|
80
|
+
}, [isOpen, showModal, hideModal]);
|
|
81
|
+
|
|
82
|
+
const modalContentStyle = StyleSheet.flatten([
|
|
83
|
+
{
|
|
84
|
+
transform: [{ scale: scaleAnim }],
|
|
85
|
+
backgroundColor: bgColor,
|
|
86
|
+
width: width,
|
|
87
|
+
maxHeight: '80%' as `${number}%`,
|
|
88
|
+
},
|
|
89
|
+
modalStyle,
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Modal
|
|
94
|
+
transparent
|
|
95
|
+
visible={isVisible}
|
|
96
|
+
onRequestClose={handleBackdropPress}
|
|
97
|
+
statusBarTranslucent
|
|
98
|
+
>
|
|
99
|
+
<View style={[styles.modalContainer, containerStyle]}>
|
|
100
|
+
{backdrop && (
|
|
101
|
+
<TouchableOpacity
|
|
102
|
+
style={[styles.backdrop, styles.backdropTouch]}
|
|
103
|
+
activeOpacity={1}
|
|
104
|
+
onPress={handleBackdropPress}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
<Animated.View style={[styles.modalContent, modalContentStyle]}>
|
|
108
|
+
{closable && (
|
|
109
|
+
<View style={styles.closeButtonContainer}>
|
|
110
|
+
<TouchableOpacity
|
|
111
|
+
onPress={hideModal}
|
|
112
|
+
style={styles.closeButton}
|
|
113
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
114
|
+
/>
|
|
115
|
+
</View>
|
|
116
|
+
)}
|
|
117
|
+
<SafeAreaView style={styles.contentContainer}>
|
|
118
|
+
{children}
|
|
119
|
+
</SafeAreaView>
|
|
120
|
+
</Animated.View>
|
|
121
|
+
</View>
|
|
122
|
+
</Modal>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const styles = StyleSheet.create({
|
|
127
|
+
modalContainer: {
|
|
128
|
+
flex: 1,
|
|
129
|
+
justifyContent: 'center',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
},
|
|
132
|
+
backdrop: {
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
top: 0,
|
|
135
|
+
left: 0,
|
|
136
|
+
right: 0,
|
|
137
|
+
bottom: 0,
|
|
138
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
139
|
+
},
|
|
140
|
+
backdropTouch: {
|
|
141
|
+
width: '100%',
|
|
142
|
+
height: '100%',
|
|
143
|
+
},
|
|
144
|
+
modalContent: {
|
|
145
|
+
borderRadius: 16,
|
|
146
|
+
overflow: 'visible',
|
|
147
|
+
...Platform.select({
|
|
148
|
+
ios: {
|
|
149
|
+
shadowColor: '#000',
|
|
150
|
+
shadowOffset: {
|
|
151
|
+
width: 0,
|
|
152
|
+
height: 2,
|
|
153
|
+
},
|
|
154
|
+
shadowOpacity: 0.25,
|
|
155
|
+
shadowRadius: 4,
|
|
156
|
+
},
|
|
157
|
+
android: {
|
|
158
|
+
elevation: 5,
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
},
|
|
162
|
+
closeButtonContainer: {
|
|
163
|
+
position: 'absolute',
|
|
164
|
+
top: 10,
|
|
165
|
+
right: 10,
|
|
166
|
+
zIndex: 1,
|
|
167
|
+
},
|
|
168
|
+
closeButton: {
|
|
169
|
+
width: 24,
|
|
170
|
+
height: 24,
|
|
171
|
+
borderRadius: 12,
|
|
172
|
+
backgroundColor: '#ccc',
|
|
173
|
+
},
|
|
174
|
+
contentContainer: {
|
|
175
|
+
padding: 16, // bisa diubah sesuai kebutuhan
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export default ModalPopUp;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createContext, useContext, useState, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface FooterContextType {
|
|
4
|
+
footer: ReactNode | null;
|
|
5
|
+
setFooter: (footer: ReactNode | null) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const FooterContext = createContext<FooterContextType | undefined>(undefined);
|
|
9
|
+
|
|
10
|
+
export const FooterProvider = ({ children }: { children: ReactNode }) => {
|
|
11
|
+
const [footer, setFooter] = useState<ReactNode | null>(null);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<FooterContext.Provider value={{ footer, setFooter }}>
|
|
15
|
+
{children}
|
|
16
|
+
</FooterContext.Provider>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const useFooter = () => {
|
|
21
|
+
const context = useContext(FooterContext);
|
|
22
|
+
if (!context) {
|
|
23
|
+
throw new Error('useFooter must be used within a FooterProvider');
|
|
24
|
+
}
|
|
25
|
+
return context;
|
|
26
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyleSheet, SafeAreaView } from 'react-native';
|
|
2
|
+
import { useFooter } from './Provider';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Color from '../Color/Color';
|
|
5
|
+
|
|
6
|
+
export default function LayoutWithFooter({
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) {
|
|
11
|
+
const { footer } = useFooter();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<SafeAreaView style={styles.container}>
|
|
15
|
+
<SafeAreaView style={[styles.content, footer && styles.footer]}>
|
|
16
|
+
{children}
|
|
17
|
+
</SafeAreaView>
|
|
18
|
+
{footer}
|
|
19
|
+
</SafeAreaView>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
container: { flex: 1, backgroundColor: Color.base.white100 },
|
|
25
|
+
content: { flex: 1 },
|
|
26
|
+
footer: { marginBottom: 60 },
|
|
27
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// FooterContext.js
|
|
2
|
+
import { createContext, useContext, useState } from 'react';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import LayoutWithFooter from './LayoutWithFooter';
|
|
5
|
+
import RequiredUpdateAppsProvider from './RequiredUpdateAppsProvider';
|
|
6
|
+
import { type ReactNode } from 'react';
|
|
7
|
+
import type { RequiredUpdateAppsProviderProps } from './type';
|
|
8
|
+
|
|
9
|
+
interface FooterContextType {
|
|
10
|
+
footer: any | null;
|
|
11
|
+
setFooter: (value: any) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ProviderProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
requiredUpdated: boolean;
|
|
17
|
+
updateConfig: RequiredUpdateAppsProviderProps;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const FooterContext = createContext<FooterContextType | undefined>(undefined);
|
|
21
|
+
|
|
22
|
+
export default function Provider({
|
|
23
|
+
children,
|
|
24
|
+
requiredUpdated = false,
|
|
25
|
+
updateConfig,
|
|
26
|
+
}: ProviderProps) {
|
|
27
|
+
const [footer, setFooter] = useState(null);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<View style={styles.container}>
|
|
31
|
+
{requiredUpdated ? (
|
|
32
|
+
<RequiredUpdateAppsProvider {...updateConfig} />
|
|
33
|
+
) : null}
|
|
34
|
+
<FooterContext.Provider value={{ footer, setFooter }}>
|
|
35
|
+
<LayoutWithFooter>{children}</LayoutWithFooter>
|
|
36
|
+
</FooterContext.Provider>
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const useFooter = () => {
|
|
42
|
+
const context = useContext(FooterContext);
|
|
43
|
+
if (context === undefined) {
|
|
44
|
+
throw new Error('useFooter must be used within a Footer Provider');
|
|
45
|
+
}
|
|
46
|
+
return context;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
container: {
|
|
51
|
+
flex: 1,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Image, StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Button, Color, Container, Modal, Typography } from '..';
|
|
3
|
+
import type { RequiredUpdateAppsProviderProps } from './type';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
export default function RequiredUpdateAppsProvider({
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
buttonText = 'Update Sekarang',
|
|
10
|
+
onUpdate,
|
|
11
|
+
}: RequiredUpdateAppsProviderProps) {
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
onUpdate?.(false);
|
|
14
|
+
}, [onUpdate]);
|
|
15
|
+
return (
|
|
16
|
+
<View>
|
|
17
|
+
<Modal height={300} isOpen={true} closable={false}>
|
|
18
|
+
<Image
|
|
19
|
+
source={require('../../example/assets/updateapps.png')}
|
|
20
|
+
style={styles.image}
|
|
21
|
+
/>
|
|
22
|
+
<Container style={styles.container}>
|
|
23
|
+
<Typography
|
|
24
|
+
variant="h4"
|
|
25
|
+
weight="semibold"
|
|
26
|
+
color={Color.gray[800]}
|
|
27
|
+
center
|
|
28
|
+
>
|
|
29
|
+
{title}
|
|
30
|
+
</Typography>
|
|
31
|
+
<Typography
|
|
32
|
+
variant="t1"
|
|
33
|
+
weight="regular"
|
|
34
|
+
color={Color.gray[600]}
|
|
35
|
+
center
|
|
36
|
+
>
|
|
37
|
+
{description}.
|
|
38
|
+
</Typography>
|
|
39
|
+
<View style={{}}>
|
|
40
|
+
<Button title={buttonText} color="primary" />
|
|
41
|
+
</View>
|
|
42
|
+
</Container>
|
|
43
|
+
</Modal>
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
image: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
marginTop: -60,
|
|
52
|
+
left: 30,
|
|
53
|
+
},
|
|
54
|
+
container: {
|
|
55
|
+
gap: 20,
|
|
56
|
+
marginTop: 80,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# 📦 RadioButton – Komponen React Native
|
|
2
|
+
|
|
3
|
+
Komponen `RadioButton` ini digunakan untuk menampilkan daftar pilihan dalam bentuk radio button di aplikasi React Native.
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
## 📄 Import
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import RadioButton from './RadioButton';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## ⚙️ Props
|
|
13
|
+
|
|
14
|
+
| Nama Props | Tipe | Default | Deskripsi |
|
|
15
|
+
|------------------|--------------------------------------------|-------------|---------------------------------------------------------------------------|
|
|
16
|
+
| `items` | `RadioButtonItem[]` | - | Daftar item radio yang ingin ditampilkan. |
|
|
17
|
+
| `selectedValue` | `string \| null` | `null` | Nilai yang saat ini dipilih oleh pengguna. |
|
|
18
|
+
| `onChange` | `(value: string) => void` | - | Fungsi callback saat item dipilih. |
|
|
19
|
+
| `direction` | `'vertical' \| 'horizontal'` | `'vertical'`| Arah layout dari item radio: vertikal atau horizontal. |
|
|
20
|
+
|
|
21
|
+
## 📄 Tipe `RadioButtonItem`
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
interface RadioButtonItem {
|
|
25
|
+
label: string; // Teks yang ditampilkan untuk radio
|
|
26
|
+
value: string; // Nilai yang digunakan untuk identifikasi
|
|
27
|
+
disabled?: boolean; // Menonaktifkan tombol radio
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 💡 Contoh Penggunaan
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
<RadioButton
|
|
35
|
+
items={[
|
|
36
|
+
{ label: 'Laki-laki', value: 'M' },
|
|
37
|
+
{ label: 'Perempuan', value: 'F' },
|
|
38
|
+
]}
|
|
39
|
+
selectedValue={gender}
|
|
40
|
+
onChange={setGender}
|
|
41
|
+
direction="horizontal"
|
|
42
|
+
/>
|
|
43
|
+
```
|