@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,41 @@
|
|
|
1
|
+
# ✅ Komponen CheckBoxList
|
|
2
|
+
|
|
3
|
+
`CheckBoxList` adalah komponen React Native untuk menampilkan daftar checkbox berdasarkan array item yang dapat dipilih lebih dari satu.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🚀 Contoh Penggunaan
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { View } from 'react-native';
|
|
12
|
+
import CheckBoxList from './CheckBoxList';
|
|
13
|
+
|
|
14
|
+
export default function App() {
|
|
15
|
+
const [selected, setSelected] = useState<string[]>([]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View>
|
|
19
|
+
<CheckBoxList
|
|
20
|
+
items={[
|
|
21
|
+
{ label: 'Item A', value: 'a' },
|
|
22
|
+
{ label: 'Item B', value: 'b' },
|
|
23
|
+
{ label: 'Item C', value: 'c' },
|
|
24
|
+
]}
|
|
25
|
+
selectedValues={selected}
|
|
26
|
+
onChange={setSelected}
|
|
27
|
+
direction="vertical"
|
|
28
|
+
/>
|
|
29
|
+
</View>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
## ⚙️ Props
|
|
34
|
+
|
|
35
|
+
| Prop | Tipe | Deskripsi | |
|
|
36
|
+
| ---------------- | ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
37
|
+
| `items` | `CheckBoxListItem[]` | Daftar item yang akan ditampilkan. Setiap item memiliki `label` dan `value`. | |
|
|
38
|
+
| `selectedValues` | `string[]` | Nilai-nilai yang saat ini sedang dipilih. | |
|
|
39
|
+
| `onChange` | `(selected: string[]) => void` | Callback saat nilai pilihan berubah. | |
|
|
40
|
+
| `direction` | \`'vertical' | 'horizontal'\` (opsional) | Arah tampilan checkbox (default: `'vertical'`). |
|
|
41
|
+
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
2
|
+
import { FlatList, StyleSheet } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
type ChipOptionProps,
|
|
5
|
+
type ChipProps,
|
|
6
|
+
type ChipSelectedProps,
|
|
7
|
+
type ChipValue,
|
|
8
|
+
} from './type';
|
|
9
|
+
import ChipItem from './ChipItem';
|
|
10
|
+
|
|
11
|
+
const Chip: React.FC<ChipProps> = ({
|
|
12
|
+
options,
|
|
13
|
+
selected = [],
|
|
14
|
+
onSelect,
|
|
15
|
+
onPress,
|
|
16
|
+
direction = 'horizontal',
|
|
17
|
+
color = 'default',
|
|
18
|
+
renderItem,
|
|
19
|
+
multiple = false,
|
|
20
|
+
scrollable = true,
|
|
21
|
+
block = false,
|
|
22
|
+
size = 'medium',
|
|
23
|
+
onRefresh,
|
|
24
|
+
refreshing = false,
|
|
25
|
+
}) => {
|
|
26
|
+
const isHorizontal = direction === 'horizontal';
|
|
27
|
+
|
|
28
|
+
const normalizeSelected = (val: ChipSelectedProps) =>
|
|
29
|
+
Array.isArray(val) ? val : val ? [val] : [];
|
|
30
|
+
|
|
31
|
+
const [internalSelected, setInternalSelected] = useState<ChipSelectedProps>(
|
|
32
|
+
normalizeSelected(selected)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const newSelected = normalizeSelected(selected);
|
|
37
|
+
if (JSON.stringify(newSelected) !== JSON.stringify(internalSelected)) {
|
|
38
|
+
setInternalSelected(newSelected);
|
|
39
|
+
}
|
|
40
|
+
}, [selected, internalSelected]);
|
|
41
|
+
|
|
42
|
+
const isSelected = (value: ChipValue) => internalSelected.includes(value);
|
|
43
|
+
|
|
44
|
+
const handleSelect = (value: string | number) => {
|
|
45
|
+
let newSelected: ChipSelectedProps;
|
|
46
|
+
|
|
47
|
+
if (multiple || (!multiple && internalSelected.length === 0)) {
|
|
48
|
+
newSelected = isSelected(value)
|
|
49
|
+
? internalSelected.filter((v) => v !== value)
|
|
50
|
+
: [...internalSelected, value];
|
|
51
|
+
} else {
|
|
52
|
+
newSelected = [value];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
setInternalSelected(newSelected);
|
|
56
|
+
|
|
57
|
+
if (onSelect) {
|
|
58
|
+
onSelect(newSelected);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const numColumns = useMemo(() => {
|
|
63
|
+
if (isHorizontal || block) return 1;
|
|
64
|
+
return 2;
|
|
65
|
+
}, [block, isHorizontal]);
|
|
66
|
+
|
|
67
|
+
const handleOnPresChipItem = (isDisabled: boolean, item: ChipOptionProps) => {
|
|
68
|
+
!isDisabled && handleSelect(item.value);
|
|
69
|
+
onPress?.(item.value);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<FlatList
|
|
74
|
+
data={options}
|
|
75
|
+
renderItem={({ item }) => (
|
|
76
|
+
<ChipItem
|
|
77
|
+
item={item}
|
|
78
|
+
isSelected={() => isSelected(item.value)}
|
|
79
|
+
color={color}
|
|
80
|
+
block={block}
|
|
81
|
+
onPress={handleOnPresChipItem}
|
|
82
|
+
size={size}
|
|
83
|
+
renderItem={renderItem}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
keyExtractor={(item) => String(item.value)}
|
|
87
|
+
horizontal={isHorizontal}
|
|
88
|
+
onRefresh={onRefresh}
|
|
89
|
+
refreshing={refreshing}
|
|
90
|
+
scrollEnabled={scrollable}
|
|
91
|
+
keyboardShouldPersistTaps="always"
|
|
92
|
+
numColumns={numColumns}
|
|
93
|
+
contentContainerStyle={[
|
|
94
|
+
styles.container,
|
|
95
|
+
{
|
|
96
|
+
flexDirection: isHorizontal ? 'row' : 'column',
|
|
97
|
+
alignItems: block ? 'stretch' : 'flex-start',
|
|
98
|
+
},
|
|
99
|
+
]}
|
|
100
|
+
columnWrapperStyle={
|
|
101
|
+
numColumns > 1 ? { gap: 8, flexWrap: 'wrap' } : undefined
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
gap: 8,
|
|
110
|
+
},
|
|
111
|
+
chip: {
|
|
112
|
+
borderRadius: 8,
|
|
113
|
+
borderWidth: 1,
|
|
114
|
+
alignSelf: 'flex-start',
|
|
115
|
+
},
|
|
116
|
+
chipSmall: {
|
|
117
|
+
paddingVertical: 4,
|
|
118
|
+
paddingHorizontal: 8,
|
|
119
|
+
},
|
|
120
|
+
chipMedium: {
|
|
121
|
+
paddingVertical: 8,
|
|
122
|
+
paddingHorizontal: 12,
|
|
123
|
+
},
|
|
124
|
+
chipLarge: {
|
|
125
|
+
paddingVertical: 12,
|
|
126
|
+
paddingHorizontal: 16,
|
|
127
|
+
},
|
|
128
|
+
blockChip: {
|
|
129
|
+
width: '100%',
|
|
130
|
+
alignSelf: 'stretch',
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export default Chip;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Pressable, StyleSheet, type ViewStyle } from 'react-native';
|
|
2
|
+
import Typography from '../Typography/Typography';
|
|
3
|
+
import { CHIP_COLOR_MAP, type ChipItem, type ChipOptionProps } from './type';
|
|
4
|
+
import type { ColorVariantType } from '../Color/type';
|
|
5
|
+
|
|
6
|
+
export default function ChipItem({
|
|
7
|
+
item,
|
|
8
|
+
isSelected,
|
|
9
|
+
color = 'default',
|
|
10
|
+
block,
|
|
11
|
+
size,
|
|
12
|
+
renderItem,
|
|
13
|
+
isHorizontal,
|
|
14
|
+
onPress,
|
|
15
|
+
}: ChipItem) {
|
|
16
|
+
const validColors: ColorVariantType[] = [
|
|
17
|
+
'default',
|
|
18
|
+
'success',
|
|
19
|
+
'danger',
|
|
20
|
+
'primary',
|
|
21
|
+
'warning',
|
|
22
|
+
'info',
|
|
23
|
+
'purple',
|
|
24
|
+
'orange',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const safeColor = validColors.includes(color) ? color : 'default';
|
|
28
|
+
const colors = CHIP_COLOR_MAP[safeColor];
|
|
29
|
+
|
|
30
|
+
const selectedState = isSelected(item.value ? true : false);
|
|
31
|
+
const isDisabled = item.disabled ?? false;
|
|
32
|
+
|
|
33
|
+
const dynamicStyle: ViewStyle = {
|
|
34
|
+
borderColor: colors.borderColor,
|
|
35
|
+
backgroundColor: colors.backgroundColor,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if (selectedState) {
|
|
39
|
+
dynamicStyle.borderColor = colors.selectedBorderColor;
|
|
40
|
+
dynamicStyle.backgroundColor = colors.selectedBackgroundColor;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isDisabled) {
|
|
44
|
+
dynamicStyle.borderColor = colors.disabledBorderColor;
|
|
45
|
+
dynamicStyle.backgroundColor = colors.disabledBackgroundColor;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const isBlockMode = block && !isHorizontal;
|
|
49
|
+
|
|
50
|
+
const getSizeStyle = () => {
|
|
51
|
+
switch (size) {
|
|
52
|
+
case 'small':
|
|
53
|
+
return styles.chipSmall;
|
|
54
|
+
case 'large':
|
|
55
|
+
return styles.chipLarge;
|
|
56
|
+
case 'medium':
|
|
57
|
+
default:
|
|
58
|
+
return styles.chipMedium;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const handleOnPres = (disabled: boolean, val: ChipOptionProps) => {
|
|
63
|
+
onPress?.(disabled, val);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Pressable
|
|
68
|
+
key={item.value}
|
|
69
|
+
style={[
|
|
70
|
+
styles.chip,
|
|
71
|
+
getSizeStyle(),
|
|
72
|
+
dynamicStyle,
|
|
73
|
+
isBlockMode && styles.blockChip,
|
|
74
|
+
]}
|
|
75
|
+
onPress={() => handleOnPres(isDisabled, item)}
|
|
76
|
+
disabled={isDisabled}
|
|
77
|
+
>
|
|
78
|
+
{renderItem ? (
|
|
79
|
+
renderItem(item, selectedState, isDisabled)
|
|
80
|
+
) : (
|
|
81
|
+
<Typography
|
|
82
|
+
variant="t2"
|
|
83
|
+
style={{
|
|
84
|
+
fontSize: size === 'small' ? 12 : size === 'large' ? 16 : 14,
|
|
85
|
+
color: isDisabled
|
|
86
|
+
? colors.disabledTextColor
|
|
87
|
+
: selectedState
|
|
88
|
+
? colors.selectedTextColor
|
|
89
|
+
: colors.textColor,
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
{item.label}
|
|
93
|
+
</Typography>
|
|
94
|
+
)}
|
|
95
|
+
</Pressable>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
container: {
|
|
101
|
+
gap: 8,
|
|
102
|
+
},
|
|
103
|
+
chip: {
|
|
104
|
+
borderRadius: 8,
|
|
105
|
+
borderWidth: 1,
|
|
106
|
+
alignSelf: 'flex-start',
|
|
107
|
+
},
|
|
108
|
+
chipSmall: {
|
|
109
|
+
paddingVertical: 4,
|
|
110
|
+
paddingHorizontal: 8,
|
|
111
|
+
},
|
|
112
|
+
chipMedium: {
|
|
113
|
+
paddingVertical: 8,
|
|
114
|
+
paddingHorizontal: 12,
|
|
115
|
+
},
|
|
116
|
+
chipLarge: {
|
|
117
|
+
paddingVertical: 12,
|
|
118
|
+
paddingHorizontal: 16,
|
|
119
|
+
},
|
|
120
|
+
blockChip: {
|
|
121
|
+
width: '100%',
|
|
122
|
+
alignSelf: 'stretch',
|
|
123
|
+
},
|
|
124
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 📦 Komponen `Chip` – React Native
|
|
2
|
+
|
|
3
|
+
Komponen `Chip` digunakan untuk menampilkan daftar pilihan seperti tag, filter, atau kategori dalam bentuk tombol kecil (chip). Komponen ini mendukung pilihan tunggal maupun jamak, arah horizontal/vertikal, dan gaya warna yang dapat disesuaikan.
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🔧 Props
|
|
9
|
+
|
|
10
|
+
| Nama Props | Tipe | Default | Deskripsi |
|
|
11
|
+
|------------------|----------------------------------------------|----------------|--------------------------------------------------------------------------|
|
|
12
|
+
| `options` | `ChipOption[]` | – | Daftar opsi yang akan ditampilkan. Setiap opsi memiliki `label`, `value`, dan opsional `disabled`. |
|
|
13
|
+
| `selected` | `string \| string[] \| null \| undefined` | `[]` | Nilai yang dipilih. Bisa berupa string (single), array (multiple), atau null. |
|
|
14
|
+
| `onSelect` | `(value: string \| string[]) => void` | – | Fungsi callback saat chip dipilih. Akan mengembalikan value terpilih. |
|
|
15
|
+
| `multiple` | `boolean` | `false` | Jika `true`, bisa memilih lebih dari satu chip. |
|
|
16
|
+
| `direction` | `'horizontal' \| 'vertical'` | `'horizontal'` | Arah layout chip: horizontal (dalam baris) atau vertical (ke bawah). |
|
|
17
|
+
| `scrollable` | `boolean` | `true` (horizontal) / `false` (vertical) | Apakah chip bisa digulir (scroll) saat melebihi lebar/tinggi. |
|
|
18
|
+
| `block` | `boolean` | `false` | Jika `true` dan `direction='vertical'`, maka chip akan memenuhi lebar kontainer (full width). |
|
|
19
|
+
| `color` | `'default' \| 'success' \| 'danger' \| 'primary' \| 'warning' \| 'info' \| 'orange' \| 'purple'` | `'default'` | Warna tema chip. |
|
|
20
|
+
| `renderItem` | `(item, isSelected, isDisabled) => ReactNode`| – | Jika ingin custom tampilan chip secara manual. |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 🧪 Contoh Penggunaan
|
|
25
|
+
|
|
26
|
+
### Single Select Horizontal (default)
|
|
27
|
+
```tsx
|
|
28
|
+
<Chip
|
|
29
|
+
options={[
|
|
30
|
+
{ label: 'A', value: 'a' },
|
|
31
|
+
{ label: 'B', value: 'b' },
|
|
32
|
+
]}
|
|
33
|
+
selected="a"
|
|
34
|
+
onSelect={val => console.log(val)}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Multiple Select Vertical Block
|
|
39
|
+
```tsx
|
|
40
|
+
<Chip
|
|
41
|
+
options={[
|
|
42
|
+
{ label: 'One', value: '1' },
|
|
43
|
+
{ label: 'Two', value: '2' },
|
|
44
|
+
]}
|
|
45
|
+
selected={['1']}
|
|
46
|
+
onSelect={val => console.log(val)}
|
|
47
|
+
multiple
|
|
48
|
+
direction="vertical"
|
|
49
|
+
block
|
|
50
|
+
scrollable={false}
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🎨 Warna yang Didukung
|
|
57
|
+
|
|
58
|
+
- `default`
|
|
59
|
+
- `success`
|
|
60
|
+
- `danger`
|
|
61
|
+
- `primary`
|
|
62
|
+
- `warning`
|
|
63
|
+
- `info`
|
|
64
|
+
- `orange`
|
|
65
|
+
- `purple`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 📂 Tipe `ChipOption`
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
interface ChipOption {
|
|
73
|
+
label: string;
|
|
74
|
+
value: string;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 🧩 Catatan
|
|
82
|
+
|
|
83
|
+
- Jika `multiple = false`, maka `onSelect` mengembalikan satu string.
|
|
84
|
+
- Jika `multiple = true`, maka `onSelect` mengembalikan array string.
|
|
85
|
+
- `block` hanya berfungsi bila arah `vertical`.
|
|
86
|
+
- gunakan scrollable = false jika ingin membungkus di ScrollView
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
© 2025 – Komponen Chip by YourTeam
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { ColorValue } from 'react-native';
|
|
2
|
+
import Color from '../Color/Color';
|
|
3
|
+
import type { ColorVariantType } from '../Color/type';
|
|
4
|
+
|
|
5
|
+
export const CHIP_COLOR_MAP: Record<
|
|
6
|
+
ColorVariantType,
|
|
7
|
+
{
|
|
8
|
+
backgroundColor: ColorValue;
|
|
9
|
+
textColor: ColorValue;
|
|
10
|
+
borderColor: ColorValue;
|
|
11
|
+
selectedBackgroundColor: ColorValue;
|
|
12
|
+
selectedBorderColor: ColorValue;
|
|
13
|
+
selectedTextColor: ColorValue;
|
|
14
|
+
disabledBackgroundColor: ColorValue;
|
|
15
|
+
disabledBorderColor: ColorValue;
|
|
16
|
+
disabledTextColor: ColorValue;
|
|
17
|
+
}
|
|
18
|
+
> = {
|
|
19
|
+
default: {
|
|
20
|
+
backgroundColor: Color.gray[600],
|
|
21
|
+
textColor: Color.base.white100,
|
|
22
|
+
borderColor: Color.gray[600],
|
|
23
|
+
selectedBackgroundColor: Color.gray[600],
|
|
24
|
+
selectedBorderColor: Color.gray[200],
|
|
25
|
+
selectedTextColor: Color.gray[200],
|
|
26
|
+
disabledBackgroundColor: Color.gray[600],
|
|
27
|
+
disabledBorderColor: Color.gray[200],
|
|
28
|
+
disabledTextColor: Color.gray[200],
|
|
29
|
+
},
|
|
30
|
+
success: {
|
|
31
|
+
backgroundColor: Color.base.white100,
|
|
32
|
+
textColor: Color.success[900],
|
|
33
|
+
borderColor: Color.success[200],
|
|
34
|
+
selectedBackgroundColor: Color.success[50],
|
|
35
|
+
selectedBorderColor: Color.success[200],
|
|
36
|
+
selectedTextColor: Color.success[900],
|
|
37
|
+
disabledBackgroundColor: Color.success[100],
|
|
38
|
+
disabledBorderColor: Color.success[100],
|
|
39
|
+
disabledTextColor: Color.base.white100,
|
|
40
|
+
},
|
|
41
|
+
danger: {
|
|
42
|
+
backgroundColor: Color.base.white100,
|
|
43
|
+
textColor: Color.danger[900],
|
|
44
|
+
borderColor: Color.danger[200],
|
|
45
|
+
selectedBackgroundColor: Color.danger[50],
|
|
46
|
+
selectedBorderColor: Color.danger[200],
|
|
47
|
+
selectedTextColor: Color.danger[900],
|
|
48
|
+
disabledBackgroundColor: Color.danger[100],
|
|
49
|
+
disabledBorderColor: Color.danger[100],
|
|
50
|
+
disabledTextColor: Color.base.white100,
|
|
51
|
+
},
|
|
52
|
+
primary: {
|
|
53
|
+
backgroundColor: Color.base.white100,
|
|
54
|
+
textColor: Color.primary[1000],
|
|
55
|
+
borderColor: Color.primary[200],
|
|
56
|
+
selectedBackgroundColor: Color.primary[50],
|
|
57
|
+
selectedBorderColor: Color.primary[200],
|
|
58
|
+
selectedTextColor: Color.primary[1000],
|
|
59
|
+
disabledBackgroundColor: Color.primary[100],
|
|
60
|
+
disabledBorderColor: Color.primary[100],
|
|
61
|
+
disabledTextColor: Color.base.white100,
|
|
62
|
+
},
|
|
63
|
+
warning: {
|
|
64
|
+
backgroundColor: Color.base.white100,
|
|
65
|
+
textColor: Color.warning[900],
|
|
66
|
+
borderColor: Color.warning[200],
|
|
67
|
+
selectedBackgroundColor: Color.warning[50],
|
|
68
|
+
selectedBorderColor: Color.warning[200],
|
|
69
|
+
selectedTextColor: Color.warning[900],
|
|
70
|
+
disabledBackgroundColor: Color.warning[100],
|
|
71
|
+
disabledBorderColor: Color.warning[100],
|
|
72
|
+
disabledTextColor: Color.base.white100,
|
|
73
|
+
},
|
|
74
|
+
info: {
|
|
75
|
+
backgroundColor: Color.base.white100,
|
|
76
|
+
textColor: Color.info[900],
|
|
77
|
+
borderColor: Color.info[200],
|
|
78
|
+
selectedBackgroundColor: Color.info[50],
|
|
79
|
+
selectedBorderColor: Color.info[200],
|
|
80
|
+
selectedTextColor: Color.info[900],
|
|
81
|
+
disabledBackgroundColor: Color.info[100],
|
|
82
|
+
disabledBorderColor: Color.info[100],
|
|
83
|
+
disabledTextColor: Color.base.white100,
|
|
84
|
+
},
|
|
85
|
+
orange: {
|
|
86
|
+
backgroundColor: Color.base.white100,
|
|
87
|
+
textColor: Color.orange[900],
|
|
88
|
+
borderColor: Color.orange[200],
|
|
89
|
+
selectedBackgroundColor: Color.orange[50],
|
|
90
|
+
selectedBorderColor: Color.orange[200],
|
|
91
|
+
selectedTextColor: Color.orange[900],
|
|
92
|
+
disabledBackgroundColor: Color.orange[100],
|
|
93
|
+
disabledBorderColor: Color.orange[100],
|
|
94
|
+
disabledTextColor: Color.base.white100,
|
|
95
|
+
},
|
|
96
|
+
purple: {
|
|
97
|
+
backgroundColor: Color.base.white100,
|
|
98
|
+
textColor: Color.purple[900],
|
|
99
|
+
borderColor: Color.purple[200],
|
|
100
|
+
selectedBackgroundColor: Color.purple[50],
|
|
101
|
+
selectedBorderColor: Color.purple[200],
|
|
102
|
+
selectedTextColor: Color.purple[900],
|
|
103
|
+
disabledBackgroundColor: Color.purple[100],
|
|
104
|
+
disabledBorderColor: Color.purple[100],
|
|
105
|
+
disabledTextColor: Color.base.white100,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export interface ChipOptionProps {
|
|
110
|
+
label: string | number;
|
|
111
|
+
value: string | number;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
[key: string]: string | number | boolean | undefined;
|
|
114
|
+
}
|
|
115
|
+
export type ChipValue = number | string | null | undefined | boolean;
|
|
116
|
+
|
|
117
|
+
export type ChipSelectedProps = ChipValue[];
|
|
118
|
+
|
|
119
|
+
export type ChipSizeProps = 'small' | 'medium' | 'large';
|
|
120
|
+
export type ChipRenderItemFn = (
|
|
121
|
+
item: ChipOptionProps,
|
|
122
|
+
selected: boolean,
|
|
123
|
+
disabled: boolean
|
|
124
|
+
) => React.ReactNode;
|
|
125
|
+
|
|
126
|
+
export type ChipOnSelectProps = (value: ChipSelectedProps) => void;
|
|
127
|
+
|
|
128
|
+
export interface ChipItem {
|
|
129
|
+
item: ChipOptionProps;
|
|
130
|
+
color?: ColorVariantType;
|
|
131
|
+
block?: boolean;
|
|
132
|
+
isSelected: (value: boolean) => boolean;
|
|
133
|
+
size?: ChipSizeProps;
|
|
134
|
+
renderItem?: ChipRenderItemFn;
|
|
135
|
+
isHorizontal?: boolean;
|
|
136
|
+
onPress?: (isDisabled: boolean, value: ChipOptionProps) => void;
|
|
137
|
+
}
|
|
138
|
+
export interface ChipProps {
|
|
139
|
+
options: ChipOptionProps[];
|
|
140
|
+
selected?: ChipSelectedProps;
|
|
141
|
+
onSelect?: ChipOnSelectProps;
|
|
142
|
+
onPress?: (value: string | number | undefined | null) => void;
|
|
143
|
+
direction?: 'horizontal' | 'vertical';
|
|
144
|
+
scrollable?: boolean;
|
|
145
|
+
block?: boolean;
|
|
146
|
+
multiple?: boolean;
|
|
147
|
+
color?: ColorVariantType;
|
|
148
|
+
size?: ChipSizeProps;
|
|
149
|
+
renderItem?: ChipRenderItemFn;
|
|
150
|
+
onRefresh?: () => void;
|
|
151
|
+
refreshing?: boolean;
|
|
152
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const Color = {
|
|
2
|
+
base: {
|
|
3
|
+
white100: '#FFFFFF',
|
|
4
|
+
white60: 'rgba(255, 255, 255, 0.6)',
|
|
5
|
+
black100: '#282828',
|
|
6
|
+
black60: 'rgba(40, 40, 40, 0.6)',
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
gray: {
|
|
10
|
+
50: '#F7F7F7',
|
|
11
|
+
100: '#F2F2F2',
|
|
12
|
+
200: '#EBEBEB',
|
|
13
|
+
300: '#E5E5E5',
|
|
14
|
+
400: '#DEDEDE',
|
|
15
|
+
500: '#D7D7D7',
|
|
16
|
+
600: '#B4B4B4',
|
|
17
|
+
700: '#909090',
|
|
18
|
+
800: '#6C6C6C',
|
|
19
|
+
900: '#484848',
|
|
20
|
+
950: '#2B2B2B',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
primary: {
|
|
24
|
+
50: '#F1F2FF',
|
|
25
|
+
100: '#E6E8FF',
|
|
26
|
+
200: '#D0D5FF',
|
|
27
|
+
300: '#ABB1FF',
|
|
28
|
+
400: '#7B7EFF',
|
|
29
|
+
500: '#4D46FF',
|
|
30
|
+
600: '#3421FF',
|
|
31
|
+
700: '#250FF2',
|
|
32
|
+
800: '#1E0CCB',
|
|
33
|
+
900: '#1B0CA6',
|
|
34
|
+
950: '#14087D',
|
|
35
|
+
1000: '#080355',
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
warning: {
|
|
39
|
+
50: '#FFFAEB',
|
|
40
|
+
100: '#FEF0C7',
|
|
41
|
+
200: '#FEDF89',
|
|
42
|
+
300: '#FEC84B',
|
|
43
|
+
400: '#FDB022',
|
|
44
|
+
500: '#F79009',
|
|
45
|
+
600: '#DC6803',
|
|
46
|
+
700: '#B54708',
|
|
47
|
+
800: '#93370D',
|
|
48
|
+
900: '#7A2E0E',
|
|
49
|
+
950: '#6B2508',
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
danger: {
|
|
53
|
+
50: '#FEF3F2',
|
|
54
|
+
100: '#FEE4E2',
|
|
55
|
+
200: '#FECDCA',
|
|
56
|
+
300: '#FDA29B',
|
|
57
|
+
400: '#F97066',
|
|
58
|
+
500: '#F04438',
|
|
59
|
+
600: '#D92D20',
|
|
60
|
+
700: '#B42318',
|
|
61
|
+
800: '#912018',
|
|
62
|
+
900: '#7A271A',
|
|
63
|
+
950: '#66180C',
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
success: {
|
|
67
|
+
50: '#E5FFE8',
|
|
68
|
+
100: '#CEFBD4',
|
|
69
|
+
200: '#9EF7B3',
|
|
70
|
+
300: '#6BE995',
|
|
71
|
+
400: '#44D382',
|
|
72
|
+
500: '#12B76A',
|
|
73
|
+
600: '#0D9D68',
|
|
74
|
+
700: '#098363',
|
|
75
|
+
800: '#056A59',
|
|
76
|
+
900: '#035752',
|
|
77
|
+
950: '#034C48',
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
info: {
|
|
81
|
+
50: '#E6FBFF',
|
|
82
|
+
100: '#CDF8FF',
|
|
83
|
+
200: '#9DEBFF',
|
|
84
|
+
300: '#6CD8FF',
|
|
85
|
+
400: '#48C5FF',
|
|
86
|
+
500: '#0CA2FF',
|
|
87
|
+
600: '#077EDA',
|
|
88
|
+
700: '#065EB7',
|
|
89
|
+
800: '#012F7A',
|
|
90
|
+
900: '#012F7A',
|
|
91
|
+
950: '#052B69',
|
|
92
|
+
},
|
|
93
|
+
orange: {
|
|
94
|
+
50: '#FFFBED',
|
|
95
|
+
100: '#FFF7D4',
|
|
96
|
+
200: '#FFEBA8',
|
|
97
|
+
300: '#FFDA71',
|
|
98
|
+
400: '#FFBF38',
|
|
99
|
+
500: '#FDA712',
|
|
100
|
+
600: '#F79009',
|
|
101
|
+
700: '#C56A09',
|
|
102
|
+
800: '#9D530F',
|
|
103
|
+
900: '#7E4510',
|
|
104
|
+
950: '#442106',
|
|
105
|
+
},
|
|
106
|
+
purple: {
|
|
107
|
+
50: '#eeefff',
|
|
108
|
+
100: '#e0e2ff',
|
|
109
|
+
200: '#c8c9fd',
|
|
110
|
+
300: '#a6a6fb',
|
|
111
|
+
400: '#8c82f7',
|
|
112
|
+
500: '#7761ef',
|
|
113
|
+
600: '#6c48e3',
|
|
114
|
+
700: '#5d3ac8',
|
|
115
|
+
800: '#4c31a2',
|
|
116
|
+
900: '#402f80',
|
|
117
|
+
950: '#261c4a',
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
divider: {
|
|
121
|
+
25: 'rgba(40, 40, 40, 0.12)',
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
disabled: {
|
|
125
|
+
25: 'rgba(40, 40, 40, 0.12)',
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
shadow: {
|
|
129
|
+
// kamu bisa tambahkan shadow warna di sini jika ada
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export default Color;
|