@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,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Image, Text, StyleSheet } from 'react-native';
|
|
4
|
+
import { Icon } from "../Icon/index.js";
|
|
5
|
+
import Color from "../Color/Color.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const SIZE_MAP = {
|
|
8
|
+
small: 30,
|
|
9
|
+
medium: 40,
|
|
10
|
+
large: 50
|
|
11
|
+
};
|
|
12
|
+
const AvatarGroup = ({
|
|
13
|
+
avatars = [],
|
|
14
|
+
maxVisible = 5,
|
|
15
|
+
size = 'medium'
|
|
16
|
+
}) => {
|
|
17
|
+
const avatarSize = SIZE_MAP[size] || SIZE_MAP.medium;
|
|
18
|
+
const visibleAvatars = avatars.slice(0, maxVisible);
|
|
19
|
+
const remainingCount = avatars.length - maxVisible;
|
|
20
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
21
|
+
style: [styles.container, {
|
|
22
|
+
height: avatarSize
|
|
23
|
+
}],
|
|
24
|
+
children: [visibleAvatars.map((avatar, index) => {
|
|
25
|
+
const hasImage = avatar.source;
|
|
26
|
+
const initials = avatar.name;
|
|
27
|
+
const styleSize = {
|
|
28
|
+
width: avatarSize,
|
|
29
|
+
height: avatarSize,
|
|
30
|
+
borderRadius: avatarSize / 2
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/_jsx(View, {
|
|
33
|
+
style: [styles.avatarWrapper, {
|
|
34
|
+
left: index * (avatarSize * 0.6),
|
|
35
|
+
zIndex: avatars.length - index
|
|
36
|
+
}],
|
|
37
|
+
children: hasImage ? /*#__PURE__*/_jsx(Image, {
|
|
38
|
+
source: avatar.source,
|
|
39
|
+
style: [styles.avatar, styleSize]
|
|
40
|
+
}) : initials ? /*#__PURE__*/_jsx(View, {
|
|
41
|
+
style: [styles.initialWrapper, styleSize],
|
|
42
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
43
|
+
style: [styles.initialText, {
|
|
44
|
+
fontSize: avatarSize * 0.4
|
|
45
|
+
}],
|
|
46
|
+
children: initials
|
|
47
|
+
})
|
|
48
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
49
|
+
style: [styles.iconWrapper, styleSize],
|
|
50
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
51
|
+
name: "User",
|
|
52
|
+
color: Color.base.white100
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
}, index);
|
|
56
|
+
}), remainingCount > 0 && /*#__PURE__*/_jsx(View, {
|
|
57
|
+
style: [styles.avatarWrapper, {
|
|
58
|
+
left: visibleAvatars.length * (avatarSize * 0.6),
|
|
59
|
+
zIndex: 0
|
|
60
|
+
}],
|
|
61
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
62
|
+
style: [styles.remaining, {
|
|
63
|
+
width: avatarSize,
|
|
64
|
+
height: avatarSize,
|
|
65
|
+
borderRadius: avatarSize / 2
|
|
66
|
+
}],
|
|
67
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
68
|
+
style: [styles.remainingText, {
|
|
69
|
+
fontSize: avatarSize * 0.4
|
|
70
|
+
}],
|
|
71
|
+
children: ["+", remainingCount]
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const styles = StyleSheet.create({
|
|
78
|
+
container: {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
position: 'relative'
|
|
81
|
+
},
|
|
82
|
+
avatarWrapper: {
|
|
83
|
+
position: 'absolute'
|
|
84
|
+
},
|
|
85
|
+
avatar: {
|
|
86
|
+
borderWidth: 2,
|
|
87
|
+
borderColor: Color.base.white100
|
|
88
|
+
},
|
|
89
|
+
initialWrapper: {
|
|
90
|
+
backgroundColor: Color.gray[400],
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
borderWidth: 2,
|
|
94
|
+
borderColor: Color.base.white100
|
|
95
|
+
},
|
|
96
|
+
iconWrapper: {
|
|
97
|
+
backgroundColor: Color.gray[400],
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
borderWidth: 2,
|
|
101
|
+
borderColor: Color.base.white100
|
|
102
|
+
},
|
|
103
|
+
initialText: {
|
|
104
|
+
color: Color.base.white100,
|
|
105
|
+
fontWeight: 'bold'
|
|
106
|
+
},
|
|
107
|
+
remaining: {
|
|
108
|
+
backgroundColor: Color.gray[400],
|
|
109
|
+
justifyContent: 'center',
|
|
110
|
+
alignItems: 'center'
|
|
111
|
+
},
|
|
112
|
+
remainingText: {
|
|
113
|
+
color: Color.base.white100,
|
|
114
|
+
fontWeight: 'bold'
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export default AvatarGroup;
|
|
118
|
+
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Image","Text","StyleSheet","Icon","Color","jsx","_jsx","jsxs","_jsxs","SIZE_MAP","small","medium","large","AvatarGroup","avatars","maxVisible","size","avatarSize","visibleAvatars","slice","remainingCount","length","style","styles","container","height","children","map","avatar","index","hasImage","source","initials","name","styleSize","width","borderRadius","avatarWrapper","left","zIndex","initialWrapper","initialText","fontSize","iconWrapper","color","base","white100","remaining","remainingText","create","flexDirection","position","borderWidth","borderColor","backgroundColor","gray","justifyContent","alignItems","fontWeight"],"sourceRoot":"../../../src","sources":["Avatar/AvatarGroup.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC5D,SAASC,IAAI,QAAQ,kBAAS;AAC9B,OAAOC,KAAK,MAAM,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGnC,MAAMC,QAAwC,GAAG;EAC/CC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,WAAuC,GAAGA,CAAC;EAC/CC,OAAO,GAAG,EAAE;EACZC,UAAU,GAAG,CAAC;EACdC,IAAI,GAAG;AACT,CAAC,KAAK;EACJ,MAAMC,UAAU,GAAGR,QAAQ,CAACO,IAAI,CAAC,IAAIP,QAAQ,CAACE,MAAM;EACpD,MAAMO,cAAc,GAAGJ,OAAO,CAACK,KAAK,CAAC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ChCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBL,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEjD,KAAK,CAACyC,IAAI,CAACC;EAC1B,CAAC;EACDH,WAAW,EAAE;IACXW,eAAe,EAAElD,KAAK,CAACmD,IAAI,CAAC,GAAG,CAAC;IAChCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBL,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEjD,KAAK,CAACyC,IAAI,CAACC;EAC1B,CAAC;EACDL,WAAW,EAAE;IACXG,KAAK,EAAExC,KAAK,CAACyC,IAAI,CAACC,QAAQ;IAC1BY,UAAU,EAAE;EACd,CAAC;EACDX,SAAS,EAAE;IACTO,eAAe,EAAElD,KAAK,CAACmD,IAAI,CAAC,GAAG,CAAC;IAChCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDT,aAAa,EAAE;IACbJ,KAAK,EAAExC,KAAK,CAACyC,IAAI,CAACC,QAAQ;IAC1BY,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAe7C,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 🧑🎨 Avatar Component
|
|
2
|
+
|
|
3
|
+
Komponen `Avatar` digunakan untuk menampilkan foto pengguna atau inisial nama jika foto tidak tersedia.
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
## ✨ Fitur
|
|
7
|
+
|
|
8
|
+
- Menampilkan gambar avatar dari `Image source`
|
|
9
|
+
- Menampilkan inisial nama jika gambar tidak tersedia
|
|
10
|
+
- Mendukung tiga ukuran: kecil, sedang, besar
|
|
11
|
+
- Warna latar dan teks dapat dikustomisasi
|
|
12
|
+
|
|
13
|
+
## 🧱 Props
|
|
14
|
+
|
|
15
|
+
| Prop | Tipe | Default | Deskripsi |
|
|
16
|
+
|-----------------|-------------------------|-------------|-------------------------------------------------------------------------|
|
|
17
|
+
| `size` | `'small'` \| `'medium'` \| `'large'` | `'medium'` | Ukuran avatar |
|
|
18
|
+
| `source` | `ImageSourcePropType` | `undefined` | Sumber gambar avatar |
|
|
19
|
+
| `name` | `string` | `undefined` | Digunakan untuk menampilkan inisial jika `source` tidak tersedia |
|
|
20
|
+
| `backgroundColor` | `string` | `'#ccc'` | Warna latar belakang jika tanpa gambar |
|
|
21
|
+
| `textColor` | `string` | `'#fff'` | Warna teks inisial jika tanpa gambar |
|
|
22
|
+
| `style` | `ViewStyle` | `undefined` | Gaya tambahan untuk container |
|
|
23
|
+
|
|
24
|
+
## 📏 Ukuran Avatar
|
|
25
|
+
|
|
26
|
+
| Ukuran | Nilai pixel |
|
|
27
|
+
|---------|-------------|
|
|
28
|
+
| small | 30 |
|
|
29
|
+
| medium | 40 |
|
|
30
|
+
| large | 50 |
|
|
31
|
+
|
|
32
|
+
## 🧪 Contoh Penggunaan
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import React from 'react';
|
|
36
|
+
import Avatar from './Avatar'; // sesuaikan path
|
|
37
|
+
|
|
38
|
+
export default function ProfileHeader() {
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
{/* Dengan gambar */}
|
|
42
|
+
<Avatar
|
|
43
|
+
size="large"
|
|
44
|
+
source={{ uri: 'https://example.com/profile.jpg' }}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
{/* Tanpa gambar, menggunakan nama */}
|
|
48
|
+
<Avatar
|
|
49
|
+
size="medium"
|
|
50
|
+
name="SR"
|
|
51
|
+
backgroundColor="#1E88E5"
|
|
52
|
+
textColor="#fff"
|
|
53
|
+
/>
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
# AvatarGroup Component (React Native)
|
|
3
|
+
|
|
4
|
+
The `AvatarGroup` component displays a group of user avatars. It supports image avatars, initials-based avatars, and a fallback icon. If there are more avatars than the maximum visible count, it displays a "+X" bubble.
|
|
5
|
+

|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 📦 Props
|
|
9
|
+
|
|
10
|
+
### `AvatarGroupProps`
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|--------------|-------------------------------------|-----------|--------------------------------------------------|
|
|
14
|
+
| `avatars` | `AvatarProps[]` | `[]` | Array of avatar objects. |
|
|
15
|
+
| `maxVisible` | `number` | `5` | Max number of avatars to display. |
|
|
16
|
+
| `size` | `'small' | 'medium' | 'large'` | `'medium'` | Size of avatars. |
|
|
17
|
+
|
|
18
|
+
### `AvatarProps`
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Description |
|
|
21
|
+
|-----------------|-----------------------|-----------------------------------------------------|
|
|
22
|
+
| `size` | `'small' | 'medium' | 'large'` | Size of individual avatar (optional). |
|
|
23
|
+
| `source` | `ImageSourcePropType` | Image source for avatar. |
|
|
24
|
+
| `name` | `string` | Initials to show if image is not available. |
|
|
25
|
+
| `backgroundColor` | `string` | Background color for initials or icon avatar. |
|
|
26
|
+
| `textColor` | `string` | Color of the initials text. |
|
|
27
|
+
| `style` | `object` | Additional style for individual avatar container. |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🖼️ Example Usage
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import AvatarGroup from './AvatarGroup';
|
|
35
|
+
|
|
36
|
+
const teamMembers = [
|
|
37
|
+
{ name: 'JS', backgroundColor: '#3498db' },
|
|
38
|
+
{ name: 'EM', source: require('./assets/emily.png') },
|
|
39
|
+
{ name: 'RS' },
|
|
40
|
+
{ name: 'AB', textColor: '#fff' },
|
|
41
|
+
{ name: 'ZK' },
|
|
42
|
+
{ name: 'XY' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
<AvatarGroup avatars={teamMembers} maxVisible={4} size="small" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🎨 Avatar Sizes
|
|
51
|
+
|
|
52
|
+
| Size | Dimension (px) |
|
|
53
|
+
|---------|----------------|
|
|
54
|
+
| small | 30 |
|
|
55
|
+
| medium | 40 |
|
|
56
|
+
| large | 50 |
|
|
57
|
+
|
|
58
|
+
---
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["Avatar/type.tsx"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import Color from "../Color/Color.js";
|
|
6
|
+
import Typography from "../Typography/Typography.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const COLORS = {
|
|
9
|
+
default: {
|
|
10
|
+
background: Color.gray[100],
|
|
11
|
+
fontColor: Color.gray[800]
|
|
12
|
+
},
|
|
13
|
+
primary: {
|
|
14
|
+
background: Color.primary[50],
|
|
15
|
+
fontColor: Color.primary[1000]
|
|
16
|
+
},
|
|
17
|
+
success: {
|
|
18
|
+
background: Color.success[50],
|
|
19
|
+
fontColor: Color.success[500]
|
|
20
|
+
},
|
|
21
|
+
info: {
|
|
22
|
+
background: Color.info[50],
|
|
23
|
+
fontColor: Color.info[500]
|
|
24
|
+
},
|
|
25
|
+
danger: {
|
|
26
|
+
background: Color.danger[50],
|
|
27
|
+
fontColor: Color.danger[600]
|
|
28
|
+
},
|
|
29
|
+
warning: {
|
|
30
|
+
background: Color.warning[50],
|
|
31
|
+
fontColor: Color.warning[300]
|
|
32
|
+
},
|
|
33
|
+
orange: {
|
|
34
|
+
background: Color.orange[50],
|
|
35
|
+
fontColor: Color.orange[500]
|
|
36
|
+
},
|
|
37
|
+
purple: {
|
|
38
|
+
background: Color.purple[50],
|
|
39
|
+
fontColor: Color.purple[500]
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const SIZE_MAP = {
|
|
43
|
+
small: {
|
|
44
|
+
height: 18,
|
|
45
|
+
fontSize: 't3',
|
|
46
|
+
paddingHorizontal: 4,
|
|
47
|
+
paddingVertical: 2,
|
|
48
|
+
borderRadius: 4
|
|
49
|
+
},
|
|
50
|
+
medium: {
|
|
51
|
+
height: 32,
|
|
52
|
+
fontSize: 't1',
|
|
53
|
+
paddingHorizontal: 10,
|
|
54
|
+
paddingVertical: 4,
|
|
55
|
+
borderRadius: 8
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const Badge = ({
|
|
59
|
+
value,
|
|
60
|
+
size = 'medium',
|
|
61
|
+
color = 'default',
|
|
62
|
+
dot = false,
|
|
63
|
+
children
|
|
64
|
+
}) => {
|
|
65
|
+
const safeSize = ['small', 'medium'].includes(size) ? size : 'medium';
|
|
66
|
+
const {
|
|
67
|
+
background,
|
|
68
|
+
fontColor
|
|
69
|
+
} = COLORS[color];
|
|
70
|
+
const {
|
|
71
|
+
height,
|
|
72
|
+
paddingHorizontal,
|
|
73
|
+
paddingVertical,
|
|
74
|
+
borderRadius
|
|
75
|
+
} = SIZE_MAP[safeSize];
|
|
76
|
+
if (dot) {
|
|
77
|
+
return /*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: [styles.dot, {
|
|
79
|
+
height: height,
|
|
80
|
+
paddingHorizontal: paddingHorizontal,
|
|
81
|
+
paddingVertical: paddingVertical,
|
|
82
|
+
borderRadius: borderRadius,
|
|
83
|
+
backgroundColor: background
|
|
84
|
+
}]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return /*#__PURE__*/_jsx(View, {
|
|
88
|
+
style: [styles.badge, {
|
|
89
|
+
height: height,
|
|
90
|
+
borderRadius: 8,
|
|
91
|
+
backgroundColor: background,
|
|
92
|
+
paddingHorizontal: paddingHorizontal,
|
|
93
|
+
paddingVertical: paddingVertical
|
|
94
|
+
}],
|
|
95
|
+
children: children ? children : /*#__PURE__*/_jsx(Typography, {
|
|
96
|
+
color: fontColor,
|
|
97
|
+
variant: SIZE_MAP[safeSize].fontSize,
|
|
98
|
+
weight: "medium",
|
|
99
|
+
children: value
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
const styles = StyleSheet.create({
|
|
104
|
+
badge: {
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
alignSelf: 'flex-start',
|
|
108
|
+
flexWrap: 'wrap'
|
|
109
|
+
},
|
|
110
|
+
text: {
|
|
111
|
+
fontWeight: 'bold',
|
|
112
|
+
textAlign: 'center'
|
|
113
|
+
},
|
|
114
|
+
dot: {
|
|
115
|
+
alignSelf: 'flex-start'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export default Badge;
|
|
119
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","Color","Typography","jsx","_jsx","COLORS","default","background","gray","fontColor","primary","success","info","danger","warning","orange","purple","SIZE_MAP","small","height","fontSize","paddingHorizontal","paddingVertical","borderRadius","medium","Badge","value","size","color","dot","children","safeSize","includes","style","styles","backgroundColor","badge","variant","weight","create","justifyContent","alignItems","alignSelf","flexWrap","text","fontWeight","textAlign"],"sourceRoot":"../../../src","sources":["Badge/Badge.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,OAAOC,KAAK,MAAM,mBAAgB;AAClC,OAAOC,UAAU,MAAM,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAuBlD,MAAMC,MAAkE,GAAG;EACzEC,OAAO,EAAE;IAAEC,UAAU,EAAEN,KAAK,CAACO,IAAI,CAAC,GAAG,CAAC;IAAEC,SAAS,EAAER,KAAK,CAACO,IAAI,CAAC,GAAG;EAAE,CAAC;EACpEE,OAAO,EAAE;IAAEH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AED,MAAMQ,MAAM,GAAGlC,UAAU,CAACuC,MAAM,CAAC;EAC/BH,KAAK,EAAE;IACLI,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,YAAY;IACvBC,QAAQ,EAAE;EACZ,CAAC;EACDC,IAAI,EAAE;IACJC,UAAU,EAAE,MAAM;IAClBC,SAAS,EAAE;EACb,CAAC;EACDjB,GAAG,EAAE;IACHa,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAejB,KAAK","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 🔖 Badge Component
|
|
2
|
+
|
|
3
|
+
Komponen `Badge` digunakan untuk menampilkan label kecil yang memberikan informasi tambahan seperti status atau notifikasi.
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
## ✨ Fitur
|
|
7
|
+
|
|
8
|
+
- Mendukung warna varian seperti success, warning, danger, dll
|
|
9
|
+
- Dua ukuran tersedia: `small` dan `medium`
|
|
10
|
+
- Mode `dot` untuk hanya menampilkan titik status kecil
|
|
11
|
+
- Bisa menggunakan `children` untuk isi kustom atau gunakan `value` sebagai isi teks
|
|
12
|
+
|
|
13
|
+
## 🧱 Props
|
|
14
|
+
|
|
15
|
+
| Prop | Tipe | Default | Deskripsi |
|
|
16
|
+
|------------|--------------------------------------|-------------|------------------------------------------------------------|
|
|
17
|
+
| `value` | `string \\| number \\| ReactNode` | `undefined` | Nilai yang ditampilkan di badge jika `children` tidak ada |
|
|
18
|
+
| `color` | `'default' \\| 'primary' \\| ...` | `'default'` | Warna badge |
|
|
19
|
+
| `size` | `'small'` \\| `'medium'` | `'medium'` | Ukuran badge |
|
|
20
|
+
| `dot` | `boolean` | `false` | Jika `true`, hanya menampilkan titik kecil |
|
|
21
|
+
| `children` | `React.ReactNode` | `undefined` | Jika ada, akan menggantikan `value` sebagai isi badge |
|
|
22
|
+
|
|
23
|
+
## 🎨 Warna yang Tersedia
|
|
24
|
+
|
|
25
|
+
- `default`
|
|
26
|
+
- `primary`
|
|
27
|
+
- `success`
|
|
28
|
+
- `info`
|
|
29
|
+
- `warning`
|
|
30
|
+
- `danger`
|
|
31
|
+
- `orange`
|
|
32
|
+
- `purple`
|
|
33
|
+
|
|
34
|
+
## 📏 Ukuran Badge
|
|
35
|
+
|
|
36
|
+
| Ukuran | Tinggi | Font | PaddingHorizontal | PaddingVertical | BorderRadius |
|
|
37
|
+
|--------|--------|----------|-------------------|------------------|---------------|
|
|
38
|
+
| small | 18 | `t3` | 4 | 2 | 4 |
|
|
39
|
+
| medium | 24 | `t1` | 10 | 4 | 8 |
|
|
40
|
+
|
|
41
|
+
## 📦 Contoh Penggunaan
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import React from 'react';
|
|
45
|
+
import Badge from './Badge'; // sesuaikan path
|
|
46
|
+
|
|
47
|
+
export default function Example() {
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
{/* Badge dengan value */}
|
|
51
|
+
<Badge color="success" value="Aktif" />
|
|
52
|
+
|
|
53
|
+
{/* Badge dengan dot */}
|
|
54
|
+
<Badge color="danger" dot />
|
|
55
|
+
|
|
56
|
+
{/* Badge dengan children */}
|
|
57
|
+
<Badge color="warning">
|
|
58
|
+
<CustomComponent />
|
|
59
|
+
</Badge>
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["Badge/type.tsx"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState, useCallback } from 'react';
|
|
4
|
+
import { View, StyleSheet, PanResponder, TouchableOpacity, Animated, Modal, KeyboardAvoidingView, Keyboard, Dimensions, SafeAreaView, Platform, StatusBar } from 'react-native';
|
|
5
|
+
import Container from "../Ui/Container.js";
|
|
6
|
+
import Typography from "../Typography/Typography.js";
|
|
7
|
+
import Color from "../Color/Color.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const statusBarHeight = Platform.OS === 'android' ? StatusBar.currentHeight ?? 24 : 65;
|
|
10
|
+
const screenHeight = Dimensions.get('window').height;
|
|
11
|
+
const actualScreenHeight = screenHeight - statusBarHeight;
|
|
12
|
+
const DEFAULT_PADDING_BOTTOM = 40;
|
|
13
|
+
export default function BottomSheet({
|
|
14
|
+
isOpen,
|
|
15
|
+
onClose,
|
|
16
|
+
children,
|
|
17
|
+
backdrop = true,
|
|
18
|
+
closable = true,
|
|
19
|
+
onRequestClose,
|
|
20
|
+
buttonClose = false,
|
|
21
|
+
height,
|
|
22
|
+
pullBar,
|
|
23
|
+
footer
|
|
24
|
+
}) {
|
|
25
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
26
|
+
const [heightFooter, setHeightFooter] = useState(0);
|
|
27
|
+
const [heighContent, setHeighContent] = useState('auto');
|
|
28
|
+
const [maxHeight, setMaxHeight] = useState(actualScreenHeight);
|
|
29
|
+
const translateY = useRef(new Animated.Value(600)).current;
|
|
30
|
+
const panResponder = useRef(PanResponder.create({
|
|
31
|
+
onStartShouldSetPanResponder: () => true,
|
|
32
|
+
onMoveShouldSetPanResponder: () => false,
|
|
33
|
+
onPanResponderMove: (_, gestureState) => {
|
|
34
|
+
if (gestureState.dy > 0) {
|
|
35
|
+
translateY.setValue(gestureState.dy);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
39
|
+
if (closable && gestureState.dy > 50) {
|
|
40
|
+
handleRequestClose();
|
|
41
|
+
} else {
|
|
42
|
+
resetModalPosition();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})).current;
|
|
46
|
+
const hideModal = useCallback(() => {
|
|
47
|
+
if (closable) {
|
|
48
|
+
Animated.timing(translateY, {
|
|
49
|
+
toValue: 500,
|
|
50
|
+
duration: 300,
|
|
51
|
+
useNativeDriver: false
|
|
52
|
+
}).start(() => {
|
|
53
|
+
setIsVisible(false);
|
|
54
|
+
onClose && onClose(false);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, [closable, translateY, onClose]);
|
|
58
|
+
const showModal = useCallback(() => {
|
|
59
|
+
setIsVisible(true);
|
|
60
|
+
Animated.spring(translateY, {
|
|
61
|
+
toValue: 0,
|
|
62
|
+
useNativeDriver: false
|
|
63
|
+
}).start();
|
|
64
|
+
}, [translateY]);
|
|
65
|
+
const handleRequestClose = e => {
|
|
66
|
+
hideModal();
|
|
67
|
+
onRequestClose && onRequestClose(e);
|
|
68
|
+
};
|
|
69
|
+
const resetModalPosition = () => {
|
|
70
|
+
Animated.spring(translateY, {
|
|
71
|
+
toValue: 0,
|
|
72
|
+
useNativeDriver: false
|
|
73
|
+
}).start();
|
|
74
|
+
};
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (isOpen) {
|
|
77
|
+
showModal();
|
|
78
|
+
} else {
|
|
79
|
+
hideModal();
|
|
80
|
+
}
|
|
81
|
+
}, [isOpen, showModal, hideModal]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (height) {
|
|
84
|
+
setHeighContent(height);
|
|
85
|
+
}
|
|
86
|
+
}, [height]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', e => {
|
|
89
|
+
const keyboardHeight = e.endCoordinates?.height || 300;
|
|
90
|
+
setMaxHeight(screenHeight - statusBarHeight - keyboardHeight);
|
|
91
|
+
});
|
|
92
|
+
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
|
|
93
|
+
setMaxHeight(screenHeight - statusBarHeight);
|
|
94
|
+
});
|
|
95
|
+
return () => {
|
|
96
|
+
keyboardDidShowListener.remove();
|
|
97
|
+
keyboardDidHideListener.remove();
|
|
98
|
+
};
|
|
99
|
+
}, []);
|
|
100
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
101
|
+
transparent: true,
|
|
102
|
+
visible: isVisible,
|
|
103
|
+
onRequestClose: handleRequestClose,
|
|
104
|
+
animationType: "fade",
|
|
105
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
106
|
+
style: [styles.modalContainer, backdrop && styles.backdrop],
|
|
107
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
108
|
+
onPress: handleRequestClose,
|
|
109
|
+
activeOpacity: 1,
|
|
110
|
+
style: styles.backdropTouchable
|
|
111
|
+
}), /*#__PURE__*/_jsx(KeyboardAvoidingView, {
|
|
112
|
+
behavior: Platform.OS === 'ios' ? 'padding' : undefined,
|
|
113
|
+
enabled: true,
|
|
114
|
+
style: styles.keyboardAvoiding,
|
|
115
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
116
|
+
style: [styles.bottomSheet, {
|
|
117
|
+
transform: [{
|
|
118
|
+
translateY
|
|
119
|
+
}],
|
|
120
|
+
height: heighContent,
|
|
121
|
+
maxHeight: maxHeight,
|
|
122
|
+
paddingBottom: DEFAULT_PADDING_BOTTOM + heightFooter
|
|
123
|
+
}],
|
|
124
|
+
children: [buttonClose && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
125
|
+
onPress: handleRequestClose,
|
|
126
|
+
style: styles.closeButton,
|
|
127
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
128
|
+
children: "x"
|
|
129
|
+
})
|
|
130
|
+
}), closable && /*#__PURE__*/_jsx(View, {
|
|
131
|
+
...panResponder.panHandlers,
|
|
132
|
+
style: styles.dragIndicatorContainer,
|
|
133
|
+
children: pullBar ? pullBar : /*#__PURE__*/_jsx(View, {
|
|
134
|
+
style: styles.dragIndicator
|
|
135
|
+
})
|
|
136
|
+
}), /*#__PURE__*/_jsx(SafeAreaView, {
|
|
137
|
+
style: [styles.contentContainer, ...(footer ? [styles.contentWithFooter] : [])],
|
|
138
|
+
children: /*#__PURE__*/_jsx(Container, {
|
|
139
|
+
children: children
|
|
140
|
+
})
|
|
141
|
+
}), footer && /*#__PURE__*/_jsx(SafeAreaView, {
|
|
142
|
+
onLayout: event => {
|
|
143
|
+
const {
|
|
144
|
+
height
|
|
145
|
+
} = event.nativeEvent.layout;
|
|
146
|
+
setHeightFooter(height);
|
|
147
|
+
},
|
|
148
|
+
style: styles.footer,
|
|
149
|
+
children: /*#__PURE__*/_jsx(Container, {
|
|
150
|
+
children: footer
|
|
151
|
+
})
|
|
152
|
+
})]
|
|
153
|
+
})
|
|
154
|
+
})]
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const styles = StyleSheet.create({
|
|
159
|
+
modalContainer: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
justifyContent: 'flex-end'
|
|
162
|
+
},
|
|
163
|
+
backdrop: {
|
|
164
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
165
|
+
},
|
|
166
|
+
backdropTouchable: {
|
|
167
|
+
flex: 1
|
|
168
|
+
},
|
|
169
|
+
keyboardAvoiding: {
|
|
170
|
+
justifyContent: 'flex-end'
|
|
171
|
+
},
|
|
172
|
+
bottomSheet: {
|
|
173
|
+
backgroundColor: 'white',
|
|
174
|
+
borderTopLeftRadius: 16,
|
|
175
|
+
borderTopRightRadius: 16
|
|
176
|
+
},
|
|
177
|
+
closeButton: {
|
|
178
|
+
position: 'absolute',
|
|
179
|
+
backgroundColor: 'white',
|
|
180
|
+
paddingVertical: 10,
|
|
181
|
+
paddingHorizontal: 14,
|
|
182
|
+
borderRadius: 50,
|
|
183
|
+
top: -50,
|
|
184
|
+
right: 24,
|
|
185
|
+
zIndex: 10
|
|
186
|
+
},
|
|
187
|
+
dragIndicatorContainer: {
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
paddingBottom: 20
|
|
190
|
+
},
|
|
191
|
+
dragIndicator: {
|
|
192
|
+
width: 70,
|
|
193
|
+
height: 5,
|
|
194
|
+
marginTop: 10,
|
|
195
|
+
borderRadius: 2,
|
|
196
|
+
backgroundColor: '#ccc'
|
|
197
|
+
},
|
|
198
|
+
contentContainer: {
|
|
199
|
+
flexGrow: 1
|
|
200
|
+
},
|
|
201
|
+
contentWithFooter: {},
|
|
202
|
+
footer: {
|
|
203
|
+
backgroundColor: Color.base.white100,
|
|
204
|
+
position: 'absolute',
|
|
205
|
+
bottom: 0,
|
|
206
|
+
left: 0,
|
|
207
|
+
right: 0,
|
|
208
|
+
zIndex: 10
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
//# sourceMappingURL=BottomSheet.js.map
|