@herca/rn-kit 0.1.112 → 0.1.114
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 +7 -1
- 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 +1 -0
- package/lib/module/DatePicker/README_TIMEPICKER.md +1 -0
- package/lib/module/DatePicker/README_YEARPICKER.md +1 -0
- package/lib/module/DatePicker/TimePicker.js +8 -1
- package/lib/module/DatePicker/TimePicker.js.map +1 -1
- package/lib/module/DatePicker/YearPicker.js +13 -4
- 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 +19 -3
- package/lib/module/Icon/Icon.js.map +1 -1
- package/lib/module/Icon/README.md +1 -0
- package/lib/module/Icon/icons/FileListStar.js +22 -0
- package/lib/module/Icon/icons/FileListStar.js.map +1 -0
- package/lib/module/Icon/icons/TextFill.js +22 -0
- package/lib/module/Icon/icons/TextFill.js.map +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 +111 -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 +94 -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/Typography/type.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 +2 -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 +5 -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/icons/FileListStar.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/FileListStar.d.ts.map +1 -0
- package/lib/typescript/src/Icon/icons/TextFill.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/TextFill.d.ts.map +1 -0
- package/lib/typescript/src/Icon/type.d.ts +2 -1
- 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 +19 -6
- 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 +7 -0
- package/src/DatePicker/README_DATEPICKER.md +1 -0
- package/src/DatePicker/README_MONTHPICKER.md +1 -0
- package/src/DatePicker/README_TIMEPICKER.md +1 -0
- package/src/DatePicker/README_YEARPICKER.md +1 -0
- package/src/DatePicker/TimePicker.tsx +8 -0
- package/src/DatePicker/YearPicker.tsx +16 -3
- 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 +14 -2
- package/src/Icon/README.md +1 -0
- package/src/Icon/icons/FileListStar.tsx +23 -0
- package/src/Icon/icons/TextFill.tsx +19 -0
- package/src/Icon/type.tsx +3 -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 +152 -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 +125 -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 +2 -10
- 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/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';
|
|
@@ -169,6 +169,8 @@ import WhatsAppFill from './icons/WhatsappFill';
|
|
|
169
169
|
import XCircle from './icons/XCircle';
|
|
170
170
|
import type { IconNameProps, IconProps } from './type';
|
|
171
171
|
import BanOutline from './icons/BanOutline';
|
|
172
|
+
import FileListStar from './icons/FileListStar';
|
|
173
|
+
import TextFill from './icons/TextFill';
|
|
172
174
|
|
|
173
175
|
const icons: Record<
|
|
174
176
|
IconNameProps,
|
|
@@ -342,6 +344,8 @@ const icons: Record<
|
|
|
342
344
|
'play-fill': PlayFill,
|
|
343
345
|
'users-fill-bulk': UsersFillBulk,
|
|
344
346
|
'ban-outline': BanOutline,
|
|
347
|
+
'file-list-star-fill': FileListStar,
|
|
348
|
+
'text-fill': TextFill,
|
|
345
349
|
};
|
|
346
350
|
|
|
347
351
|
const Icon: React.FC<IconProps> = ({
|
|
@@ -349,6 +353,7 @@ const Icon: React.FC<IconProps> = ({
|
|
|
349
353
|
size = 24,
|
|
350
354
|
color = '#000',
|
|
351
355
|
style,
|
|
356
|
+
testID,
|
|
352
357
|
}) => {
|
|
353
358
|
const SelectedIcon = icons[name];
|
|
354
359
|
|
|
@@ -356,7 +361,14 @@ const Icon: React.FC<IconProps> = ({
|
|
|
356
361
|
return null;
|
|
357
362
|
}
|
|
358
363
|
|
|
359
|
-
|
|
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;
|
|
360
372
|
};
|
|
361
373
|
|
|
362
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
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
style?: object;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FileListStar: React.FC<Props> = ({
|
|
11
|
+
size = 24,
|
|
12
|
+
color = '#909090',
|
|
13
|
+
style,
|
|
14
|
+
}) => (
|
|
15
|
+
<Svg width={size} height={size} viewBox="0 0 65 65" fill="none" style={style}>
|
|
16
|
+
<Path
|
|
17
|
+
d="M34.0258 16.012V10.0074L46.035 22.0166H40.0304C35.8138 22.0166 34.0258 20.2286 34.0258 16.012ZM34.9067 51.8262L37.1213 53.9344L36.8548 55.4288C36.8548 55.4288 36.7213 56.0427 36.1075 56.0427C35.4937 56.0427 16.012 56.0427 16.012 56.0427C10.6746 56.0427 8.00586 53.374 8.00586 48.0365L8.00586 16.012C8.00586 10.6746 10.6746 8.00586 16.012 8.00586L30.0227 8.00586V16.012C30.0227 22.4703 33.5721 26.0197 40.0304 26.0197H48.0365V36.4276C48.0365 37.2816 47.1559 37.3617 46.7022 37.3617C44.754 37.3617 42.9928 38.4291 42.1388 40.1638L40.8044 42.7792L37.6823 43.2329C35.7608 43.4998 34.1862 44.8074 33.599 46.6755C33.0119 48.5169 33.519 50.4918 34.9067 51.8262ZM23.351 32.0243C23.351 33.1291 24.2476 34.0258 25.3525 34.0258H37.3617C38.4665 34.0258 39.3632 33.1291 39.3632 32.0243C39.3632 30.9194 38.4665 30.0227 37.3617 30.0227H25.3525C24.2476 30.0227 23.351 30.9194 23.351 32.0243ZM20.6822 42.6991C20.6822 41.5943 19.7856 40.6976 18.6807 40.6976C17.5759 40.6976 16.6792 41.5943 16.6792 42.6991C16.6792 43.804 17.5759 44.7007 18.6807 44.7007C19.7856 44.7007 20.6822 43.804 20.6822 42.6991ZM20.6822 32.0243C20.6822 30.9194 19.7856 30.0227 18.6807 30.0227C17.5759 30.0227 16.6792 30.9194 16.6792 32.0243C16.6792 33.1291 17.5759 34.0258 18.6807 34.0258C19.7856 34.0258 20.6822 33.1291 20.6822 32.0243ZM31.3571 42.6991C31.3571 41.5943 30.4604 40.6976 29.3556 40.6976H25.3525C24.2476 40.6976 23.351 41.5943 23.351 42.6991C23.351 43.804 24.2476 44.7007 25.3525 44.7007H29.3556C30.4604 44.7007 31.3571 43.804 31.3571 42.6991ZM55.728 48.9279C56.3471 48.3382 56.0054 47.308 55.1514 47.1879L50.5 46.526C50.1611 46.478 49.867 46.2699 49.7175 45.9683L47.703 41.9705C47.2946 41.1592 46.115 41.1592 45.704 41.9705L43.6895 45.9683C43.5373 46.2699 43.2432 46.478 42.907 46.526L38.2556 47.1879C37.4016 47.308 37.0625 48.3382 37.679 48.9279L41.0416 52.1357C41.2871 52.3706 41.3994 52.7095 41.3407 53.0404L40.5718 57.4278C40.4144 58.3191 41.3704 58.9996 42.187 58.5806L46.2194 56.5071C46.521 56.3523 46.8834 56.3523 47.185 56.5071L51.2206 58.5833C52.0373 59.0023 52.99 58.3244 52.8325 57.4331L52.0637 53.0404C52.005 52.7095 52.1173 52.3706 52.3628 52.1357L55.728 48.9279Z"
|
|
18
|
+
fill={color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default FileListStar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
style?: object;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const TextFill: React.FC<Props> = ({ size = 24, color = '#000', style }) => (
|
|
11
|
+
<Svg width={size} height={size} viewBox="0 0 20 20" fill="none" style={style}>
|
|
12
|
+
<Path
|
|
13
|
+
d="M17.4577 3.4415C17.216 3.0915 16.9077 2.78317 16.5577 2.5415C15.766 1.9665 14.7327 1.6665 13.491 1.6665H6.50768C6.34102 1.6665 6.17435 1.67484 6.01602 1.6915C3.28268 1.8665 1.66602 3.6415 1.66602 6.50817V13.4915C1.66602 14.7332 1.96602 15.7665 2.54102 16.5582C2.78268 16.9082 3.09102 17.2165 3.44102 17.4582C4.12435 17.9582 4.99102 18.2498 6.01602 18.3165C6.17435 18.3248 6.34102 18.3332 6.50768 18.3332H13.491C16.5243 18.3332 18.3327 16.5248 18.3327 13.4915V6.50817C18.3327 5.2665 18.0327 4.23317 17.4577 3.4415ZM15.6243 7.4165C15.6243 7.75817 15.341 8.0415 14.9993 8.0415C14.6577 8.0415 14.3743 7.75817 14.3743 7.4165V6.43317C14.3743 6.1665 14.1577 5.94984 13.891 5.94984H10.6243V14.0498H12.1077C12.4493 14.0498 12.7327 14.3332 12.7327 14.6748C12.7327 15.0165 12.4493 15.2998 12.1077 15.2998H7.89102C7.54935 15.2998 7.26602 15.0165 7.26602 14.6748C7.26602 14.3332 7.54935 14.0498 7.89102 14.0498H9.37435V5.94984H6.10768C5.84102 5.94984 5.62435 6.1665 5.62435 6.43317V7.4165C5.62435 7.75817 5.34102 8.0415 4.99935 8.0415C4.65768 8.0415 4.37435 7.75817 4.37435 7.4165V6.43317C4.37435 5.47484 5.14935 4.69984 6.10768 4.69984H13.8827C14.841 4.69984 15.616 5.47484 15.616 6.43317V7.4165H15.6243Z"
|
|
14
|
+
fill={color}
|
|
15
|
+
/>
|
|
16
|
+
</Svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default TextFill;
|
package/src/Icon/type.tsx
CHANGED
|
@@ -170,10 +170,13 @@ export type IconNameProps =
|
|
|
170
170
|
| 'file-list-plus-fill-bulk'
|
|
171
171
|
| 'play-fill'
|
|
172
172
|
| 'ban-outline'
|
|
173
|
+
| 'file-list-star-fill'
|
|
174
|
+
| 'text-fill'
|
|
173
175
|
| 'cube-scan';
|
|
174
176
|
export interface IconProps {
|
|
175
177
|
name: IconNameProps;
|
|
176
178
|
size?: number;
|
|
177
179
|
color?: string;
|
|
178
180
|
style?: ViewStyle;
|
|
181
|
+
testID?: string;
|
|
179
182
|
}
|
package/src/Input/Input.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Icon } from '../Icon';
|
|
|
4
4
|
import Color from '../Color/Color';
|
|
5
5
|
import LabelForm from '../LabelForm/LabelForm';
|
|
6
6
|
import Typography from '../Typography/Typography';
|
|
7
|
+
import { getTestID } from '../helpers/getTestID';
|
|
7
8
|
import type { InputProps } from './type';
|
|
8
9
|
|
|
9
10
|
const Input = React.forwardRef<TextInput, InputProps>(
|
|
@@ -24,6 +25,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
24
25
|
iconRightColor,
|
|
25
26
|
prefix,
|
|
26
27
|
required = false,
|
|
28
|
+
testID,
|
|
27
29
|
...rest
|
|
28
30
|
},
|
|
29
31
|
ref
|
|
@@ -50,7 +52,13 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
50
52
|
|
|
51
53
|
return (
|
|
52
54
|
<View style={styles.gap}>
|
|
53
|
-
{label ?
|
|
55
|
+
{label ? (
|
|
56
|
+
<LabelForm
|
|
57
|
+
testID={getTestID(testID, 'label')}
|
|
58
|
+
title={label}
|
|
59
|
+
required={required}
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
54
62
|
|
|
55
63
|
<View
|
|
56
64
|
style={[
|
|
@@ -69,6 +77,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
69
77
|
{prefix && <View style={styles.prefixContainer}>{prefix}</View>}
|
|
70
78
|
|
|
71
79
|
<TextInput
|
|
80
|
+
testID={getTestID(testID, 'input')}
|
|
72
81
|
{...rest}
|
|
73
82
|
ref={ref}
|
|
74
83
|
style={[styles.input, style]}
|
|
@@ -82,6 +91,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
82
91
|
<View style={styles.rightContainer}>
|
|
83
92
|
{clearButton && inputValue !== '' && (
|
|
84
93
|
<TouchableOpacity
|
|
94
|
+
testID={getTestID(testID, 'clear')}
|
|
85
95
|
onPress={handleClear}
|
|
86
96
|
style={iconRight && styles.mr8}
|
|
87
97
|
>
|
|
@@ -89,7 +99,11 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
89
99
|
</TouchableOpacity>
|
|
90
100
|
)}
|
|
91
101
|
{iconRight && (
|
|
92
|
-
<TouchableOpacity
|
|
102
|
+
<TouchableOpacity
|
|
103
|
+
testID={getTestID(testID, 'toggle')}
|
|
104
|
+
onPress={onPressIconRight}
|
|
105
|
+
hitSlop={10}
|
|
106
|
+
>
|
|
93
107
|
<Icon
|
|
94
108
|
name={iconRight}
|
|
95
109
|
size={20}
|
|
@@ -102,6 +116,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
|
|
|
102
116
|
</View>
|
|
103
117
|
{hint ? (
|
|
104
118
|
<Typography
|
|
119
|
+
testID={getTestID(testID, 'error')}
|
|
105
120
|
color={hasError ? Color.danger[500] : Color.gray[700]}
|
|
106
121
|
variant="t3"
|
|
107
122
|
weight="medium"
|
package/src/Input/InputDate.tsx
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from '
|
|
1
|
+
import Color from '../Color/Color';
|
|
2
|
+
import DatePicker from '../DatePicker/DatePicker';
|
|
3
|
+
import Icon from '../Icon/Icon';
|
|
4
|
+
import Typography from '../Typography/Typography';
|
|
5
|
+
import type {
|
|
6
|
+
CalendarModeType,
|
|
7
|
+
DateRangeProps,
|
|
8
|
+
} from '../Calendar/CalendarPropsType';
|
|
9
9
|
import { useState, useEffect } from 'react';
|
|
10
10
|
import { Pressable, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
11
11
|
import type { FormattedDateRangeProps } from '../Calendar/CalendarPropsType';
|
|
12
12
|
import { dateFormatter } from '../function/dateFormatter';
|
|
13
13
|
import { layouting } from '../styles/layouting';
|
|
14
14
|
import { spacing } from '../styles/spacing';
|
|
15
|
+
import { getTestID } from '../helpers/getTestID';
|
|
15
16
|
|
|
16
17
|
type DatePickerProps = React.ComponentProps<typeof DatePicker>;
|
|
17
18
|
type DatePickerPropsWithoutOnChange = Omit<
|
|
@@ -31,6 +32,9 @@ interface BaseProps {
|
|
|
31
32
|
mode?: CalendarModeType;
|
|
32
33
|
language?: 'en' | 'id';
|
|
33
34
|
hasClear?: boolean;
|
|
35
|
+
confirmLabel?: string;
|
|
36
|
+
cancelLabel?: string;
|
|
37
|
+
testID?: string;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
type SingleModeProps = BaseProps & {
|
|
@@ -58,6 +62,9 @@ export default function InputDate({
|
|
|
58
62
|
mode = 'single',
|
|
59
63
|
language,
|
|
60
64
|
hasClear,
|
|
65
|
+
confirmLabel,
|
|
66
|
+
cancelLabel,
|
|
67
|
+
testID,
|
|
61
68
|
...props
|
|
62
69
|
}: Props) {
|
|
63
70
|
const [isDatePickerOpen, setSelectOpen] = useState<boolean>(false);
|
|
@@ -156,15 +163,27 @@ export default function InputDate({
|
|
|
156
163
|
}
|
|
157
164
|
}, [value, valueDateEnd]);
|
|
158
165
|
|
|
166
|
+
// Strip any caller-provided testID out of datePickerProps before spreading
|
|
167
|
+
// it onto <DatePicker>, so it can never clobber the derived `-sheet` id
|
|
168
|
+
// below (mirrors the selectProps fix in InputSelect.tsx).
|
|
169
|
+
const datePickerPropsWithoutTestID = { ...datePickerProps };
|
|
170
|
+
delete (datePickerPropsWithoutTestID as { testID?: string }).testID;
|
|
171
|
+
|
|
159
172
|
return (
|
|
160
173
|
<View style={styles.gap4}>
|
|
161
|
-
<Typography
|
|
174
|
+
<Typography
|
|
175
|
+
testID={getTestID(testID, 'label')}
|
|
176
|
+
variant="t2"
|
|
177
|
+
weight="semibold"
|
|
178
|
+
color={Color.gray[900]}
|
|
179
|
+
>
|
|
162
180
|
{label}
|
|
163
181
|
</Typography>
|
|
164
182
|
|
|
165
183
|
<View style={styles.wrapper}>
|
|
166
184
|
{/* sart date */}
|
|
167
185
|
<Pressable
|
|
186
|
+
testID={getTestID(testID, 'trigger')}
|
|
168
187
|
style={[
|
|
169
188
|
styles.pickerTrigger,
|
|
170
189
|
(value || dateValue) && styles.hasValue,
|
|
@@ -178,11 +197,8 @@ export default function InputDate({
|
|
|
178
197
|
<View style={[layouting.flex.rowCenter, spacing.gap[8]]}>
|
|
179
198
|
{hasClear && (value || dateValue) && (
|
|
180
199
|
<TouchableOpacity
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
borderRadius: 999,
|
|
184
|
-
padding: 3,
|
|
185
|
-
}}
|
|
200
|
+
testID={getTestID(testID, 'clear')}
|
|
201
|
+
style={styles.clearBtn}
|
|
186
202
|
onPress={() => {
|
|
187
203
|
onDateChange?.({
|
|
188
204
|
date: null,
|
|
@@ -207,6 +223,7 @@ export default function InputDate({
|
|
|
207
223
|
{/* end date */}
|
|
208
224
|
{mode === 'range' && (
|
|
209
225
|
<Pressable
|
|
226
|
+
testID={getTestID(testID, 'trigger-end')}
|
|
210
227
|
style={[
|
|
211
228
|
styles.pickerTrigger,
|
|
212
229
|
(value || dateValue) && styles.hasValue,
|
|
@@ -223,7 +240,8 @@ export default function InputDate({
|
|
|
223
240
|
</View>
|
|
224
241
|
|
|
225
242
|
<DatePicker
|
|
226
|
-
{
|
|
243
|
+
testID={testID}
|
|
244
|
+
{...datePickerPropsWithoutTestID}
|
|
227
245
|
mode={mode}
|
|
228
246
|
isOpen={isDatePickerOpen}
|
|
229
247
|
onClose={handleCloseDatePicker}
|
|
@@ -232,6 +250,8 @@ export default function InputDate({
|
|
|
232
250
|
onChange={(val: DateRangeProps) => {
|
|
233
251
|
handleDateChange(val);
|
|
234
252
|
}}
|
|
253
|
+
{...(confirmLabel ? { confirmLabel } : {})}
|
|
254
|
+
{...(cancelLabel ? { cancelLabel } : {})}
|
|
235
255
|
/>
|
|
236
256
|
</View>
|
|
237
257
|
);
|
|
@@ -260,4 +280,9 @@ const styles = StyleSheet.create({
|
|
|
260
280
|
gap: 8,
|
|
261
281
|
alignItems: 'center',
|
|
262
282
|
},
|
|
283
|
+
clearBtn: {
|
|
284
|
+
backgroundColor: Color.gray[600],
|
|
285
|
+
borderRadius: 999,
|
|
286
|
+
padding: 3,
|
|
287
|
+
},
|
|
263
288
|
});
|
package/src/Input/InputFile.tsx
CHANGED
|
@@ -21,8 +21,10 @@ import type {
|
|
|
21
21
|
UploadedFile,
|
|
22
22
|
} from './type';
|
|
23
23
|
import { uploadFile } from './helpers/uploadFile';
|
|
24
|
+
import { getTestID } from '../helpers/getTestID';
|
|
24
25
|
|
|
25
26
|
export default function InputFile({
|
|
27
|
+
testID,
|
|
26
28
|
title = 'Upload File',
|
|
27
29
|
description = 'File harus berformat JPG, PNG dan PDF',
|
|
28
30
|
accept = [
|
|
@@ -367,6 +369,7 @@ export default function InputFile({
|
|
|
367
369
|
<View style={spacing.gap[12]}>
|
|
368
370
|
{variant === 'default' && (
|
|
369
371
|
<CardTrigger
|
|
372
|
+
testID={getTestID(testID, 'trigger')}
|
|
370
373
|
title={title}
|
|
371
374
|
hint={hint || (internalErrorMessage as string)}
|
|
372
375
|
hasError={hasError || !!internalErrorMessage}
|
|
@@ -379,6 +382,7 @@ export default function InputFile({
|
|
|
379
382
|
{variant === 'small' && (
|
|
380
383
|
<View style={spacing.gap[4]}>
|
|
381
384
|
<CardTriggerSmall
|
|
385
|
+
testID={getTestID(testID, 'trigger')}
|
|
382
386
|
files={files}
|
|
383
387
|
title={title}
|
|
384
388
|
hasError={hasError}
|
|
@@ -389,9 +393,11 @@ export default function InputFile({
|
|
|
389
393
|
onDelete={confirmDeleteFile}
|
|
390
394
|
/>
|
|
391
395
|
{internalErrorMessage && (
|
|
392
|
-
<
|
|
393
|
-
{
|
|
394
|
-
|
|
396
|
+
<View testID={getTestID(testID, 'error')}>
|
|
397
|
+
<Typography variant="t3" color={Color.danger[500]}>
|
|
398
|
+
{internalErrorMessage}
|
|
399
|
+
</Typography>
|
|
400
|
+
</View>
|
|
395
401
|
)}
|
|
396
402
|
|
|
397
403
|
{files.length > 0 && (
|
|
@@ -399,13 +405,14 @@ export default function InputFile({
|
|
|
399
405
|
{files
|
|
400
406
|
.filter((file) => !!file.error)
|
|
401
407
|
.map((file, index) => (
|
|
402
|
-
<
|
|
408
|
+
<View
|
|
403
409
|
key={index}
|
|
404
|
-
|
|
405
|
-
color={Color.danger[500]}
|
|
410
|
+
testID={getTestID(testID, `error-${index}`)}
|
|
406
411
|
>
|
|
407
|
-
{
|
|
408
|
-
|
|
412
|
+
<Typography variant="t3" color={Color.danger[500]}>
|
|
413
|
+
{file.hint}
|
|
414
|
+
</Typography>
|
|
415
|
+
</View>
|
|
409
416
|
))}
|
|
410
417
|
</>
|
|
411
418
|
)}
|
|
@@ -417,6 +424,7 @@ export default function InputFile({
|
|
|
417
424
|
<View style={spacing.gap[12]} key={index}>
|
|
418
425
|
{useChangeLabel && (
|
|
419
426
|
<Input
|
|
427
|
+
testID={getTestID(testID, `file-${index}`)}
|
|
420
428
|
label={`${changeLableProps?.label || 'Nama Dokumen'} ${index + 1}`}
|
|
421
429
|
value={file.labelFile}
|
|
422
430
|
placeholder={
|
|
@@ -434,6 +442,7 @@ export default function InputFile({
|
|
|
434
442
|
|
|
435
443
|
<View style={spacing.gap[4]}>
|
|
436
444
|
<ItemPreview
|
|
445
|
+
testID={getTestID(testID, `item-${index}`)}
|
|
437
446
|
index={index}
|
|
438
447
|
file={file}
|
|
439
448
|
loading={file.uploading}
|
|
@@ -443,18 +452,21 @@ export default function InputFile({
|
|
|
443
452
|
/>
|
|
444
453
|
|
|
445
454
|
{file.hint && (
|
|
446
|
-
<
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
455
|
+
<View testID={getTestID(testID, `error-${index}`)}>
|
|
456
|
+
<Typography
|
|
457
|
+
variant="t3"
|
|
458
|
+
color={!file.error ? Color.gray[700] : Color.danger[500]}
|
|
459
|
+
>
|
|
460
|
+
{file.hint}
|
|
461
|
+
</Typography>
|
|
462
|
+
</View>
|
|
452
463
|
)}
|
|
453
464
|
</View>
|
|
454
465
|
</View>
|
|
455
466
|
))}
|
|
456
467
|
|
|
457
468
|
<ModalPicker
|
|
469
|
+
testID={getTestID(testID, 'sheet')}
|
|
458
470
|
isOpen={isOpenBottomSheetTypeFile}
|
|
459
471
|
onClose={() => setIsOpenBottomSheetTypeFile(false)}
|
|
460
472
|
title={modalPickFileText?.title || 'Upload Dokumen'}
|
|
@@ -488,6 +500,7 @@ export default function InputFile({
|
|
|
488
500
|
/>
|
|
489
501
|
|
|
490
502
|
<ModalDelete
|
|
503
|
+
testID={getTestID(testID, 'modal-delete')}
|
|
491
504
|
isOpen={isOpenBottomSheetDeleteFile}
|
|
492
505
|
onClose={() => setIsOpenBottomSheetDeleteFile(false)}
|
|
493
506
|
title={modalDeleteText?.title || 'Hapus Dokumen'}
|
package/src/Input/InputMonth.tsx
CHANGED
|
@@ -1 +1,152 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import MonthPicker from '../DatePicker/MonthPicker';
|
|
4
|
+
import { dateFormatter } from '../function/dateFormatter';
|
|
5
|
+
import PickerField from './partials/PickerField';
|
|
6
|
+
import type { PickerFieldValue } from './type';
|
|
7
|
+
|
|
8
|
+
interface BaseProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
/** Month number, 1 (January) to 12 (December). */
|
|
12
|
+
value?: number;
|
|
13
|
+
onSelectClick?: () => void;
|
|
14
|
+
onPickerClose?: () => void;
|
|
15
|
+
onChange?: (value: PickerFieldValue) => void;
|
|
16
|
+
language?: 'en' | 'id';
|
|
17
|
+
hasClear?: boolean;
|
|
18
|
+
title?: string;
|
|
19
|
+
cancelLabel?: string;
|
|
20
|
+
confirmLabel?: string;
|
|
21
|
+
testID?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SingleModeProps = BaseProps & {
|
|
25
|
+
mode?: 'single';
|
|
26
|
+
placeholderEnd?: never;
|
|
27
|
+
valueEnd?: never;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type RangeModeProps = BaseProps & {
|
|
31
|
+
mode: 'range';
|
|
32
|
+
placeholderEnd: string;
|
|
33
|
+
valueEnd?: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type InputMonthProps = SingleModeProps | RangeModeProps;
|
|
37
|
+
|
|
38
|
+
const EMPTY: PickerFieldValue = {
|
|
39
|
+
value: null,
|
|
40
|
+
startValue: null,
|
|
41
|
+
endValue: null,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Renders the month name for a 1-based month number in the requested language.
|
|
46
|
+
*
|
|
47
|
+
* Anything outside 1-12 renders nothing, so the field falls back to its
|
|
48
|
+
* placeholder. Handing the number straight to Date would quietly roll over --
|
|
49
|
+
* 0 would read as December of the previous year rather than January.
|
|
50
|
+
*
|
|
51
|
+
* The year given to the formatter is arbitrary; only the month is read back.
|
|
52
|
+
*/
|
|
53
|
+
const monthLabel = (
|
|
54
|
+
month: number | null | undefined,
|
|
55
|
+
language?: 'en' | 'id'
|
|
56
|
+
) =>
|
|
57
|
+
month === null || month === undefined || month < 1 || month > 12
|
|
58
|
+
? null
|
|
59
|
+
: dateFormatter({
|
|
60
|
+
date: new Date(2000, month - 1, 1),
|
|
61
|
+
options: { pattern: 'MMMM', language },
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export default function InputMonth({
|
|
65
|
+
label,
|
|
66
|
+
placeholder,
|
|
67
|
+
placeholderEnd,
|
|
68
|
+
value,
|
|
69
|
+
valueEnd,
|
|
70
|
+
mode = 'single',
|
|
71
|
+
onSelectClick,
|
|
72
|
+
onPickerClose,
|
|
73
|
+
onChange,
|
|
74
|
+
language,
|
|
75
|
+
hasClear,
|
|
76
|
+
title,
|
|
77
|
+
cancelLabel,
|
|
78
|
+
confirmLabel,
|
|
79
|
+
testID,
|
|
80
|
+
}: InputMonthProps) {
|
|
81
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
82
|
+
const [selected, setSelected] = useState<PickerFieldValue>(EMPTY);
|
|
83
|
+
|
|
84
|
+
// A given prop wins, so the field can be driven from outside; otherwise it
|
|
85
|
+
// shows whatever was last picked.
|
|
86
|
+
const start = value ?? (mode === 'range' ? selected.startValue : selected.value); // prettier-ignore
|
|
87
|
+
const end = valueEnd ?? selected.endValue;
|
|
88
|
+
|
|
89
|
+
const handleOpen = () => {
|
|
90
|
+
setIsOpen(true);
|
|
91
|
+
onSelectClick?.();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const handleClose = () => {
|
|
95
|
+
setIsOpen(false);
|
|
96
|
+
onPickerClose?.();
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const handleChange = (
|
|
100
|
+
picked: number[] | { startDate: number | null; endDate: number | null }
|
|
101
|
+
) => {
|
|
102
|
+
// MonthPicker reports an array in single mode and a pair in range mode,
|
|
103
|
+
// both 0-based. Shift to 1-based on the way out, so January is 1 for the
|
|
104
|
+
// consumer -- the picker's indices never leak past this line.
|
|
105
|
+
const oneBased = (month: number | null | undefined) =>
|
|
106
|
+
month === null || month === undefined ? null : month + 1;
|
|
107
|
+
|
|
108
|
+
const next: PickerFieldValue = Array.isArray(picked)
|
|
109
|
+
? { value: oneBased(picked[0]), startValue: null, endValue: null }
|
|
110
|
+
: {
|
|
111
|
+
value: null,
|
|
112
|
+
startValue: oneBased(picked.startDate),
|
|
113
|
+
endValue: oneBased(picked.endDate),
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
setSelected(next);
|
|
117
|
+
onChange?.(next);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const handleClear = () => {
|
|
121
|
+
setSelected(EMPTY);
|
|
122
|
+
onChange?.(EMPTY);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<View>
|
|
127
|
+
<PickerField
|
|
128
|
+
label={label}
|
|
129
|
+
placeholder={placeholder}
|
|
130
|
+
placeholderEnd={placeholderEnd}
|
|
131
|
+
mode={mode}
|
|
132
|
+
display={monthLabel(start, language)}
|
|
133
|
+
displayEnd={monthLabel(end, language)}
|
|
134
|
+
hasClear={hasClear}
|
|
135
|
+
onPress={handleOpen}
|
|
136
|
+
onClear={handleClear}
|
|
137
|
+
testID={testID}
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
<MonthPicker
|
|
141
|
+
testID={testID}
|
|
142
|
+
isOpen={isOpen}
|
|
143
|
+
mode={mode}
|
|
144
|
+
onClose={handleClose}
|
|
145
|
+
onChange={handleChange}
|
|
146
|
+
{...(title ? { title } : {})}
|
|
147
|
+
{...(cancelLabel ? { cancelLabel } : {})}
|
|
148
|
+
{...(confirmLabel ? { confirmLabel } : {})}
|
|
149
|
+
/>
|
|
150
|
+
</View>
|
|
151
|
+
);
|
|
152
|
+
}
|
package/src/Input/InputOtp.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { StyleSheet, TextInput, View } from 'react-native';
|
|
|
3
3
|
import Color from '../Color/Color';
|
|
4
4
|
import LabelForm from '../LabelForm/LabelForm';
|
|
5
5
|
import Typography from '../Typography/Typography';
|
|
6
|
+
import { getTestID } from '../helpers/getTestID';
|
|
6
7
|
|
|
7
8
|
type InputOtpProps = {
|
|
8
9
|
length?: number;
|
|
@@ -11,6 +12,7 @@ type InputOtpProps = {
|
|
|
11
12
|
hint?: string;
|
|
12
13
|
hasError?: boolean;
|
|
13
14
|
inputCenter?: boolean;
|
|
15
|
+
testID?: string;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
const InputOtp: React.FC<InputOtpProps> = ({
|
|
@@ -20,6 +22,7 @@ const InputOtp: React.FC<InputOtpProps> = ({
|
|
|
20
22
|
hint,
|
|
21
23
|
hasError,
|
|
22
24
|
inputCenter = false,
|
|
25
|
+
testID,
|
|
23
26
|
}) => {
|
|
24
27
|
const inputs = useRef<Array<TextInput | null>>([]);
|
|
25
28
|
const values = useRef<string[]>(Array(length).fill(''));
|
|
@@ -50,7 +53,9 @@ const InputOtp: React.FC<InputOtpProps> = ({
|
|
|
50
53
|
|
|
51
54
|
return (
|
|
52
55
|
<View style={styles.gap4}>
|
|
53
|
-
{label ?
|
|
56
|
+
{label ? (
|
|
57
|
+
<LabelForm testID={getTestID(testID, 'label')} title={label} />
|
|
58
|
+
) : null}
|
|
54
59
|
<View
|
|
55
60
|
style={[
|
|
56
61
|
styles.container,
|
|
@@ -68,6 +73,7 @@ const InputOtp: React.FC<InputOtpProps> = ({
|
|
|
68
73
|
.map((_, i) => (
|
|
69
74
|
<TextInput
|
|
70
75
|
key={i}
|
|
76
|
+
testID={getTestID(testID, `item-${i}`)}
|
|
71
77
|
style={[
|
|
72
78
|
styles.input,
|
|
73
79
|
// eslint-disable-next-line react-native/no-inline-styles
|
|
@@ -89,7 +95,11 @@ const InputOtp: React.FC<InputOtpProps> = ({
|
|
|
89
95
|
</View>
|
|
90
96
|
|
|
91
97
|
{hint ? (
|
|
92
|
-
<Typography
|
|
98
|
+
<Typography
|
|
99
|
+
testID={getTestID(testID, 'error')}
|
|
100
|
+
color={hasError ? Color.danger[500] : ''}
|
|
101
|
+
variant="t3"
|
|
102
|
+
>
|
|
93
103
|
{hint}
|
|
94
104
|
</Typography>
|
|
95
105
|
) : null}
|
|
@@ -11,17 +11,22 @@ interface InputPasswordProps extends TextInputProps {
|
|
|
11
11
|
label?: string;
|
|
12
12
|
hint?: string;
|
|
13
13
|
hasError?: boolean;
|
|
14
|
+
testID?: string;
|
|
14
15
|
onPressIconLeft?: () => void;
|
|
15
16
|
onPressIconRight?: () => void;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
export default function InputPassword(
|
|
19
|
+
export default function InputPassword({
|
|
20
|
+
testID,
|
|
21
|
+
...props
|
|
22
|
+
}: InputPasswordProps) {
|
|
19
23
|
const [secureText, setSecureText] = useState(true);
|
|
20
24
|
|
|
21
25
|
return (
|
|
22
26
|
<View>
|
|
23
27
|
<Input
|
|
24
28
|
{...props}
|
|
29
|
+
testID={testID}
|
|
25
30
|
iconRight={secureText ? 'Eye' : 'EyeOpen'}
|
|
26
31
|
secureTextEntry={secureText}
|
|
27
32
|
onPressIconRight={() => setSecureText(!secureText)}
|