@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,63 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
|
|
6
|
+
const COLOR_MAP = {
|
|
7
|
+
warning: Color.warning[400],
|
|
8
|
+
primary: Color.primary[900],
|
|
9
|
+
success: Color.success[500],
|
|
10
|
+
purple: Color.purple[500],
|
|
11
|
+
danger: Color.danger[500],
|
|
12
|
+
};
|
|
13
|
+
type ColorKey = keyof typeof COLOR_MAP;
|
|
14
|
+
|
|
15
|
+
interface TimelineItemProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
color: ColorKey;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function TimelineItem({
|
|
21
|
+
children,
|
|
22
|
+
color = 'primary',
|
|
23
|
+
}: TimelineItemProps) {
|
|
24
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View style={styles.container}>
|
|
28
|
+
<View style={styles.contentLeft}>
|
|
29
|
+
<Icon name="RadioButton" color={COLOR_MAP[color]} />
|
|
30
|
+
<View style={[styles.border, { height: contentHeight - 20 }]} />
|
|
31
|
+
</View>
|
|
32
|
+
<View
|
|
33
|
+
style={styles.flex}
|
|
34
|
+
onLayout={(e) => {
|
|
35
|
+
const { height } = e.nativeEvent.layout;
|
|
36
|
+
setContentHeight(height);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<View>{children}</View>
|
|
40
|
+
</View>
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
container: {
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
alignItems: 'flex-start',
|
|
48
|
+
},
|
|
49
|
+
contentLeft: {
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
marginRight: 8,
|
|
52
|
+
},
|
|
53
|
+
border: {
|
|
54
|
+
width: 1,
|
|
55
|
+
borderLeftWidth: 1,
|
|
56
|
+
borderLeftColor: Color.gray[400],
|
|
57
|
+
borderStyle: 'dashed',
|
|
58
|
+
marginTop: 4,
|
|
59
|
+
},
|
|
60
|
+
flex: {
|
|
61
|
+
flex: 1,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
import { Animated, StyleSheet, View } from 'react-native';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import Typography from '../Typography/Typography';
|
|
5
|
+
import Icon, { type IconNameProps } from '../Icon';
|
|
6
|
+
import Button from '../Button/Button';
|
|
7
|
+
import Container from '../Ui/Container';
|
|
8
|
+
|
|
9
|
+
type ToastColor =
|
|
10
|
+
| 'default'
|
|
11
|
+
| 'success'
|
|
12
|
+
| 'danger'
|
|
13
|
+
| 'primary'
|
|
14
|
+
| 'warning'
|
|
15
|
+
| 'info'
|
|
16
|
+
| 'purple'
|
|
17
|
+
| 'orange';
|
|
18
|
+
|
|
19
|
+
const COLOR_MAP: Record<
|
|
20
|
+
ToastColor,
|
|
21
|
+
{
|
|
22
|
+
bg: string;
|
|
23
|
+
text: string;
|
|
24
|
+
border: string;
|
|
25
|
+
}
|
|
26
|
+
> = {
|
|
27
|
+
primary: {
|
|
28
|
+
bg: Color.base.white100,
|
|
29
|
+
border: Color.gray[50],
|
|
30
|
+
text: Color.primary[1000],
|
|
31
|
+
},
|
|
32
|
+
default: {
|
|
33
|
+
bg: Color.gray[700],
|
|
34
|
+
border: Color.gray[700],
|
|
35
|
+
text: Color.base.white100,
|
|
36
|
+
},
|
|
37
|
+
success: {
|
|
38
|
+
bg: Color.success[50],
|
|
39
|
+
border: Color.success[50],
|
|
40
|
+
text: Color.success[500],
|
|
41
|
+
},
|
|
42
|
+
danger: {
|
|
43
|
+
bg: Color.danger[50],
|
|
44
|
+
border: Color.danger[50],
|
|
45
|
+
text: Color.danger[500],
|
|
46
|
+
},
|
|
47
|
+
warning: {
|
|
48
|
+
bg: Color.warning[50],
|
|
49
|
+
border: Color.warning[50],
|
|
50
|
+
text: Color.warning[400],
|
|
51
|
+
},
|
|
52
|
+
info: {
|
|
53
|
+
bg: Color.info[50],
|
|
54
|
+
border: Color.info[50],
|
|
55
|
+
text: Color.info[500],
|
|
56
|
+
},
|
|
57
|
+
orange: {
|
|
58
|
+
bg: Color.orange[50],
|
|
59
|
+
border: Color.orange[50],
|
|
60
|
+
text: Color.orange[500],
|
|
61
|
+
},
|
|
62
|
+
purple: {
|
|
63
|
+
bg: Color.purple[50],
|
|
64
|
+
border: Color.purple[50],
|
|
65
|
+
text: Color.purple[500],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
interface ToastProps {
|
|
70
|
+
visible?: boolean;
|
|
71
|
+
duration?: number;
|
|
72
|
+
color?: ToastColor;
|
|
73
|
+
message?: string;
|
|
74
|
+
icon?: IconNameProps;
|
|
75
|
+
onClear?: (val: boolean) => void;
|
|
76
|
+
onHide?: (val: boolean) => void;
|
|
77
|
+
}
|
|
78
|
+
const Toast = ({
|
|
79
|
+
visible,
|
|
80
|
+
message,
|
|
81
|
+
duration = 3000,
|
|
82
|
+
onHide,
|
|
83
|
+
color = 'default',
|
|
84
|
+
icon = 'ExlamationMark',
|
|
85
|
+
onClear,
|
|
86
|
+
}: ToastProps) => {
|
|
87
|
+
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
88
|
+
const validColors: ToastColor[] = [
|
|
89
|
+
'default',
|
|
90
|
+
'success',
|
|
91
|
+
'danger',
|
|
92
|
+
'primary',
|
|
93
|
+
'warning',
|
|
94
|
+
'info',
|
|
95
|
+
'purple',
|
|
96
|
+
'orange',
|
|
97
|
+
];
|
|
98
|
+
const safeColor = validColors.includes(color) ? color : 'default';
|
|
99
|
+
|
|
100
|
+
const baseContainerStyle = StyleSheet.flatten({
|
|
101
|
+
backgroundColor: COLOR_MAP[safeColor].bg,
|
|
102
|
+
borderColor: COLOR_MAP[safeColor].border,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const handlePressClearButton = () => {
|
|
106
|
+
onClear?.(true);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (visible) {
|
|
111
|
+
Animated.sequence([
|
|
112
|
+
Animated.timing(fadeAnim, {
|
|
113
|
+
toValue: 1,
|
|
114
|
+
duration: 300,
|
|
115
|
+
useNativeDriver: true,
|
|
116
|
+
}),
|
|
117
|
+
Animated.delay(duration),
|
|
118
|
+
Animated.timing(fadeAnim, {
|
|
119
|
+
toValue: 0,
|
|
120
|
+
duration: 300,
|
|
121
|
+
useNativeDriver: true,
|
|
122
|
+
}),
|
|
123
|
+
]).start(() => {
|
|
124
|
+
if (onHide) onHide(true);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}, [visible, duration, onHide, fadeAnim]);
|
|
128
|
+
|
|
129
|
+
if (!visible) return null;
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Animated.View
|
|
133
|
+
style={[styles.toast, baseContainerStyle, { opacity: fadeAnim }]}
|
|
134
|
+
>
|
|
135
|
+
<Container>
|
|
136
|
+
<View style={styles.container}>
|
|
137
|
+
<View style={styles.content}>
|
|
138
|
+
<Icon name={icon} size={20} color={COLOR_MAP[safeColor].text} />
|
|
139
|
+
<Typography variant="t2" color={COLOR_MAP[safeColor].text}>
|
|
140
|
+
{message}
|
|
141
|
+
</Typography>
|
|
142
|
+
</View>
|
|
143
|
+
<Button
|
|
144
|
+
variant="tertiary"
|
|
145
|
+
size="small"
|
|
146
|
+
title="x"
|
|
147
|
+
onPress={handlePressClearButton}
|
|
148
|
+
>
|
|
149
|
+
<Icon name="Times" size={10} color={COLOR_MAP[safeColor].text} />
|
|
150
|
+
</Button>
|
|
151
|
+
</View>
|
|
152
|
+
</Container>
|
|
153
|
+
</Animated.View>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const styles = StyleSheet.create({
|
|
158
|
+
toast: {
|
|
159
|
+
position: 'absolute',
|
|
160
|
+
bottom: 80,
|
|
161
|
+
left: 28,
|
|
162
|
+
right: 28,
|
|
163
|
+
backgroundColor: '#333',
|
|
164
|
+
borderWidth: 1,
|
|
165
|
+
borderRadius: 8,
|
|
166
|
+
zIndex: 999,
|
|
167
|
+
},
|
|
168
|
+
container: {
|
|
169
|
+
flexDirection: 'row',
|
|
170
|
+
justifyContent: 'space-between',
|
|
171
|
+
},
|
|
172
|
+
content: {
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
gap: 8,
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export default Toast;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createContext, useContext, useState, type ReactNode } from 'react';
|
|
2
|
+
import Toast from './Toast';
|
|
3
|
+
import type { ColorVariantType } from '../Color/type';
|
|
4
|
+
import type { IconNameProps } from '../Icon';
|
|
5
|
+
|
|
6
|
+
interface ToastOptions {
|
|
7
|
+
color?: ColorVariantType;
|
|
8
|
+
icon?: IconNameProps;
|
|
9
|
+
duration?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ToastContextType {
|
|
13
|
+
show: (message: string, options?: ToastOptions) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const ToastContext = createContext<ToastContextType | undefined>(undefined);
|
|
17
|
+
|
|
18
|
+
export const ToastProvider = ({ children }: { children: ReactNode }) => {
|
|
19
|
+
const [visible, setVisible] = useState(false);
|
|
20
|
+
const [message, setMessage] = useState<string>('');
|
|
21
|
+
const [options, setOptions] = useState<ToastOptions>({
|
|
22
|
+
icon: 'ExlamationMark',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const show = (msg: string, opts?: ToastOptions) => {
|
|
26
|
+
setMessage(msg);
|
|
27
|
+
setOptions(opts || {});
|
|
28
|
+
setVisible(true);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ToastContext.Provider value={{ show }}>
|
|
33
|
+
{children}
|
|
34
|
+
<Toast
|
|
35
|
+
visible={visible}
|
|
36
|
+
message={message}
|
|
37
|
+
onHide={() => setVisible(false)}
|
|
38
|
+
onClear={() => setVisible(false)}
|
|
39
|
+
color={options.color}
|
|
40
|
+
icon={options.icon}
|
|
41
|
+
duration={options.duration}
|
|
42
|
+
/>
|
|
43
|
+
</ToastContext.Provider>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const useToast = (): ToastContextType => {
|
|
48
|
+
const context = useContext(ToastContext);
|
|
49
|
+
if (!context) throw new Error('useToast must be used within a ToastProvider');
|
|
50
|
+
return context;
|
|
51
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# ✍️ Typography Component
|
|
2
|
+
|
|
3
|
+
Komponen `Typography` digunakan untuk menampilkan teks dengan berbagai ukuran, ketebalan, warna, dan perataan yang telah ditentukan.
|
|
4
|
+
|
|
5
|
+
## ✨ Fitur
|
|
6
|
+
|
|
7
|
+
- Mendukung berbagai varian teks (heading, paragraph, text kecil)
|
|
8
|
+
- Dapat mengatur ketebalan teks (*weight*)
|
|
9
|
+
- Mendukung warna kustom
|
|
10
|
+
- Dukungan perataan: kiri, kanan, tengah
|
|
11
|
+
- Mendukung pemotongan teks (`numberOfLines`)
|
|
12
|
+
|
|
13
|
+
## 🧱 Props
|
|
14
|
+
|
|
15
|
+
| Prop | Tipe | Default | Deskripsi |
|
|
16
|
+
|----------------|-------------------------------|-------------|------------------------------------------------------------------|
|
|
17
|
+
| `children` | `React.ReactNode` | - | Isi teks yang akan ditampilkan |
|
|
18
|
+
| `variant` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'p1' \| 'p2' \| 'p3' \| 't1' \| 't2' \| 't3'` | `'p3'` | Ukuran dan gaya teks |
|
|
19
|
+
| `weight` | `'regular' \| 'medium' \| 'semibold' \| 'bold'` | `'regular'` | Ketebalan huruf |
|
|
20
|
+
| `color` | `ColorValue` | `'default'` | Warna teks |
|
|
21
|
+
| `style` | `ViewStyle` | `undefined` | Gaya tambahan |
|
|
22
|
+
| `numberOfLines`| `number` | `undefined` | Jumlah maksimal baris teks ditampilkan |
|
|
23
|
+
| `center` | `boolean` | `false` | Mengatur teks ke tengah |
|
|
24
|
+
| `right` | `boolean` | `false` | Mengatur teks ke kanan |
|
|
25
|
+
| `left` | `boolean` | `false` | Mengatur teks ke kiri |
|
|
26
|
+
|
|
27
|
+
## 🔠 Varian & Ukuran
|
|
28
|
+
|
|
29
|
+
| Variant | Font Size | Line Height |
|
|
30
|
+
|---------|-----------|-------------|
|
|
31
|
+
| h1 | 36 | 46 |
|
|
32
|
+
| h2 | 32 | 42 |
|
|
33
|
+
| h3 | 28 | 38 |
|
|
34
|
+
| h4 | 24 | 34 |
|
|
35
|
+
| p1 | 20 | 30 |
|
|
36
|
+
| p2 | 18 | 28 |
|
|
37
|
+
| p3 | 16 | 26 |
|
|
38
|
+
| t1 | 14 | 14 |
|
|
39
|
+
| t2 | 12 | 14 |
|
|
40
|
+
| t3 | 10 | 14 |
|
|
41
|
+
|
|
42
|
+
## 🧪 Contoh Penggunaan
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import React from 'react';
|
|
46
|
+
import Typography from './Typography'; // sesuaikan path
|
|
47
|
+
|
|
48
|
+
export default function Example() {
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<Typography variant="h1" weight="bold" center>
|
|
52
|
+
Judul Utama
|
|
53
|
+
</Typography>
|
|
54
|
+
|
|
55
|
+
<Typography variant="p2" color="gray" numberOfLines={2}>
|
|
56
|
+
Ini adalah deskripsi yang akan terpotong jika melebihi dua baris.
|
|
57
|
+
</Typography>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 🗂️ Struktur File
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Typography.tsx
|
|
67
|
+
├── Color/
|
|
68
|
+
├── type.ts (berisi TypographyVariantProps)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Pastikan untuk menyesuaikan `Color` dan `type.ts` agar mendukung struktur tema Anda.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, type TextStyle } from 'react-native';
|
|
3
|
+
import Color from '../Color/Color';
|
|
4
|
+
import {
|
|
5
|
+
fontSizeMap,
|
|
6
|
+
fontWeightMap,
|
|
7
|
+
lineHeightMap,
|
|
8
|
+
type TypographyProps,
|
|
9
|
+
} from './type';
|
|
10
|
+
|
|
11
|
+
const Typography: React.FC<TypographyProps> = ({
|
|
12
|
+
children,
|
|
13
|
+
variant = 'p3',
|
|
14
|
+
weight = 'regular',
|
|
15
|
+
color = 'default',
|
|
16
|
+
style,
|
|
17
|
+
numberOfLines,
|
|
18
|
+
center,
|
|
19
|
+
right,
|
|
20
|
+
left,
|
|
21
|
+
}) => {
|
|
22
|
+
const textStyle: TextStyle = {
|
|
23
|
+
fontSize: fontSizeMap[variant],
|
|
24
|
+
lineHeight: lineHeightMap[variant],
|
|
25
|
+
fontWeight: fontWeightMap[weight],
|
|
26
|
+
color: color ? color : Color.primary[1000],
|
|
27
|
+
textAlign: center ? 'center' : right ? 'right' : left ? 'left' : undefined,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Text style={[styles.text, textStyle, style]} numberOfLines={numberOfLines}>
|
|
32
|
+
{children}
|
|
33
|
+
</Text>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default Typography;
|
|
38
|
+
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
text: {
|
|
41
|
+
flexWrap: 'wrap',
|
|
42
|
+
flexShrink: 1,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, TextStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type TypographyVariantProps =
|
|
4
|
+
| 'h1'
|
|
5
|
+
| 'h2'
|
|
6
|
+
| 'h3'
|
|
7
|
+
| 'h4'
|
|
8
|
+
| 'p1'
|
|
9
|
+
| 'p2'
|
|
10
|
+
| 'p3'
|
|
11
|
+
| 't1'
|
|
12
|
+
| 't2'
|
|
13
|
+
| 't3';
|
|
14
|
+
|
|
15
|
+
export type Weight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
16
|
+
|
|
17
|
+
export const fontSizeMap: Record<TypographyVariantProps, number> = {
|
|
18
|
+
h1: 36,
|
|
19
|
+
h2: 32,
|
|
20
|
+
h3: 28,
|
|
21
|
+
h4: 24,
|
|
22
|
+
p1: 20,
|
|
23
|
+
p2: 18,
|
|
24
|
+
p3: 16,
|
|
25
|
+
t1: 14,
|
|
26
|
+
t2: 12,
|
|
27
|
+
t3: 10,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const lineHeightMap: Record<TypographyVariantProps, number> = {
|
|
31
|
+
h1: 46,
|
|
32
|
+
h2: 42,
|
|
33
|
+
h3: 38,
|
|
34
|
+
h4: 34,
|
|
35
|
+
p1: 30,
|
|
36
|
+
p2: 28,
|
|
37
|
+
p3: 26,
|
|
38
|
+
t1: 24,
|
|
39
|
+
t2: 20,
|
|
40
|
+
t3: 14,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const fontWeightMap: Record<Weight, TextStyle['fontWeight']> = {
|
|
44
|
+
regular: '400',
|
|
45
|
+
medium: '500',
|
|
46
|
+
semibold: '600',
|
|
47
|
+
bold: '700',
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export interface TypographyProps {
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
variant?: TypographyVariantProps;
|
|
53
|
+
weight?: Weight;
|
|
54
|
+
color?: ColorValue;
|
|
55
|
+
style?: StyleProp<TextStyle>;
|
|
56
|
+
numberOfLines?: number;
|
|
57
|
+
center?: boolean;
|
|
58
|
+
right?: boolean;
|
|
59
|
+
left?: boolean;
|
|
60
|
+
}
|
package/src/Ui/Card.tsx
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
View,
|
|
5
|
+
ImageBackground,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import Color from '../Color/Color';
|
|
10
|
+
|
|
11
|
+
interface CardProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
style?: StyleProp<ViewStyle>;
|
|
14
|
+
backgroundImage?: any;
|
|
15
|
+
backgroundColor?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function Card({
|
|
19
|
+
children,
|
|
20
|
+
style,
|
|
21
|
+
backgroundImage,
|
|
22
|
+
backgroundColor,
|
|
23
|
+
}: CardProps) {
|
|
24
|
+
if (backgroundImage) {
|
|
25
|
+
return (
|
|
26
|
+
<ImageBackground
|
|
27
|
+
source={backgroundImage}
|
|
28
|
+
style={[styles.imageBackground, style]}
|
|
29
|
+
imageStyle={styles.imageStyle}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</ImageBackground>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return (
|
|
36
|
+
<View
|
|
37
|
+
style={[
|
|
38
|
+
styles.container,
|
|
39
|
+
style,
|
|
40
|
+
typeof backgroundColor === 'string' && { backgroundColor },
|
|
41
|
+
]}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const sharedCardStyle = {
|
|
49
|
+
borderWidth: 1,
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
borderColor: Color.gray['100'],
|
|
52
|
+
padding: 10,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const styles = StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
...sharedCardStyle,
|
|
58
|
+
overflow: 'hidden',
|
|
59
|
+
backgroundColor: '#fff',
|
|
60
|
+
},
|
|
61
|
+
imageBackground: {
|
|
62
|
+
...sharedCardStyle,
|
|
63
|
+
},
|
|
64
|
+
imageStyle: {
|
|
65
|
+
borderRadius: 8,
|
|
66
|
+
},
|
|
67
|
+
inner: {
|
|
68
|
+
padding: 10, // tetap kasih padding isi
|
|
69
|
+
},
|
|
70
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { View, StyleSheet, type ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface CenterProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
size?: number;
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Center = ({ children, style }: CenterProps) => {
|
|
10
|
+
return <View style={[styles.center, style]}>{children}</View>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const styles = StyleSheet.create({
|
|
14
|
+
center: {
|
|
15
|
+
alignContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default Center;
|
package/src/Ui/Col.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { type ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface ColProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
size?: number;
|
|
8
|
+
style?: ViewStyle;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Col: React.FC<ColProps> = ({ children, size = 12, style }) => {
|
|
12
|
+
const widthPercent = (size / 12) * 100;
|
|
13
|
+
|
|
14
|
+
return <View style={[{ width: `${widthPercent}%` }, style]}>{children}</View>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default Col;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default function Container({ children, style }: any) {
|
|
4
|
+
return <View style={[styles.container, style && style]}>{children}</View>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
container: {
|
|
9
|
+
paddingHorizontal: 24,
|
|
10
|
+
paddingVertical: 8,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import Color from '../Color/Color';
|
|
3
|
+
|
|
4
|
+
const Divider = () => {
|
|
5
|
+
return <View style={styles.divider} />;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
divider: {
|
|
10
|
+
height: 1,
|
|
11
|
+
backgroundColor: Color.gray[200],
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default Divider;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
+
import type { ViewStyle } from 'react-native';
|
|
4
|
+
import Color from '../Color/Color';
|
|
5
|
+
import { useFooter } from '../Provider/Provider';
|
|
6
|
+
|
|
7
|
+
interface FooterProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
}
|
|
11
|
+
const Footer: React.FC<FooterProps> = ({ children, style }) => {
|
|
12
|
+
const { setFooter } = useFooter();
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const footerElement = (
|
|
16
|
+
<SafeAreaView style={[styles.container, style]}>{children}</SafeAreaView>
|
|
17
|
+
);
|
|
18
|
+
setFooter(footerElement);
|
|
19
|
+
|
|
20
|
+
return () => setFooter(null);
|
|
21
|
+
}, [children, style, setFooter]);
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Footer;
|
|
27
|
+
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
container: {
|
|
30
|
+
backgroundColor: Color.base.white100,
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
bottom: 0,
|
|
33
|
+
left: 0,
|
|
34
|
+
right: 0,
|
|
35
|
+
zIndex: 10,
|
|
36
|
+
},
|
|
37
|
+
});
|
package/src/Ui/Gap.tsx
ADDED
package/src/Ui/Grid.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import type { ViewStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
interface GridProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
style: ViewStyle;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Grid: React.FC<GridProps> = ({ children, style }) => {
|
|
11
|
+
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<View style={[styles.row, style]}>
|
|
15
|
+
{childrenArray.map((child, index) => (
|
|
16
|
+
<View key={index} style={styles.children}>
|
|
17
|
+
{child}
|
|
18
|
+
</View>
|
|
19
|
+
))}
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
row: {
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
flexWrap: 'wrap',
|
|
28
|
+
marginHorizontal: -4,
|
|
29
|
+
},
|
|
30
|
+
children: {
|
|
31
|
+
paddingHorizontal: 2,
|
|
32
|
+
flex: 1,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export default Grid;
|