@herca/rn-kit 0.1.113 → 0.1.115
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/README.md +66 -0
- package/lib/module/Accordion/Accordion.js +4 -1
- package/lib/module/Accordion/Accordion.js.map +1 -1
- package/lib/module/Accordion/AccordionItem.js +3 -1
- package/lib/module/Accordion/AccordionItem.js.map +1 -1
- package/lib/module/Accordion/README.md +2 -0
- package/lib/module/Alert/Alert.js +3 -1
- package/lib/module/Alert/Alert.js.map +1 -1
- package/lib/module/Alert/README.md +1 -0
- package/lib/module/Avatar/Avatar.js +3 -1
- package/lib/module/Avatar/Avatar.js.map +1 -1
- package/lib/module/Avatar/AvatarGroup.js +3 -1
- package/lib/module/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/Avatar/README_AVATAR.md +1 -0
- package/lib/module/Avatar/README_AVATARGROUP.md +1 -0
- package/lib/module/Badge/Badge.js +4 -1
- package/lib/module/Badge/Badge.js.map +1 -1
- package/lib/module/Badge/README.md +1 -0
- package/lib/module/BadgeIcon/BadgeIcon.js +3 -1
- package/lib/module/BadgeIcon/BadgeIcon.js.map +1 -1
- package/lib/module/BadgeIcon/README.md +1 -0
- package/lib/module/BottomSheet/BottomSheet.js +17 -8
- package/lib/module/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/BottomSheet/README.md +1 -0
- package/lib/module/Button/Button.js +3 -1
- package/lib/module/Button/Button.js.map +1 -1
- package/lib/module/Button/README.md +1 -0
- package/lib/module/Button/type.js.map +1 -1
- package/lib/module/Calendar/Calendar.js +9 -1
- package/lib/module/Calendar/Calendar.js.map +1 -1
- package/lib/module/Calendar/README.md +2 -0
- package/lib/module/CheckBox/CheckBox.js +8 -3
- package/lib/module/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/CheckBox/CheckBoxList.js +7 -2
- package/lib/module/CheckBox/CheckBoxList.js.map +1 -1
- package/lib/module/CheckBox/README_CHECKBOX.md +1 -0
- package/lib/module/CheckBox/README_CHECKBOXLIST.md +1 -0
- package/lib/module/Chip/Chip.js +19 -6
- package/lib/module/Chip/Chip.js.map +1 -1
- package/lib/module/Chip/ChipItem.js +3 -1
- package/lib/module/Chip/ChipItem.js.map +1 -1
- package/lib/module/Chip/README.md +26 -2
- package/lib/module/Chip/README_CHIP_ITEM.md +1 -0
- package/lib/module/CounterButton/CounterButton.js +6 -1
- package/lib/module/CounterButton/CounterButton.js.map +1 -1
- package/lib/module/CounterButton/README.md +1 -0
- package/lib/module/DatePicker/DatePicker.js +13 -1
- package/lib/module/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/DatePicker/MonthPicker.js +35 -2
- package/lib/module/DatePicker/MonthPicker.js.map +1 -1
- package/lib/module/DatePicker/README_DATEPICKER.md +1 -0
- package/lib/module/DatePicker/README_MONTHPICKER.md +2 -0
- package/lib/module/DatePicker/README_TIMEPICKER.md +1 -0
- package/lib/module/DatePicker/README_YEARPICKER.md +2 -0
- package/lib/module/DatePicker/TimePicker.js +8 -1
- package/lib/module/DatePicker/TimePicker.js.map +1 -1
- package/lib/module/DatePicker/YearPicker.js +50 -5
- package/lib/module/DatePicker/YearPicker.js.map +1 -1
- package/lib/module/Drawing/Drawing.js +3 -1
- package/lib/module/Drawing/Drawing.js.map +1 -1
- package/lib/module/Drawing/README.md +1 -0
- package/lib/module/DropDown/DropDown.js +6 -1
- package/lib/module/DropDown/DropDown.js.map +1 -1
- package/lib/module/DropDown/README.md +1 -0
- package/lib/module/FileView/PDF_VIEW_README.md +11 -0
- package/lib/module/FileView/PdfView.js +5 -1
- package/lib/module/FileView/PdfView.js.map +1 -1
- package/lib/module/Icon/Icon.js +14 -2
- package/lib/module/Icon/Icon.js.map +1 -1
- package/lib/module/Icon/README.md +1 -0
- package/lib/module/Input/Input.js +7 -0
- package/lib/module/Input/Input.js.map +1 -1
- package/lib/module/Input/InputDate.js +35 -8
- package/lib/module/Input/InputDate.js.map +1 -1
- package/lib/module/Input/InputFile.js +28 -11
- package/lib/module/Input/InputFile.js.map +1 -1
- package/lib/module/Input/InputMonth.js +126 -1
- package/lib/module/Input/InputMonth.js.map +1 -1
- package/lib/module/Input/InputOtp.js +6 -1
- package/lib/module/Input/InputOtp.js.map +1 -1
- package/lib/module/Input/InputPassword.js +5 -1
- package/lib/module/Input/InputPassword.js.map +1 -1
- package/lib/module/Input/InputSelect.js +21 -2
- package/lib/module/Input/InputSelect.js.map +1 -1
- package/lib/module/Input/InputYear.js +103 -0
- package/lib/module/Input/InputYear.js.map +1 -0
- package/lib/module/Input/README_INPUT.md +1 -0
- package/lib/module/Input/README_INPUT_DATE.md +18 -0
- package/lib/module/Input/README_INPUT_FILE.md +1 -0
- package/lib/module/Input/README_INPUT_MONTH.md +132 -0
- package/lib/module/Input/README_INPUT_OTP.md +1 -0
- package/lib/module/Input/README_INPUT_SELECT.md +1 -0
- package/lib/module/Input/README_INPUT_YEAR.md +115 -0
- package/lib/module/Input/Switch.js +6 -2
- package/lib/module/Input/Switch.js.map +1 -1
- package/lib/module/Input/TextArea.js +5 -0
- package/lib/module/Input/TextArea.js.map +1 -1
- package/lib/module/Input/partials/InputFile/CardTrigger.js +3 -1
- package/lib/module/Input/partials/InputFile/CardTrigger.js.map +1 -1
- package/lib/module/Input/partials/InputFile/CardTriggerSmall.js +5 -2
- package/lib/module/Input/partials/InputFile/CardTriggerSmall.js.map +1 -1
- package/lib/module/Input/partials/InputFile/ItemPreview.js +6 -1
- package/lib/module/Input/partials/InputFile/ItemPreview.js.map +1 -1
- package/lib/module/Input/partials/PickerField.js +114 -0
- package/lib/module/Input/partials/PickerField.js.map +1 -0
- package/lib/module/Label/Label.js +3 -1
- package/lib/module/Label/Label.js.map +1 -1
- package/lib/module/Label/README.md +1 -0
- package/lib/module/LabelForm/LabelForm.js +3 -1
- package/lib/module/LabelForm/LabelForm.js.map +1 -1
- package/lib/module/List/List.js +3 -1
- package/lib/module/List/List.js.map +1 -1
- package/lib/module/List/ListItem.js +3 -1
- package/lib/module/List/ListItem.js.map +1 -1
- package/lib/module/List/README.md +2 -0
- package/lib/module/Loading/Loading.js +3 -1
- package/lib/module/Loading/Loading.js.map +1 -1
- package/lib/module/Modal/Modal.js +8 -2
- package/lib/module/Modal/Modal.js.map +1 -1
- package/lib/module/Modal/README.md +1 -0
- package/lib/module/Provider/RequiredUpdateAppsProvider.js +10 -1
- package/lib/module/Provider/RequiredUpdateAppsProvider.js.map +1 -1
- package/lib/module/RadioButton/README.md +1 -0
- package/lib/module/RadioButton/RadioButton.js +7 -2
- package/lib/module/RadioButton/RadioButton.js.map +1 -1
- package/lib/module/Select/README.md +1 -0
- package/lib/module/Select/README_Select.md +1 -0
- package/lib/module/Select/Select.js +12 -3
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Skeleton/README.md +1 -0
- package/lib/module/Skeleton/Skeleton.js +3 -1
- package/lib/module/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/Spinner/Spinner.js +3 -1
- package/lib/module/Spinner/Spinner.js.map +1 -1
- package/lib/module/Step/README.md +2 -0
- package/lib/module/Step/Step.js +3 -1
- package/lib/module/Step/Step.js.map +1 -1
- package/lib/module/Step/StepItem.js +4 -1
- package/lib/module/Step/StepItem.js.map +1 -1
- package/lib/module/Tab/README.md +1 -0
- package/lib/module/Tab/Tab.js +6 -1
- package/lib/module/Tab/Tab.js.map +1 -1
- package/lib/module/TextEditor/LinkSheet.js +84 -0
- package/lib/module/TextEditor/LinkSheet.js.map +1 -0
- package/lib/module/TextEditor/README.md +52 -2
- package/lib/module/TextEditor/TextEditor.js +77 -458
- package/lib/module/TextEditor/TextEditor.js.map +1 -1
- package/lib/module/TextEditor/Toolbar.js +71 -0
- package/lib/module/TextEditor/Toolbar.js.map +1 -0
- package/lib/module/TextEditor/editorDocument.js +235 -0
- package/lib/module/TextEditor/editorDocument.js.map +1 -0
- package/lib/module/TextEditor/formatState.js +186 -0
- package/lib/module/TextEditor/formatState.js.map +1 -0
- package/lib/module/TextEditor/toolbarButtons.js +81 -0
- package/lib/module/TextEditor/toolbarButtons.js.map +1 -0
- package/lib/module/TextEditor/types.js +2 -0
- package/lib/module/Timeline/README.md +2 -0
- package/lib/module/Timeline/Timeline.js +3 -1
- package/lib/module/Timeline/Timeline.js.map +1 -1
- package/lib/module/Timeline/TimelineItem.js +3 -1
- package/lib/module/Timeline/TimelineItem.js.map +1 -1
- package/lib/module/Toast/README.md +16 -0
- package/lib/module/Toast/Toast.js +6 -1
- package/lib/module/Toast/Toast.js.map +1 -1
- package/lib/module/Typography/README.md +1 -0
- package/lib/module/Typography/Typography.js +3 -1
- package/lib/module/Typography/Typography.js.map +1 -1
- package/lib/module/Ui/Card.js +4 -1
- package/lib/module/Ui/Card.js.map +1 -1
- package/lib/module/Ui/Center.js +3 -1
- package/lib/module/Ui/Center.js.map +1 -1
- package/lib/module/Ui/Col.js +3 -1
- package/lib/module/Ui/Col.js.map +1 -1
- package/lib/module/Ui/Container.js +3 -1
- package/lib/module/Ui/Container.js.map +1 -1
- package/lib/module/Ui/Devider.js +4 -1
- package/lib/module/Ui/Devider.js.map +1 -1
- package/lib/module/Ui/Footer.js +4 -2
- package/lib/module/Ui/Footer.js.map +1 -1
- package/lib/module/Ui/Gap.js +3 -1
- package/lib/module/Ui/Gap.js.map +1 -1
- package/lib/module/Ui/Grid.js +3 -1
- package/lib/module/Ui/Grid.js.map +1 -1
- package/lib/module/Ui/README_CARD.md +1 -0
- package/lib/module/Ui/README_CONTAINER.md +1 -0
- package/lib/module/Ui/README_DEVIDER.md +5 -0
- package/lib/module/Ui/README_FOOTER.md +9 -0
- package/lib/module/Ui/README_VIEWINSETS.md +1 -0
- package/lib/module/function/README_DATE_FORMATTER.md +35 -0
- package/lib/module/function/dateFormatter.js +29 -0
- package/lib/module/function/dateFormatter.js.map +1 -1
- package/lib/module/helpers/getTestID.js +15 -0
- package/lib/module/helpers/getTestID.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/Accordion/Accordion.d.ts +1 -1
- package/lib/typescript/src/Accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/src/Accordion/AccordionItem.d.ts +1 -1
- package/lib/typescript/src/Accordion/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/src/Accordion/type.d.ts +2 -0
- package/lib/typescript/src/Accordion/type.d.ts.map +1 -1
- package/lib/typescript/src/Alert/Alert.d.ts +1 -0
- package/lib/typescript/src/Alert/Alert.d.ts.map +1 -1
- package/lib/typescript/src/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/Avatar/AvatarGroup.d.ts.map +1 -1
- package/lib/typescript/src/Avatar/type.d.ts +2 -0
- package/lib/typescript/src/Avatar/type.d.ts.map +1 -1
- package/lib/typescript/src/Badge/Badge.d.ts +1 -0
- package/lib/typescript/src/Badge/Badge.d.ts.map +1 -1
- package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts +1 -0
- package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheet/BottomSheet.d.ts +1 -1
- package/lib/typescript/src/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/BottomSheet/type.d.ts +1 -0
- package/lib/typescript/src/BottomSheet/type.d.ts.map +1 -1
- package/lib/typescript/src/Button/Button.d.ts.map +1 -1
- package/lib/typescript/src/Button/type.d.ts +1 -0
- package/lib/typescript/src/Button/type.d.ts.map +1 -1
- package/lib/typescript/src/Calendar/Calendar.d.ts +1 -1
- package/lib/typescript/src/Calendar/Calendar.d.ts.map +1 -1
- package/lib/typescript/src/Calendar/CalendarPropsType.d.ts +6 -0
- package/lib/typescript/src/Calendar/CalendarPropsType.d.ts.map +1 -1
- package/lib/typescript/src/CheckBox/CheckBox.d.ts +1 -0
- package/lib/typescript/src/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/src/CheckBox/CheckBoxList.d.ts +1 -0
- package/lib/typescript/src/CheckBox/CheckBoxList.d.ts.map +1 -1
- package/lib/typescript/src/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/src/Chip/ChipItem.d.ts +1 -1
- package/lib/typescript/src/Chip/ChipItem.d.ts.map +1 -1
- package/lib/typescript/src/Chip/type.d.ts +2 -0
- package/lib/typescript/src/Chip/type.d.ts.map +1 -1
- package/lib/typescript/src/CounterButton/CounterButton.d.ts +1 -1
- package/lib/typescript/src/CounterButton/CounterButton.d.ts.map +1 -1
- package/lib/typescript/src/CounterButton/type.d.ts +1 -0
- package/lib/typescript/src/CounterButton/type.d.ts.map +1 -1
- package/lib/typescript/src/DatePicker/DatePicker.d.ts +2 -1
- package/lib/typescript/src/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/src/DatePicker/MonthPicker.d.ts +11 -1
- package/lib/typescript/src/DatePicker/MonthPicker.d.ts.map +1 -1
- package/lib/typescript/src/DatePicker/TimePicker.d.ts +2 -1
- package/lib/typescript/src/DatePicker/TimePicker.d.ts.map +1 -1
- package/lib/typescript/src/DatePicker/YearPicker.d.ts +14 -1
- package/lib/typescript/src/DatePicker/YearPicker.d.ts.map +1 -1
- package/lib/typescript/src/Drawing/Drawing.d.ts +2 -1
- package/lib/typescript/src/Drawing/Drawing.d.ts.map +1 -1
- package/lib/typescript/src/DropDown/DropDown.d.ts +1 -1
- package/lib/typescript/src/DropDown/DropDown.d.ts.map +1 -1
- package/lib/typescript/src/DropDown/type.d.ts +1 -0
- package/lib/typescript/src/DropDown/type.d.ts.map +1 -1
- package/lib/typescript/src/FileView/PdfView.d.ts +2 -1
- package/lib/typescript/src/FileView/PdfView.d.ts.map +1 -1
- package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/Icon/type.d.ts +1 -0
- package/lib/typescript/src/Icon/type.d.ts.map +1 -1
- package/lib/typescript/src/Input/Input.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputDate.d.ts +6 -2
- package/lib/typescript/src/Input/InputDate.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputFile.d.ts +1 -1
- package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputMonth.d.ts +29 -1
- package/lib/typescript/src/Input/InputMonth.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputOtp.d.ts +1 -0
- package/lib/typescript/src/Input/InputOtp.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputPassword.d.ts +2 -1
- package/lib/typescript/src/Input/InputPassword.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputSelect.d.ts +4 -2
- package/lib/typescript/src/Input/InputSelect.d.ts.map +1 -1
- package/lib/typescript/src/Input/InputYear.d.ts +34 -0
- package/lib/typescript/src/Input/InputYear.d.ts.map +1 -0
- package/lib/typescript/src/Input/Switch.d.ts +2 -1
- package/lib/typescript/src/Input/Switch.d.ts.map +1 -1
- package/lib/typescript/src/Input/TextArea.d.ts +1 -1
- package/lib/typescript/src/Input/TextArea.d.ts.map +1 -1
- package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts +2 -1
- package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts.map +1 -1
- package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts +2 -1
- package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts.map +1 -1
- package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts +2 -1
- package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts.map +1 -1
- package/lib/typescript/src/Input/partials/PickerField.d.ts +25 -0
- package/lib/typescript/src/Input/partials/PickerField.d.ts.map +1 -0
- package/lib/typescript/src/Input/type.d.ts +13 -0
- package/lib/typescript/src/Input/type.d.ts.map +1 -1
- package/lib/typescript/src/Label/Label.d.ts +2 -1
- package/lib/typescript/src/Label/Label.d.ts.map +1 -1
- package/lib/typescript/src/LabelForm/LabelForm.d.ts +2 -1
- package/lib/typescript/src/LabelForm/LabelForm.d.ts.map +1 -1
- package/lib/typescript/src/List/List.d.ts +1 -1
- package/lib/typescript/src/List/List.d.ts.map +1 -1
- package/lib/typescript/src/List/ListItem.d.ts +1 -1
- package/lib/typescript/src/List/ListItem.d.ts.map +1 -1
- package/lib/typescript/src/List/type.d.ts +2 -0
- package/lib/typescript/src/List/type.d.ts.map +1 -1
- package/lib/typescript/src/Loading/Loading.d.ts +1 -0
- package/lib/typescript/src/Loading/Loading.d.ts.map +1 -1
- package/lib/typescript/src/Modal/Modal.d.ts +1 -0
- package/lib/typescript/src/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/src/Provider/RequiredUpdateAppsProvider.d.ts.map +1 -1
- package/lib/typescript/src/RadioButton/RadioButton.d.ts +1 -0
- package/lib/typescript/src/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/typescript/src/Select/Select.d.ts +1 -1
- package/lib/typescript/src/Select/Select.d.ts.map +1 -1
- package/lib/typescript/src/Select/type.d.ts +1 -0
- package/lib/typescript/src/Select/type.d.ts.map +1 -1
- package/lib/typescript/src/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/src/Skeleton/type.d.ts +1 -0
- package/lib/typescript/src/Skeleton/type.d.ts.map +1 -1
- package/lib/typescript/src/Spinner/Spinner.d.ts +7 -4
- package/lib/typescript/src/Spinner/Spinner.d.ts.map +1 -1
- package/lib/typescript/src/Step/Step.d.ts +1 -1
- package/lib/typescript/src/Step/Step.d.ts.map +1 -1
- package/lib/typescript/src/Step/StepItem.d.ts +1 -1
- package/lib/typescript/src/Step/StepItem.d.ts.map +1 -1
- package/lib/typescript/src/Step/type.d.ts +2 -0
- package/lib/typescript/src/Step/type.d.ts.map +1 -1
- package/lib/typescript/src/Tab/Tab.d.ts.map +1 -1
- package/lib/typescript/src/Tab/type.d.ts +1 -0
- package/lib/typescript/src/Tab/type.d.ts.map +1 -1
- package/lib/typescript/src/TextEditor/LinkSheet.d.ts +26 -0
- package/lib/typescript/src/TextEditor/LinkSheet.d.ts.map +1 -0
- package/lib/typescript/src/TextEditor/TextEditor.d.ts +2 -19
- package/lib/typescript/src/TextEditor/TextEditor.d.ts.map +1 -1
- package/lib/typescript/src/TextEditor/Toolbar.d.ts +16 -0
- package/lib/typescript/src/TextEditor/Toolbar.d.ts.map +1 -0
- package/lib/typescript/src/TextEditor/editorDocument.d.ts +20 -0
- package/lib/typescript/src/TextEditor/editorDocument.d.ts.map +1 -0
- package/lib/typescript/src/TextEditor/formatState.d.ts +34 -0
- package/lib/typescript/src/TextEditor/formatState.d.ts.map +1 -0
- package/lib/typescript/src/TextEditor/toolbarButtons.d.ts +5 -0
- package/lib/typescript/src/TextEditor/toolbarButtons.d.ts.map +1 -0
- package/lib/typescript/src/TextEditor/types.d.ts +42 -0
- package/lib/typescript/src/TextEditor/types.d.ts.map +1 -1
- package/lib/typescript/src/Timeline/Timeline.d.ts +2 -1
- package/lib/typescript/src/Timeline/Timeline.d.ts.map +1 -1
- package/lib/typescript/src/Timeline/TimelineItem.d.ts +2 -1
- package/lib/typescript/src/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/typescript/src/Toast/Toast.d.ts +2 -1
- package/lib/typescript/src/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/Typography/Typography.d.ts.map +1 -1
- package/lib/typescript/src/Typography/type.d.ts +1 -0
- package/lib/typescript/src/Typography/type.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Card.d.ts +2 -1
- package/lib/typescript/src/Ui/Card.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Center.d.ts +2 -1
- package/lib/typescript/src/Ui/Center.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Col.d.ts +1 -0
- package/lib/typescript/src/Ui/Col.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Container.d.ts +2 -1
- package/lib/typescript/src/Ui/Container.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Devider.d.ts +3 -1
- package/lib/typescript/src/Ui/Devider.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Footer.d.ts +1 -0
- package/lib/typescript/src/Ui/Footer.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Gap.d.ts +2 -1
- package/lib/typescript/src/Ui/Gap.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Grid.d.ts +1 -0
- package/lib/typescript/src/Ui/Grid.d.ts.map +1 -1
- package/lib/typescript/src/function/dateFormatter.d.ts +11 -0
- package/lib/typescript/src/function/dateFormatter.d.ts.map +1 -1
- package/lib/typescript/src/helpers/getTestID.d.ts +10 -0
- package/lib/typescript/src/helpers/getTestID.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +16 -3
- package/src/Accordion/Accordion.tsx +6 -1
- package/src/Accordion/AccordionItem.tsx +2 -1
- package/src/Accordion/README.md +2 -0
- package/src/Accordion/type.tsx +2 -0
- package/src/Alert/Alert.tsx +3 -0
- package/src/Alert/README.md +1 -0
- package/src/Avatar/Avatar.tsx +2 -0
- package/src/Avatar/AvatarGroup.tsx +2 -1
- package/src/Avatar/README_AVATAR.md +1 -0
- package/src/Avatar/README_AVATARGROUP.md +1 -0
- package/src/Avatar/type.tsx +2 -0
- package/src/Badge/Badge.tsx +4 -0
- package/src/Badge/README.md +1 -0
- package/src/BadgeIcon/BadgeIcon.tsx +3 -0
- package/src/BadgeIcon/README.md +1 -0
- package/src/BottomSheet/BottomSheet.tsx +20 -13
- package/src/BottomSheet/README.md +1 -0
- package/src/BottomSheet/type.tsx +1 -0
- package/src/Button/Button.tsx +2 -0
- package/src/Button/README.md +1 -0
- package/src/Button/type.tsx +1 -0
- package/src/Calendar/Calendar.tsx +8 -1
- package/src/Calendar/CalendarPropsType.tsx +6 -0
- package/src/Calendar/README.md +2 -0
- package/src/CheckBox/CheckBox.tsx +13 -2
- package/src/CheckBox/CheckBoxList.tsx +7 -1
- package/src/CheckBox/README_CHECKBOX.md +1 -0
- package/src/CheckBox/README_CHECKBOXLIST.md +1 -0
- package/src/Chip/Chip.tsx +18 -5
- package/src/Chip/ChipItem.tsx +2 -0
- package/src/Chip/README.md +26 -2
- package/src/Chip/README_CHIP_ITEM.md +1 -0
- package/src/Chip/type.tsx +2 -0
- package/src/CounterButton/CounterButton.tsx +5 -0
- package/src/CounterButton/README.md +1 -0
- package/src/CounterButton/type.tsx +1 -0
- package/src/DatePicker/DatePicker.tsx +21 -5
- package/src/DatePicker/MonthPicker.tsx +40 -1
- package/src/DatePicker/README_DATEPICKER.md +1 -0
- package/src/DatePicker/README_MONTHPICKER.md +2 -0
- package/src/DatePicker/README_TIMEPICKER.md +1 -0
- package/src/DatePicker/README_YEARPICKER.md +2 -0
- package/src/DatePicker/TimePicker.tsx +8 -0
- package/src/DatePicker/YearPicker.tsx +59 -4
- package/src/Drawing/Drawing.tsx +3 -1
- package/src/Drawing/README.md +1 -0
- package/src/DropDown/DropDown.tsx +12 -1
- package/src/DropDown/README.md +1 -0
- package/src/DropDown/type.tsx +1 -0
- package/src/FileView/PDF_VIEW_README.md +11 -0
- package/src/FileView/PdfView.tsx +4 -3
- package/src/Icon/Icon.tsx +10 -2
- package/src/Icon/README.md +1 -0
- package/src/Icon/type.tsx +1 -0
- package/src/Input/Input.tsx +17 -2
- package/src/Input/InputDate.tsx +40 -15
- package/src/Input/InputFile.tsx +27 -14
- package/src/Input/InputMonth.tsx +170 -1
- package/src/Input/InputOtp.tsx +12 -2
- package/src/Input/InputPassword.tsx +6 -1
- package/src/Input/InputSelect.tsx +30 -13
- package/src/Input/InputYear.tsx +134 -0
- package/src/Input/README_INPUT.md +1 -0
- package/src/Input/README_INPUT_DATE.md +18 -0
- package/src/Input/README_INPUT_FILE.md +1 -0
- package/src/Input/README_INPUT_MONTH.md +132 -0
- package/src/Input/README_INPUT_OTP.md +1 -0
- package/src/Input/README_INPUT_SELECT.md +1 -0
- package/src/Input/README_INPUT_YEAR.md +115 -0
- package/src/Input/Switch.tsx +7 -1
- package/src/Input/TextArea.tsx +15 -2
- package/src/Input/partials/InputFile/CardTrigger.tsx +3 -0
- package/src/Input/partials/InputFile/CardTriggerSmall.tsx +4 -1
- package/src/Input/partials/InputFile/ItemPreview.tsx +12 -2
- package/src/Input/partials/PickerField.tsx +125 -0
- package/src/Input/type.tsx +14 -0
- package/src/Label/Label.tsx +3 -0
- package/src/Label/README.md +1 -0
- package/src/LabelForm/LabelForm.tsx +3 -1
- package/src/List/List.tsx +2 -2
- package/src/List/ListItem.tsx +2 -0
- package/src/List/README.md +2 -0
- package/src/List/type.tsx +2 -0
- package/src/Loading/Loading.tsx +3 -1
- package/src/Modal/Modal.tsx +15 -3
- package/src/Modal/README.md +1 -0
- package/src/Provider/RequiredUpdateAppsProvider.tsx +10 -1
- package/src/RadioButton/README.md +1 -0
- package/src/RadioButton/RadioButton.tsx +12 -2
- package/src/Select/README.md +1 -0
- package/src/Select/README_Select.md +1 -0
- package/src/Select/Select.tsx +13 -3
- package/src/Select/type.tsx +1 -0
- package/src/Skeleton/README.md +1 -0
- package/src/Skeleton/Skeleton.tsx +2 -0
- package/src/Skeleton/type.ts +1 -0
- package/src/Spinner/Spinner.tsx +15 -2
- package/src/Step/README.md +2 -0
- package/src/Step/Step.tsx +2 -2
- package/src/Step/StepItem.tsx +7 -2
- package/src/Step/type.tsx +2 -0
- package/src/Tab/README.md +1 -0
- package/src/Tab/Tab.tsx +12 -2
- package/src/Tab/type.tsx +1 -0
- package/src/TextEditor/LinkSheet.tsx +100 -0
- package/src/TextEditor/README.md +52 -2
- package/src/TextEditor/TextEditor.tsx +92 -500
- package/src/TextEditor/Toolbar.tsx +104 -0
- package/src/TextEditor/editorDocument.ts +246 -0
- package/src/TextEditor/formatState.ts +186 -0
- package/src/TextEditor/toolbarButtons.ts +41 -0
- package/src/TextEditor/types.tsx +63 -0
- package/src/Timeline/README.md +2 -0
- package/src/Timeline/Timeline.tsx +7 -2
- package/src/Timeline/TimelineItem.tsx +3 -1
- package/src/Toast/README.md +16 -0
- package/src/Toast/Toast.tsx +13 -2
- package/src/Typography/README.md +1 -0
- package/src/Typography/Typography.tsx +6 -1
- package/src/Typography/type.tsx +1 -0
- package/src/Ui/Card.tsx +4 -0
- package/src/Ui/Center.tsx +7 -2
- package/src/Ui/Col.tsx +7 -2
- package/src/Ui/Container.tsx +7 -2
- package/src/Ui/Devider.tsx +2 -2
- package/src/Ui/Footer.tsx +6 -3
- package/src/Ui/Gap.tsx +8 -2
- package/src/Ui/Grid.tsx +3 -2
- package/src/Ui/README_CARD.md +1 -0
- package/src/Ui/README_CONTAINER.md +1 -0
- package/src/Ui/README_DEVIDER.md +5 -0
- package/src/Ui/README_FOOTER.md +9 -0
- package/src/Ui/README_VIEWINSETS.md +1 -0
- package/src/function/README_DATE_FORMATTER.md +35 -0
- package/src/function/dateFormatter.ts +40 -0
- package/src/helpers/getTestID.ts +15 -0
- package/src/index.tsx +6 -0
- package/lib/module/Button/tests/Button.test.js +0 -70
- package/lib/module/Button/tests/Button.test.js.map +0 -1
- package/lib/typescript/src/Button/tests/Button.test.d.ts +0 -2
- package/lib/typescript/src/Button/tests/Button.test.d.ts.map +0 -1
- package/src/Button/tests/Button.test.tsx +0 -49
package/src/Chip/type.tsx
CHANGED
|
@@ -135,6 +135,7 @@ export interface ChipItem {
|
|
|
135
135
|
isHorizontal?: boolean;
|
|
136
136
|
onPress?: (isDisabled: boolean, value: ChipOptionProps) => void;
|
|
137
137
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
138
|
+
itemTestID?: string;
|
|
138
139
|
}
|
|
139
140
|
export interface ChipProps {
|
|
140
141
|
options: ChipOptionProps[];
|
|
@@ -153,4 +154,5 @@ export interface ChipProps {
|
|
|
153
154
|
refreshing?: boolean;
|
|
154
155
|
footer?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
155
156
|
header?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
157
|
+
testID?: string;
|
|
156
158
|
}
|
|
@@ -4,6 +4,7 @@ import Color from '../Color/Color';
|
|
|
4
4
|
import Icon from '../Icon';
|
|
5
5
|
import type { CounterButtonType } from './type';
|
|
6
6
|
import { fontSizeMap } from '../Typography/type';
|
|
7
|
+
import { getTestID } from '../helpers/getTestID';
|
|
7
8
|
|
|
8
9
|
export default function CounterButton({
|
|
9
10
|
variant = 'default',
|
|
@@ -13,6 +14,7 @@ export default function CounterButton({
|
|
|
13
14
|
max,
|
|
14
15
|
disabledDecrease = false,
|
|
15
16
|
disabledIncrease = false,
|
|
17
|
+
testID,
|
|
16
18
|
}: CounterButtonType) {
|
|
17
19
|
const [count, setCount] = useState<number>(value);
|
|
18
20
|
const [inputValue, setInputValue] = useState<string>(String(value));
|
|
@@ -74,6 +76,7 @@ export default function CounterButton({
|
|
|
74
76
|
]}
|
|
75
77
|
>
|
|
76
78
|
<Pressable
|
|
79
|
+
testID={getTestID(testID, 'decrement')}
|
|
77
80
|
style={[
|
|
78
81
|
variant === 'default' ? styles.buttonDefault : styles.buttonColor,
|
|
79
82
|
isDecreaseDisabled && variant === 'color'
|
|
@@ -99,6 +102,7 @@ export default function CounterButton({
|
|
|
99
102
|
</Pressable>
|
|
100
103
|
|
|
101
104
|
<TextInput
|
|
105
|
+
testID={getTestID(testID, 'input')}
|
|
102
106
|
style={[
|
|
103
107
|
styles.input,
|
|
104
108
|
{ fontSize: fontSizeMap['t3'], color: Color.gray[900] },
|
|
@@ -109,6 +113,7 @@ export default function CounterButton({
|
|
|
109
113
|
/>
|
|
110
114
|
|
|
111
115
|
<Pressable
|
|
116
|
+
testID={getTestID(testID, 'increment')}
|
|
112
117
|
style={[
|
|
113
118
|
variant === 'default' ? styles.buttonDefault : styles.buttonColor,
|
|
114
119
|
isIncreaseDisabled && variant === 'color'
|
|
@@ -24,6 +24,7 @@ Komponen `CounterButton` adalah tombol penghitung sederhana (+ / -) yang digunak
|
|
|
24
24
|
| `variant` | `'default'` \| `'color'` | `'default'` | Menentukan gaya visual: `default` (outline) atau `color` (filled). |
|
|
25
25
|
| `disabledDecrease` | boolean | `'false'` | disabled decrease |
|
|
26
26
|
| `disabledIncrease` | boolean | `'false'` | disabled increase |
|
|
27
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-decrement`, `-input`, dan `-increment` untuk tiap elemen. |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type DateRangeProps,
|
|
12
12
|
} from '../Calendar/CalendarPropsType';
|
|
13
13
|
import Color from '../Color/Color';
|
|
14
|
+
import { getTestID } from '../helpers/getTestID';
|
|
14
15
|
|
|
15
16
|
interface DatePickerProps extends CalendarTypes {
|
|
16
17
|
onChange: (selectedDate: DateRangeProps) => void;
|
|
@@ -26,6 +27,7 @@ interface DatePickerProps extends CalendarTypes {
|
|
|
26
27
|
cancelLabel?: string;
|
|
27
28
|
isCancelButtonDisabled?: boolean;
|
|
28
29
|
isConfirmButtonDisabled?: boolean;
|
|
30
|
+
testID?: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export default function DatePicker({
|
|
@@ -42,6 +44,7 @@ export default function DatePicker({
|
|
|
42
44
|
cancelLabel = 'Batalkan',
|
|
43
45
|
isCancelButtonDisabled = false,
|
|
44
46
|
isConfirmButtonDisabled = false,
|
|
47
|
+
testID,
|
|
45
48
|
...calendarProps
|
|
46
49
|
}: DatePickerProps) {
|
|
47
50
|
const [errorValidate, setErrorValidate] = useState<boolean>(false);
|
|
@@ -136,12 +139,14 @@ export default function DatePicker({
|
|
|
136
139
|
return (
|
|
137
140
|
<View>
|
|
138
141
|
<BottomSheet
|
|
142
|
+
testID={getTestID(testID, 'sheet')}
|
|
139
143
|
isOpen={isOpen}
|
|
140
144
|
onClose={onClose}
|
|
141
145
|
footer={
|
|
142
146
|
<View style={styles.footerContainer}>
|
|
143
147
|
<View style={styles.buttonWrapper}>
|
|
144
148
|
<Button
|
|
149
|
+
testID={getTestID(testID, 'cancel')}
|
|
145
150
|
variant="tertiary"
|
|
146
151
|
title={cancelLabel}
|
|
147
152
|
color="primary"
|
|
@@ -151,6 +156,7 @@ export default function DatePicker({
|
|
|
151
156
|
</View>
|
|
152
157
|
<View style={styles.buttonWrapper}>
|
|
153
158
|
<Button
|
|
159
|
+
testID={getTestID(testID, 'confirm')}
|
|
154
160
|
title={confirmLabel}
|
|
155
161
|
color="primary"
|
|
156
162
|
onPress={handleOnPressSubmitButton}
|
|
@@ -166,11 +172,21 @@ export default function DatePicker({
|
|
|
166
172
|
onChange={handleOnChangeCalendar}
|
|
167
173
|
{...calendarProps}
|
|
168
174
|
/>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
{testID ? (
|
|
176
|
+
<View testID={getTestID(testID, 'error')}>
|
|
177
|
+
<Alert
|
|
178
|
+
color="danger"
|
|
179
|
+
message={hint ? hint : 'Error validation'}
|
|
180
|
+
hide={!errorValidate}
|
|
181
|
+
/>
|
|
182
|
+
</View>
|
|
183
|
+
) : (
|
|
184
|
+
<Alert
|
|
185
|
+
color="danger"
|
|
186
|
+
message={hint ? hint : 'Error validation'}
|
|
187
|
+
hide={!errorValidate}
|
|
188
|
+
/>
|
|
189
|
+
)}
|
|
174
190
|
</BottomSheet>
|
|
175
191
|
</View>
|
|
176
192
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react';
|
|
1
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
2
2
|
import { View, FlatList, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
4
4
|
import Typography from '../Typography/Typography';
|
|
5
5
|
import Button from '../Button/Button';
|
|
6
6
|
import Color from '../Color/Color';
|
|
7
7
|
import { generateMonthOptions } from './helpers';
|
|
8
|
+
import { getTestID } from '../helpers/getTestID';
|
|
8
9
|
|
|
9
10
|
type PickerMode = 'single' | 'range' | 'multiple';
|
|
10
11
|
|
|
@@ -15,9 +16,16 @@ interface MonthPickerProps {
|
|
|
15
16
|
value: number[] | { startDate: number | null; endDate: number | null }
|
|
16
17
|
) => void;
|
|
17
18
|
mode?: PickerMode;
|
|
19
|
+
/**
|
|
20
|
+
* The selection to open on, shaped exactly like what `onChange` reports:
|
|
21
|
+
* an array of 0-based months for single/multiple, a pair for range. Leave
|
|
22
|
+
* it out to let the sheet keep whatever it was last given by a tap.
|
|
23
|
+
*/
|
|
24
|
+
value?: number[] | { startDate: number | null; endDate: number | null };
|
|
18
25
|
title?: string;
|
|
19
26
|
cancelLabel?: string;
|
|
20
27
|
confirmLabel?: string;
|
|
28
|
+
testID?: string;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
export default function MonthPicker({
|
|
@@ -25,9 +33,11 @@ export default function MonthPicker({
|
|
|
25
33
|
onClose,
|
|
26
34
|
onChange,
|
|
27
35
|
mode = 'single',
|
|
36
|
+
value,
|
|
28
37
|
cancelLabel = 'Batal',
|
|
29
38
|
confirmLabel = 'pilih',
|
|
30
39
|
title = 'Pilih Bulan',
|
|
40
|
+
testID,
|
|
31
41
|
}: MonthPickerProps) {
|
|
32
42
|
const [rangeValue, setRangeValue] = useState<{
|
|
33
43
|
startDate: number | null;
|
|
@@ -36,6 +46,31 @@ export default function MonthPicker({
|
|
|
36
46
|
const [multipleValue, setMultipleValue] = useState<number[]>([]);
|
|
37
47
|
const [singleValue, setSingleValue] = useState<number | null>(null);
|
|
38
48
|
|
|
49
|
+
// Compared as a string, not by reference: a parent that rebuilds the value
|
|
50
|
+
// object on every render would otherwise wipe a selection mid-sheet.
|
|
51
|
+
const valueKey = JSON.stringify(value ?? null);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const incoming = JSON.parse(valueKey);
|
|
55
|
+
|
|
56
|
+
// No value at all means uncontrolled -- the sheet's own state is the
|
|
57
|
+
// only record of the selection, so don't touch it.
|
|
58
|
+
if (!isOpen || incoming === null) return;
|
|
59
|
+
|
|
60
|
+
if (Array.isArray(incoming)) {
|
|
61
|
+
setSingleValue(incoming[0] ?? null);
|
|
62
|
+
setMultipleValue(incoming);
|
|
63
|
+
setRangeValue({ startDate: null, endDate: null });
|
|
64
|
+
} else {
|
|
65
|
+
setSingleValue(null);
|
|
66
|
+
setMultipleValue([]);
|
|
67
|
+
setRangeValue({
|
|
68
|
+
startDate: incoming.startDate ?? null,
|
|
69
|
+
endDate: incoming.endDate ?? null,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, [isOpen, valueKey]);
|
|
73
|
+
|
|
39
74
|
const handleSelectMonth = useCallback(
|
|
40
75
|
(month: number) => {
|
|
41
76
|
if (mode === 'single') {
|
|
@@ -91,12 +126,14 @@ export default function MonthPicker({
|
|
|
91
126
|
|
|
92
127
|
return (
|
|
93
128
|
<BottomSheet
|
|
129
|
+
testID={getTestID(testID, 'sheet')}
|
|
94
130
|
isOpen={isOpen}
|
|
95
131
|
onClose={onClose}
|
|
96
132
|
footer={
|
|
97
133
|
<View style={styles.containerBottomSheetFooter}>
|
|
98
134
|
<View style={styles.flex1}>
|
|
99
135
|
<Button
|
|
136
|
+
testID={getTestID(testID, 'cancel')}
|
|
100
137
|
title={cancelLabel}
|
|
101
138
|
variant="tertiary"
|
|
102
139
|
size="medium"
|
|
@@ -106,6 +143,7 @@ export default function MonthPicker({
|
|
|
106
143
|
</View>
|
|
107
144
|
<View style={styles.flex1}>
|
|
108
145
|
<Button
|
|
146
|
+
testID={getTestID(testID, 'confirm')}
|
|
109
147
|
title={confirmLabel}
|
|
110
148
|
color="primary"
|
|
111
149
|
size="medium"
|
|
@@ -137,6 +175,7 @@ export default function MonthPicker({
|
|
|
137
175
|
return (
|
|
138
176
|
<View style={styles.yearItem}>
|
|
139
177
|
<TouchableOpacity
|
|
178
|
+
testID={getTestID(testID, `option-${item.value}`)}
|
|
140
179
|
onPress={() => handleSelectMonth(item.value)}
|
|
141
180
|
style={[
|
|
142
181
|
styles.option,
|
|
@@ -26,6 +26,7 @@ Komponen ini extend dari Calendar, jadi kalian bisa menggunakan semua props yang
|
|
|
26
26
|
| `isOpen` | `boolean` | Menentukan apakah BottomSheet sedang terbuka |
|
|
27
27
|
| `hasError` | `boolean` | (Opsional) Menandai jika terjadi kesalahan validasi |
|
|
28
28
|
| `value` | DateRangeProps | (Opsional) set default value |
|
|
29
|
+
| `testID` | `string` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-sheet`, `-cancel`, `-confirm`, dan `-error`. |
|
|
29
30
|
|
|
30
31
|
---
|
|
31
32
|
|
|
@@ -14,6 +14,8 @@ Komponen **MonthPicker** adalah komponen pemilih bulan berbasis **React Native**
|
|
|
14
14
|
| `onClose` | `() => void` | `undefined` | Callback yang dipanggil saat pengguna menekan tombol **Batal** atau menutup **BottomSheet**. |
|
|
15
15
|
| `onChange` | `(value: number[] \| { startDate: number \| null; endDate: number \| null }) => void` | `undefined` | Callback yang dipanggil ketika pengguna menekan tombol **Pilih**. Parameter yang dikirim tergantung pada `mode`. |
|
|
16
16
|
| `mode` | `'single' \| 'range' \| 'multiple'` | `'single'` | Menentukan cara pemilihan bulan. |
|
|
17
|
+
| `value` | `number[] \| { startDate: number \| null; endDate: number \| null }` | `undefined` | Pilihan yang ditandai saat sheet dibuka. Bentuknya sama persis dengan yang dilaporkan `onChange`, jadi nilai dari `onChange` bisa langsung dikembalikan ke sini. Jika tidak diisi, picker hanya mengingat pilihan dari tap-nya sendiri. |
|
|
18
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-sheet`, `-cancel`, `-confirm`, dan `-option-{value}` untuk tiap bulan. |
|
|
17
19
|
|
|
18
20
|
### Bentuk *value* yang Dikirim oleh `onChange`
|
|
19
21
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
| `onClose` | `() => void` | `-` | Callback saat pengguna menutup **BottomSheet** atau menekan tombol **Batal**. |
|
|
13
13
|
| `onChange` | `(value: { hour: number; minute: number }) => void` | `-` | Callback saat pengguna menekan tombol **Pilih**. Objek yang dikirim berisi `hour` & `minute`. |
|
|
14
14
|
| `value` | `{ hour: number; minute: number }` | `{hour: 0, minute: 0}` | Props untuk mengontrol value dari parent |
|
|
15
|
+
| `testID` | `string` | `-` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-sheet`, `-cancel`, `-confirm`, `-hour`, dan `-minute`. |
|
|
15
16
|
|
|
16
17
|
### Bentuk _value_ `onChange`
|
|
17
18
|
|
|
@@ -18,6 +18,8 @@ Semua outputnya dibungkus dalam komponen **BottomSheet** untuk konsistensi UI.
|
|
|
18
18
|
| `onClose` | `() => void` | `-` | Dipanggil saat pengguna menutup picker atau menekan **Batal**. |
|
|
19
19
|
| `onChange` | `(value: number[] \| { startDate: number \| null; endDate: number \| null }) => void` | `-` | Dipanggil setelah pengguna menekan **Pilih**. Bentuk *value* bergantung pada `mode`. |
|
|
20
20
|
| `mode` | `'single' \| 'range' \| 'multiple'` | `'single'` | Menentukan mode pemilihan. |
|
|
21
|
+
| `value` | `number[] \| { startDate: number \| null; endDate: number \| null }` | `-` | Pilihan yang ditandai saat sheet dibuka; halaman ikut berpindah ke tahun tersebut. Bentuknya sama persis dengan yang dilaporkan `onChange`. Jika tidak diisi, picker hanya mengingat pilihan dari tap-nya sendiri. |
|
|
22
|
+
| `testID` | `string` | `-` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-sheet`, `-cancel`, `-confirm`, dan `-option-{year}` untuk tiap tahun. |
|
|
21
23
|
|
|
22
24
|
### Bentuk *value* `onChange`
|
|
23
25
|
|
|
@@ -13,6 +13,7 @@ import Button from '../Button/Button';
|
|
|
13
13
|
import Color from '../Color/Color';
|
|
14
14
|
import Typography from '../Typography/Typography';
|
|
15
15
|
import AnimatedItem from './partials/AnimatedItem';
|
|
16
|
+
import { getTestID } from '../helpers/getTestID';
|
|
16
17
|
|
|
17
18
|
const ITEM_HEIGHT = 40;
|
|
18
19
|
const SCREEN_WIDTH = Dimensions.get('window').width;
|
|
@@ -29,6 +30,7 @@ interface TimePickerProps {
|
|
|
29
30
|
title?: string;
|
|
30
31
|
confirmLabel?: string;
|
|
31
32
|
cancelLabel?: string;
|
|
33
|
+
testID?: string;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
const generateInfiniteData = (max: number, cycles: number) => {
|
|
@@ -44,6 +46,7 @@ export default function TimePickerWheel({
|
|
|
44
46
|
title = 'Pilih Waktu',
|
|
45
47
|
cancelLabel = 'Batal',
|
|
46
48
|
confirmLabel = 'Pilih',
|
|
49
|
+
testID,
|
|
47
50
|
}: TimePickerProps) {
|
|
48
51
|
const [selectedHour, setSelectedHour] = useState<number>(value?.hour ?? 0);
|
|
49
52
|
const [selectedMinute, setSelectedMinute] = useState<number>(
|
|
@@ -188,12 +191,14 @@ export default function TimePickerWheel({
|
|
|
188
191
|
|
|
189
192
|
return (
|
|
190
193
|
<BottomSheet
|
|
194
|
+
testID={getTestID(testID, 'sheet')}
|
|
191
195
|
isOpen={isOpen}
|
|
192
196
|
onClose={onClose}
|
|
193
197
|
footer={
|
|
194
198
|
<View style={styles.footer}>
|
|
195
199
|
<View style={styles.flex1}>
|
|
196
200
|
<Button
|
|
201
|
+
testID={getTestID(testID, 'cancel')}
|
|
197
202
|
title={cancelLabel}
|
|
198
203
|
variant="tertiary"
|
|
199
204
|
onPress={onClose}
|
|
@@ -203,6 +208,7 @@ export default function TimePickerWheel({
|
|
|
203
208
|
</View>
|
|
204
209
|
<View style={styles.flex1}>
|
|
205
210
|
<Button
|
|
211
|
+
testID={getTestID(testID, 'confirm')}
|
|
206
212
|
title={confirmLabel}
|
|
207
213
|
onPress={handleSubmit}
|
|
208
214
|
color="primary"
|
|
@@ -232,6 +238,7 @@ export default function TimePickerWheel({
|
|
|
232
238
|
{/* Hour Picker */}
|
|
233
239
|
<View style={styles.pickerColumn}>
|
|
234
240
|
<Animated.FlatList
|
|
241
|
+
testID={getTestID(testID, 'hour')}
|
|
235
242
|
ref={hourRef}
|
|
236
243
|
data={hours}
|
|
237
244
|
renderItem={renderHourItem}
|
|
@@ -258,6 +265,7 @@ export default function TimePickerWheel({
|
|
|
258
265
|
{/* Minute Picker */}
|
|
259
266
|
<View style={styles.pickerColumn}>
|
|
260
267
|
<Animated.FlatList
|
|
268
|
+
testID={getTestID(testID, 'minute')}
|
|
261
269
|
ref={minuteRef}
|
|
262
270
|
data={minutes}
|
|
263
271
|
renderItem={renderMinuteItem}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
1
|
+
import { useState, useCallback, useMemo, useEffect } from 'react';
|
|
2
2
|
import { View, FlatList, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import BottomSheet from '../BottomSheet/BottomSheet';
|
|
4
4
|
import Typography from '../Typography/Typography';
|
|
5
5
|
import Button from '../Button/Button';
|
|
6
6
|
import Color from '../Color/Color';
|
|
7
7
|
import Icon from '../Icon';
|
|
8
|
+
import { getTestID } from '../helpers/getTestID';
|
|
8
9
|
|
|
9
10
|
type PickerMode = 'single' | 'range' | 'multiple';
|
|
10
11
|
|
|
@@ -15,6 +16,16 @@ interface YearPickerProps {
|
|
|
15
16
|
value: number[] | { startDate: number | null; endDate: number | null }
|
|
16
17
|
) => void;
|
|
17
18
|
mode?: PickerMode;
|
|
19
|
+
/**
|
|
20
|
+
* The selection to open on, shaped exactly like what `onChange` reports:
|
|
21
|
+
* an array of years for single/multiple, a pair for range. Leave it out to
|
|
22
|
+
* let the sheet keep whatever it was last given by a tap.
|
|
23
|
+
*/
|
|
24
|
+
value?: number[] | { startDate: number | null; endDate: number | null };
|
|
25
|
+
title?: string;
|
|
26
|
+
cancelLabel?: string;
|
|
27
|
+
confirmLabel?: string;
|
|
28
|
+
testID?: string;
|
|
18
29
|
}
|
|
19
30
|
|
|
20
31
|
export default function YearPicker({
|
|
@@ -22,6 +33,11 @@ export default function YearPicker({
|
|
|
22
33
|
onClose,
|
|
23
34
|
onChange,
|
|
24
35
|
mode = 'single',
|
|
36
|
+
value,
|
|
37
|
+
title = 'Pilih Tahun',
|
|
38
|
+
cancelLabel = 'Batal',
|
|
39
|
+
confirmLabel = 'Pilih',
|
|
40
|
+
testID,
|
|
25
41
|
}: YearPickerProps) {
|
|
26
42
|
const currentYear = new Date().getFullYear();
|
|
27
43
|
const pageSize = 9;
|
|
@@ -50,6 +66,41 @@ export default function YearPicker({
|
|
|
50
66
|
return years.slice(start, start + pageSize);
|
|
51
67
|
}, [years, pageIndex]);
|
|
52
68
|
|
|
69
|
+
// Compared as a string, not by reference: a parent that rebuilds the value
|
|
70
|
+
// object on every render would otherwise wipe a selection mid-sheet.
|
|
71
|
+
const valueKey = JSON.stringify(value ?? null);
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const incoming = JSON.parse(valueKey);
|
|
75
|
+
|
|
76
|
+
// No value at all means uncontrolled -- the sheet's own state is the
|
|
77
|
+
// only record of the selection, so don't touch it.
|
|
78
|
+
if (!isOpen || incoming === null) return;
|
|
79
|
+
|
|
80
|
+
// The year the sheet should be looking at: a lone selection, or the start
|
|
81
|
+
// of a range. Years run 121 deep across pages, so without this the sheet
|
|
82
|
+
// opens on the current year and the highlight is off-screen.
|
|
83
|
+
let anchor: number | null;
|
|
84
|
+
|
|
85
|
+
if (Array.isArray(incoming)) {
|
|
86
|
+
setSingleValue(incoming[0] ?? null);
|
|
87
|
+
setMultipleValue(incoming);
|
|
88
|
+
setRangeValue({ startDate: null, endDate: null });
|
|
89
|
+
anchor = incoming[0] ?? null;
|
|
90
|
+
} else {
|
|
91
|
+
setSingleValue(null);
|
|
92
|
+
setMultipleValue([]);
|
|
93
|
+
setRangeValue({
|
|
94
|
+
startDate: incoming.startDate ?? null,
|
|
95
|
+
endDate: incoming.endDate ?? null,
|
|
96
|
+
});
|
|
97
|
+
anchor = incoming.startDate ?? null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const anchorIndex = anchor === null ? -1 : years.indexOf(anchor);
|
|
101
|
+
if (anchorIndex !== -1) setPageIndex(Math.floor(anchorIndex / pageSize));
|
|
102
|
+
}, [isOpen, valueKey, years]);
|
|
103
|
+
|
|
53
104
|
const handleSelectYear = useCallback(
|
|
54
105
|
(year: number) => {
|
|
55
106
|
if (mode === 'single') {
|
|
@@ -103,13 +154,15 @@ export default function YearPicker({
|
|
|
103
154
|
|
|
104
155
|
return (
|
|
105
156
|
<BottomSheet
|
|
157
|
+
testID={getTestID(testID, 'sheet')}
|
|
106
158
|
isOpen={isOpen}
|
|
107
159
|
onClose={onClose}
|
|
108
160
|
footer={
|
|
109
161
|
<View style={styles.containerBottomSheetFooter}>
|
|
110
162
|
<View style={styles.flex1}>
|
|
111
163
|
<Button
|
|
112
|
-
|
|
164
|
+
testID={getTestID(testID, 'cancel')}
|
|
165
|
+
title={cancelLabel}
|
|
113
166
|
variant="tertiary"
|
|
114
167
|
size="medium"
|
|
115
168
|
color="primary"
|
|
@@ -118,7 +171,8 @@ export default function YearPicker({
|
|
|
118
171
|
</View>
|
|
119
172
|
<View style={styles.flex1}>
|
|
120
173
|
<Button
|
|
121
|
-
|
|
174
|
+
testID={getTestID(testID, 'confirm')}
|
|
175
|
+
title={confirmLabel}
|
|
122
176
|
color="primary"
|
|
123
177
|
size="medium"
|
|
124
178
|
onPress={handleSubmit}
|
|
@@ -136,7 +190,7 @@ export default function YearPicker({
|
|
|
136
190
|
<Icon name="ArrowLeft" color={Color.base.white100} size={10} />
|
|
137
191
|
</TouchableOpacity>
|
|
138
192
|
<Typography variant="t1" weight="semibold" color={Color.gray[900]}>
|
|
139
|
-
|
|
193
|
+
{title}
|
|
140
194
|
</Typography>
|
|
141
195
|
<TouchableOpacity
|
|
142
196
|
style={styles.buttonNav}
|
|
@@ -162,6 +216,7 @@ export default function YearPicker({
|
|
|
162
216
|
return (
|
|
163
217
|
<View style={styles.yearItem}>
|
|
164
218
|
<TouchableOpacity
|
|
219
|
+
testID={getTestID(testID, `option-${item}`)}
|
|
165
220
|
onPress={() => handleSelectYear(item)}
|
|
166
221
|
style={[
|
|
167
222
|
styles.option,
|
package/src/Drawing/Drawing.tsx
CHANGED
|
@@ -16,6 +16,7 @@ interface DrawingProps {
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
hint?: string;
|
|
18
18
|
hasError?: boolean;
|
|
19
|
+
testID?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const Drawing = ({
|
|
@@ -26,6 +27,7 @@ const Drawing = ({
|
|
|
26
27
|
disabled,
|
|
27
28
|
hint,
|
|
28
29
|
hasError,
|
|
30
|
+
testID,
|
|
29
31
|
}: DrawingProps) => {
|
|
30
32
|
const ref = useRef<SignatureViewRef | null>(null);
|
|
31
33
|
|
|
@@ -108,7 +110,7 @@ const Drawing = ({
|
|
|
108
110
|
}, [dataURL]);
|
|
109
111
|
|
|
110
112
|
return (
|
|
111
|
-
<View style={styles.container}>
|
|
113
|
+
<View testID={testID} style={styles.container}>
|
|
112
114
|
<View style={styles.drawerContainer}>
|
|
113
115
|
<SignatureCanvas
|
|
114
116
|
key={canvasKey}
|
package/src/Drawing/README.md
CHANGED
|
@@ -56,3 +56,4 @@ export default function SignatureForm() {
|
|
|
56
56
|
| Prop | Tipe | Default | Deskripsi |
|
|
57
57
|
| -------- | -------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
58
58
|
| `onDraw` | `(value?: string \| undefined) ⇒ void` | `undefined` | Callback berisi tanda tangan **base64** saat pengguna menggambar (dipicu otomatis di `onDraw`). |
|
|
59
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Diterapkan langsung ke elemen akar, tanpa suffix. |
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import Color from '../Color/Color';
|
|
15
15
|
import type { DropDownProps } from './type';
|
|
16
16
|
import type { ChipOptionProps } from '../Chip/type';
|
|
17
|
+
import { getTestID } from '../helpers/getTestID';
|
|
17
18
|
|
|
18
19
|
const Dropdown = ({
|
|
19
20
|
options,
|
|
@@ -23,6 +24,7 @@ const Dropdown = ({
|
|
|
23
24
|
renderItem,
|
|
24
25
|
width,
|
|
25
26
|
value,
|
|
27
|
+
testID,
|
|
26
28
|
}: DropDownProps) => {
|
|
27
29
|
const [isOpen, setIsOpen] = useState(false);
|
|
28
30
|
const [selected, setSelected] = useState<string | number>();
|
|
@@ -67,12 +69,17 @@ const Dropdown = ({
|
|
|
67
69
|
|
|
68
70
|
return (
|
|
69
71
|
<>
|
|
70
|
-
<TouchableOpacity
|
|
72
|
+
<TouchableOpacity
|
|
73
|
+
testID={getTestID(testID, 'trigger')}
|
|
74
|
+
ref={buttonRef}
|
|
75
|
+
onPress={handleToggle}
|
|
76
|
+
>
|
|
71
77
|
{renderButton}
|
|
72
78
|
</TouchableOpacity>
|
|
73
79
|
{isOpen && (
|
|
74
80
|
<Modal transparent animationType="none" visible>
|
|
75
81
|
<Pressable
|
|
82
|
+
testID={getTestID(testID, 'modal')}
|
|
76
83
|
style={StyleSheet.absoluteFillObject}
|
|
77
84
|
onPress={() => setIsOpen(false)}
|
|
78
85
|
/>
|
|
@@ -95,6 +102,10 @@ const Dropdown = ({
|
|
|
95
102
|
{options.map((item, idx) => (
|
|
96
103
|
<TouchableOpacity
|
|
97
104
|
key={idx}
|
|
105
|
+
testID={getTestID(
|
|
106
|
+
testID,
|
|
107
|
+
item.value != null ? `option-${item.value}` : `item-${idx}`
|
|
108
|
+
)}
|
|
98
109
|
onPress={() => handlePressOption(item)}
|
|
99
110
|
style={[
|
|
100
111
|
styles.option,
|
package/src/DropDown/README.md
CHANGED
|
@@ -26,6 +26,7 @@ Serta modul standar React Native: `Modal`, `ScrollView`, dll. Tidak memerlukan l
|
|
|
26
26
|
| `renderItem` | `React.ReactNode` | `undefined` | Elemen yang dipakai sebagai tombol di tiap item yang ada di dalam dropdown |
|
|
27
27
|
| `width` | `number` | `undefined` | Angka yang digunakan untuk mengatur lebar pembungkus list |
|
|
28
28
|
| `value` | `number \| string` | `undefined` | Props yang dapat memungkinkan state selected dari luar |
|
|
29
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-trigger`, `-modal`, dan `-option-{value}` (atau `-item-{index}` jika opsi tidak memiliki `value`) untuk tiap opsi. |
|
|
29
30
|
|
|
30
31
|
### Struktur `ChipOptionProps`
|
|
31
32
|
|
package/src/DropDown/type.tsx
CHANGED
|
@@ -13,3 +13,14 @@ npm install react-native-pdf
|
|
|
13
13
|
# atau
|
|
14
14
|
yarn add react-native-pdf
|
|
15
15
|
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Props | Tipe | Wajib | Default | Deskripsi |
|
|
22
|
+
| -------- | --------------------------------- | ----- | ------- | ----------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `source` | `{ uri, headers, cache, ... }` | ✅ | - | Sumber dokumen PDF. Kalau kosong, komponen merender container placeholder. |
|
|
24
|
+
| `testID` | `string` | ❌ | - | ID untuk automation testing (Maestro/Detox/Appium). Tetap terpasang pada placeholder saat `source` kosong. |
|
|
25
|
+
|
|
26
|
+
Props lain diteruskan apa adanya ke `Pdf` dari `react-native-pdf`.
|
package/src/FileView/PdfView.tsx
CHANGED
|
@@ -14,13 +14,14 @@ type Source = {
|
|
|
14
14
|
|
|
15
15
|
interface Props extends React.ComponentProps<typeof Pdf> {
|
|
16
16
|
source: Source;
|
|
17
|
+
testID?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const PdfView = ({ source, ...props }: Props) => {
|
|
20
|
-
if (!source) return <View />;
|
|
20
|
+
const PdfView = ({ source, testID, ...props }: Props) => {
|
|
21
|
+
if (!source) return <View testID={testID} />;
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
|
-
<View style={styles.container}>
|
|
24
|
+
<View testID={testID} style={styles.container}>
|
|
24
25
|
<Pdf source={source} style={styles.pdf} {...props} />
|
|
25
26
|
</View>
|
|
26
27
|
);
|
package/src/Icon/Icon.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ViewStyle } from 'react-native';
|
|
2
|
+
import { View, type ViewStyle } from 'react-native';
|
|
3
3
|
import AirPlane from './icons/AirPlane';
|
|
4
4
|
import AlignCenter from './icons/AlignCenter';
|
|
5
5
|
import AlignLeft from './icons/AlignLeft';
|
|
@@ -353,6 +353,7 @@ const Icon: React.FC<IconProps> = ({
|
|
|
353
353
|
size = 24,
|
|
354
354
|
color = '#000',
|
|
355
355
|
style,
|
|
356
|
+
testID,
|
|
356
357
|
}) => {
|
|
357
358
|
const SelectedIcon = icons[name];
|
|
358
359
|
|
|
@@ -360,7 +361,14 @@ const Icon: React.FC<IconProps> = ({
|
|
|
360
361
|
return null;
|
|
361
362
|
}
|
|
362
363
|
|
|
363
|
-
|
|
364
|
+
const icon = <SelectedIcon size={size} color={color} style={style} />;
|
|
365
|
+
|
|
366
|
+
// The 170 files in ./icons take only size/color and spread nothing, so a
|
|
367
|
+
// testID handed to them would be dropped. Wrapping is the one-file fix --
|
|
368
|
+
// and only when an id is actually asked for, so existing call sites keep
|
|
369
|
+
// their exact tree. Teaching every icon to forward testID would be the
|
|
370
|
+
// thorough fix; it is a 170-file codemod and not what this change is.
|
|
371
|
+
return testID ? <View testID={testID}>{icon}</View> : icon;
|
|
364
372
|
};
|
|
365
373
|
|
|
366
374
|
export default Icon;
|
package/src/Icon/README.md
CHANGED
|
@@ -45,6 +45,7 @@ export default function App() {
|
|
|
45
45
|
| `size` | number | 24 | Ukuran icon dalam piksel |
|
|
46
46
|
| `color` | string | "#000" | Warna icon |
|
|
47
47
|
| `style` | object | `{}` | Gaya tambahan (optional) |
|
|
48
|
+
| `testID` | `string` | - | ID untuk automation testing. Ikon dibungkus View ber-testID hanya saat prop ini diisi. |
|
|
48
49
|
|
|
49
50
|
## Daftar Icon
|
|
50
51
|
|