@herca/rn-kit 0.1.113 → 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 +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 +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/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 +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 +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 +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
|
@@ -66,6 +66,7 @@ function MyForm() {
|
|
|
66
66
|
| `mode` | `'single' \| 'range'` | `'single'` | Mode pemilihan tanggal |
|
|
67
67
|
| `language` | `'en' \| 'id'` | `undefined` | Bahasa untuk format tanggal |
|
|
68
68
|
| `hasClear` | `boolean` | `false` | Nilai boolean untuk menampilkan opsi hapus tanggal |
|
|
69
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-trigger`, `-trigger-end` (mode range), `-label`, `-clear`. `testID` mentah diteruskan ke `DatePicker`, yang menurunkan suffix-nya sendiri: `-sheet`, `-cancel`, `-confirm`, `-error`. |
|
|
69
70
|
|
|
70
71
|
### Single Mode Specific Props
|
|
71
72
|
|
|
@@ -264,3 +265,20 @@ Ini memastikan `placeholderDateEnd` hanya required ketika `mode="range"`.
|
|
|
264
265
|
## License
|
|
265
266
|
|
|
266
267
|
MIT
|
|
268
|
+
|
|
269
|
+
## Teks statis pada picker
|
|
270
|
+
|
|
271
|
+
`confirmLabel` dan `cancelLabel` mengganti teks tombol di sheet, tanpa perlu
|
|
272
|
+
menyusurinya lewat `datePickerProps`:
|
|
273
|
+
|
|
274
|
+
```jsx
|
|
275
|
+
<InputDate
|
|
276
|
+
label="Date"
|
|
277
|
+
placeholder="Pick a date"
|
|
278
|
+
confirmLabel="Apply"
|
|
279
|
+
cancelLabel="Cancel"
|
|
280
|
+
/>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Default-nya `'Terapkan'` dan `'Batalkan'`. Kalau kunci yang sama juga diisi di
|
|
284
|
+
`datePickerProps`, prop eksplisit di atas yang menang.
|
|
@@ -145,6 +145,7 @@ export default function ExampleScreen() {
|
|
|
145
145
|
| `modalDeleteText` | `ModalOption & confirmBtn` | `undefined` | Teks kustom pada modal konfirmasi hapus file. |
|
|
146
146
|
| `hasError` | `boolean` | `false` | Menampilkan state error pada input. |
|
|
147
147
|
| `onUploading` | `(isUploading?: boolean) => void` | `undefiend` | Expose value uploading ke parent |
|
|
148
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-trigger`, `-file-{index}` (field nama dokumen per file, field-nya sendiri `-file-{index}-input`), `-item-{index}` (preview per file), `-error` (error umum, mis. ukuran melebihi batas), `-error-{index}` (error per file), `-sheet`, dan `-modal-delete`. |
|
|
148
149
|
|
|
149
150
|
### Default Variant Props (`variant?: 'default'`)
|
|
150
151
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# InputMonth
|
|
2
|
+
|
|
3
|
+
Field bulan yang dibuka lewat `MonthPicker`. Bentuk dan alurnya mengikuti
|
|
4
|
+
`InputDate`: satu trigger (dua kalau `mode="range"`), tombol clear opsional,
|
|
5
|
+
dan sheet yang muncul saat trigger ditekan.
|
|
6
|
+
|
|
7
|
+
Yang dipilih hanya **bulan**, tanpa tahun — sama seperti `MonthPicker` yang
|
|
8
|
+
dibungkusnya. Kalau butuh bulan sekaligus tahun, pasangkan dengan
|
|
9
|
+
[`InputYear`](./README_INPUT_YEAR.md).
|
|
10
|
+
|
|
11
|
+
## Import
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
import { InputMonth } from '@herca/rn-kit';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Contoh Penggunaan
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
const [month, setMonth] = useState<number>();
|
|
21
|
+
|
|
22
|
+
<InputMonth
|
|
23
|
+
label="Bulan lahir"
|
|
24
|
+
placeholder="Pilih bulan"
|
|
25
|
+
value={month}
|
|
26
|
+
hasClear
|
|
27
|
+
onChange={({ value }) => setMonth(value ?? undefined)}
|
|
28
|
+
/>;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Mode range
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
const [range, setRange] = useState({ start: undefined, end: undefined });
|
|
35
|
+
|
|
36
|
+
<InputMonth
|
|
37
|
+
mode="range"
|
|
38
|
+
label="Periode"
|
|
39
|
+
placeholder="Bulan mulai"
|
|
40
|
+
placeholderEnd="Bulan selesai"
|
|
41
|
+
value={range.start}
|
|
42
|
+
valueEnd={range.end}
|
|
43
|
+
onChange={({ startValue, endValue }) =>
|
|
44
|
+
setRange({ start: startValue ?? undefined, end: endValue ?? undefined })
|
|
45
|
+
}
|
|
46
|
+
/>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Bahasa
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
<InputMonth label="Month" placeholder="Pick one" value={1} language="en" />
|
|
53
|
+
// menampilkan "January"; tanpa language menampilkan "Januari"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Props
|
|
57
|
+
|
|
58
|
+
| Props | Tipe | Wajib | Default | Deskripsi |
|
|
59
|
+
| ---------------- | -------------------------- | ----- | ---------- | ------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `label` | `string` | ❌ | - | Teks label di atas trigger. Kalau kosong, elemen labelnya tidak dirender sama sekali. |
|
|
61
|
+
| `placeholder` | `string` | ✅ | - | Teks trigger saat belum ada nilai. |
|
|
62
|
+
| `placeholderEnd` | `string` | ✅\* | - | Placeholder trigger kedua. Wajib dan hanya berlaku saat `mode="range"`. |
|
|
63
|
+
| `value` | `number` | ❌ | - | Nomor bulan, `1` (Januari) sampai `12` (Desember). Kalau diisi, ia menang atas pilihan internal. Di luar 1–12 dianggap kosong. |
|
|
64
|
+
| `valueEnd` | `number` | ❌ | - | Nomor bulan akhir, `1`–`12`. Hanya berlaku saat `mode="range"`. |
|
|
65
|
+
| `mode` | `'single' \| 'range'` | ❌ | `'single'` | Satu bulan, atau rentang dua bulan. |
|
|
66
|
+
| `language` | `'en' \| 'id'` | ❌ | `'id'` | Bahasa nama bulan yang ditampilkan. |
|
|
67
|
+
| `hasClear` | `boolean` | ❌ | `false` | Menampilkan tombol clear saat ada nilai. |
|
|
68
|
+
| `onChange` | `(v: PickerFieldValue) => void` | ❌ | - | Dipanggil saat pilihan dikonfirmasi atau dibersihkan. |
|
|
69
|
+
| `onSelectClick` | `() => void` | ❌ | - | Dipanggil saat trigger ditekan. |
|
|
70
|
+
| `onPickerClose` | `() => void` | ❌ | - | Dipanggil saat sheet ditutup. |
|
|
71
|
+
| `title` | `string` | ❌ | `'Pilih Bulan'` | Judul sheet, diteruskan ke `MonthPicker`. |
|
|
72
|
+
| `cancelLabel` | `string` | ❌ | `'Batal'` | Label tombol batal di sheet. |
|
|
73
|
+
| `confirmLabel` | `string` | ❌ | `'pilih'` | Label tombol konfirmasi di sheet. |
|
|
74
|
+
| `testID` | `string` | ❌ | - | ID untuk automation testing. Lihat tabel di bawah. |
|
|
75
|
+
|
|
76
|
+
\* Wajib secara tipe hanya ketika `mode="range"`.
|
|
77
|
+
|
|
78
|
+
## Bentuk nilai
|
|
79
|
+
|
|
80
|
+
`onChange` selalu menerima bentuk yang sama, apa pun mode-nya:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
interface PickerFieldValue {
|
|
84
|
+
value: number | null; // terisi di mode single
|
|
85
|
+
startValue: number | null; // terisi di mode range
|
|
86
|
+
endValue: number | null; // terisi di mode range
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Hanya satu sisi yang terisi, ditentukan `mode`. Saat dibersihkan, ketiganya
|
|
91
|
+
`null`.
|
|
92
|
+
|
|
93
|
+
**Bulan dihitung dari 1**, jadi Januari adalah `1` dan Desember `12` — baik
|
|
94
|
+
untuk prop `value` maupun untuk yang dilaporkan `onChange`. `MonthPicker` di
|
|
95
|
+
baliknya memakai indeks 0–11, tapi indeks itu tidak pernah bocor ke luar.
|
|
96
|
+
|
|
97
|
+
## testID turunan
|
|
98
|
+
|
|
99
|
+
| Suffix | Elemen |
|
|
100
|
+
| ---------------- | ------------------------------------------ |
|
|
101
|
+
| `-label` | Label di atas trigger |
|
|
102
|
+
| `-trigger` | Trigger utama |
|
|
103
|
+
| `-trigger-end` | Trigger kedua (hanya `mode="range"`) |
|
|
104
|
+
| `-clear` | Tombol clear (hanya saat ada nilai) |
|
|
105
|
+
| `-sheet` | `BottomSheet` milik `MonthPicker` |
|
|
106
|
+
| `-option-{i}` | Opsi bulan di sheet, memakai indeks 0–11 milik `MonthPicker` |
|
|
107
|
+
| `-confirm` | Tombol konfirmasi di sheet |
|
|
108
|
+
| `-cancel` | Tombol batal di sheet |
|
|
109
|
+
|
|
110
|
+
`testID` diteruskan mentah ke `MonthPicker`, jadi id sheet dan opsinya
|
|
111
|
+
diturunkan dari basis yang sama — polanya sama seperti `InputDate` dengan
|
|
112
|
+
`DatePicker`.
|
|
113
|
+
|
|
114
|
+
## Teks statis
|
|
115
|
+
|
|
116
|
+
Semua teks bawaan sheet berbahasa Indonesia dan bisa diganti dari sini, jadi
|
|
117
|
+
tidak perlu menyentuh `MonthPicker` langsung:
|
|
118
|
+
|
|
119
|
+
```jsx
|
|
120
|
+
<InputMonth
|
|
121
|
+
label="Month"
|
|
122
|
+
placeholder="Pick a month"
|
|
123
|
+
language="en"
|
|
124
|
+
title="Choose a month"
|
|
125
|
+
cancelLabel="Cancel"
|
|
126
|
+
confirmLabel="Apply"
|
|
127
|
+
/>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`language` mengatur nama bulan; `title`, `cancelLabel` dan `confirmLabel`
|
|
131
|
+
mengatur teks statis sheet. Keduanya terpisah — mengubah `language` tidak ikut
|
|
132
|
+
menerjemahkan tombolnya.
|
|
@@ -32,6 +32,7 @@ Salin file `InputOtp.tsx` ke proyek React Native Anda dan import sesuai kebutuha
|
|
|
32
32
|
| `hint` | `string` | - | Pesan kecil di bawah input (misal instruksi atau error) |
|
|
33
33
|
| `hasError` | `boolean` | false | Jika `true`, border input berubah warna merah (indikasi error) |
|
|
34
34
|
| `inputCenter` | `boolean` | false | Jika `true`, maka seluruh input field akan memposisikan diri ke tengah secara horizontal |
|
|
35
|
+
| `testID` | `string` | - | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-item-{index}` untuk tiap kotak digit, `-label`, dan `-error`. |
|
|
35
36
|
|
|
36
37
|
---
|
|
37
38
|
|
|
@@ -71,6 +71,7 @@ export default function Example() {
|
|
|
71
71
|
| `useModal` | `boolean` | `true` | Gunakan modal untuk menampilkan opsi |
|
|
72
72
|
| `required` | `boolean` | `false` | Untuk menampilkan indikator bintang di label |
|
|
73
73
|
| `labelColor` | `stirng` | `true` | Untuk mengubah warna label |
|
|
74
|
+
| `testID` | `string` | `undefined` | ID untuk automation testing (Maestro/Detox/Appium). Menurunkan `-trigger`, `-label`, `-clear`, `-error`. `testID` mentah diteruskan ke `Select`, yang menurunkan suffix-nya sendiri: `-sheet` (body bottom sheet), `-search-input` (field pencarian), `-submit` (mode multiple), `-option-{value}` (tiap opsi). |
|
|
74
75
|
|
|
75
76
|
### Pressable Props
|
|
76
77
|
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# InputYear
|
|
2
|
+
|
|
3
|
+
Field tahun yang dibuka lewat `YearPicker`. Kembarannya
|
|
4
|
+
[`InputMonth`](./README_INPUT_MONTH.md) — bentuk, prop, dan bentuk nilainya
|
|
5
|
+
sama persis.
|
|
6
|
+
|
|
7
|
+
Tidak ada prop `language`: tahun berupa angka, dan tidak ada yang berubah
|
|
8
|
+
antar-locale.
|
|
9
|
+
|
|
10
|
+
## Import
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
import { InputYear } from '@herca/rn-kit';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Contoh Penggunaan
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
const [year, setYear] = useState<number>();
|
|
20
|
+
|
|
21
|
+
<InputYear
|
|
22
|
+
label="Tahun masuk"
|
|
23
|
+
placeholder="Pilih tahun"
|
|
24
|
+
value={year}
|
|
25
|
+
hasClear
|
|
26
|
+
onChange={({ value }) => setYear(value ?? undefined)}
|
|
27
|
+
/>;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Mode range
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
<InputYear
|
|
34
|
+
mode="range"
|
|
35
|
+
label="Periode"
|
|
36
|
+
placeholder="Tahun mulai"
|
|
37
|
+
placeholderEnd="Tahun selesai"
|
|
38
|
+
onChange={({ startValue, endValue }) => console.log(startValue, endValue)}
|
|
39
|
+
/>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Bersama InputMonth
|
|
43
|
+
|
|
44
|
+
`MonthPicker` tidak membawa tahun, jadi bulan-dan-tahun disusun dari dua field:
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
<InputMonth label="Bulan" placeholder="Pilih bulan" onChange={onMonthChange} />
|
|
48
|
+
<InputYear label="Tahun" placeholder="Pilih tahun" onChange={onYearChange} />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Props
|
|
52
|
+
|
|
53
|
+
| Props | Tipe | Wajib | Default | Deskripsi |
|
|
54
|
+
| ---------------- | ------------------------------- | ----- | ---------- | ----------------------------------------------------------------------------- |
|
|
55
|
+
| `label` | `string` | ❌ | - | Teks label di atas trigger. Kalau kosong, elemen labelnya tidak dirender. |
|
|
56
|
+
| `placeholder` | `string` | ✅ | - | Teks trigger saat belum ada nilai. |
|
|
57
|
+
| `placeholderEnd` | `string` | ✅\* | - | Placeholder trigger kedua. Wajib dan hanya berlaku saat `mode="range"`. |
|
|
58
|
+
| `value` | `number` | ❌ | - | Tahun penuh, mis. `2024`. Kalau diisi, ia menang atas pilihan internal. |
|
|
59
|
+
| `valueEnd` | `number` | ❌ | - | Tahun akhir. Hanya berlaku saat `mode="range"`. |
|
|
60
|
+
| `mode` | `'single' \| 'range'` | ❌ | `'single'` | Satu tahun, atau rentang dua tahun. |
|
|
61
|
+
| `hasClear` | `boolean` | ❌ | `false` | Menampilkan tombol clear saat ada nilai. |
|
|
62
|
+
| `onChange` | `(v: PickerFieldValue) => void` | ❌ | - | Dipanggil saat pilihan dikonfirmasi atau dibersihkan. |
|
|
63
|
+
| `onSelectClick` | `() => void` | ❌ | - | Dipanggil saat trigger ditekan. |
|
|
64
|
+
| `onPickerClose` | `() => void` | ❌ | - | Dipanggil saat sheet ditutup. |
|
|
65
|
+
| `title` | `string` | ❌ | `'Pilih Tahun'` | Judul sheet, diteruskan ke `YearPicker`. |
|
|
66
|
+
| `cancelLabel` | `string` | ❌ | `'Batal'` | Label tombol batal di sheet. |
|
|
67
|
+
| `confirmLabel` | `string` | ❌ | `'Pilih'` | Label tombol konfirmasi di sheet. |
|
|
68
|
+
| `testID` | `string` | ❌ | - | ID untuk automation testing. Suffix-nya sama dengan `InputMonth`. |
|
|
69
|
+
|
|
70
|
+
\* Wajib secara tipe hanya ketika `mode="range"`.
|
|
71
|
+
|
|
72
|
+
## Bentuk nilai
|
|
73
|
+
|
|
74
|
+
Sama dengan `InputMonth`:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
interface PickerFieldValue {
|
|
78
|
+
value: number | null; // terisi di mode single
|
|
79
|
+
startValue: number | null; // terisi di mode range
|
|
80
|
+
endValue: number | null; // terisi di mode range
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Rentang tahun
|
|
85
|
+
|
|
86
|
+
`YearPicker` menampilkan 121 tahun: 60 tahun sebelum sampai 60 tahun sesudah
|
|
87
|
+
tahun berjalan. Rentang itu belum bisa diatur lewat prop.
|
|
88
|
+
|
|
89
|
+
## testID turunan
|
|
90
|
+
|
|
91
|
+
| Suffix | Elemen |
|
|
92
|
+
| -------------- | ------------------------------------ |
|
|
93
|
+
| `-label` | Label di atas trigger |
|
|
94
|
+
| `-trigger` | Trigger utama |
|
|
95
|
+
| `-trigger-end` | Trigger kedua (hanya `mode="range"`) |
|
|
96
|
+
| `-clear` | Tombol clear (hanya saat ada nilai) |
|
|
97
|
+
| `-sheet` | `BottomSheet` milik `YearPicker` |
|
|
98
|
+
| `-option-{th}` | Opsi tahun, mis. `-option-2024` |
|
|
99
|
+
| `-confirm` | Tombol konfirmasi di sheet |
|
|
100
|
+
| `-cancel` | Tombol batal di sheet |
|
|
101
|
+
|
|
102
|
+
## Teks statis
|
|
103
|
+
|
|
104
|
+
Semua teks bawaan sheet berbahasa Indonesia dan bisa diganti dari sini, jadi
|
|
105
|
+
tidak perlu menyentuh `YearPicker` langsung:
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
<InputYear
|
|
109
|
+
label="Year"
|
|
110
|
+
placeholder="Pick a year"
|
|
111
|
+
title="Choose a year"
|
|
112
|
+
cancelLabel="Cancel"
|
|
113
|
+
confirmLabel="Apply"
|
|
114
|
+
/>
|
|
115
|
+
```
|
package/src/Input/Switch.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import LabelForm from '../LabelForm/LabelForm';
|
|
4
4
|
import Typography from '../Typography/Typography';
|
|
5
5
|
import Color from '../Color/Color';
|
|
6
|
+
import { getTestID } from '../helpers/getTestID';
|
|
6
7
|
|
|
7
8
|
interface SwitchProps {
|
|
8
9
|
label?: string;
|
|
@@ -12,6 +13,7 @@ interface SwitchProps {
|
|
|
12
13
|
hint?: string;
|
|
13
14
|
hasError?: true;
|
|
14
15
|
disabled?: boolean;
|
|
16
|
+
testID?: string;
|
|
15
17
|
}
|
|
16
18
|
export default function Switch({
|
|
17
19
|
label,
|
|
@@ -21,6 +23,7 @@ export default function Switch({
|
|
|
21
23
|
hint,
|
|
22
24
|
hasError,
|
|
23
25
|
disabled = false,
|
|
26
|
+
testID,
|
|
24
27
|
}: SwitchProps) {
|
|
25
28
|
const isControlled = value !== undefined;
|
|
26
29
|
const [internalValue, setInternalValue] = useState<boolean>(false);
|
|
@@ -62,8 +65,11 @@ export default function Switch({
|
|
|
62
65
|
|
|
63
66
|
return (
|
|
64
67
|
<View style={{ gap: 4, opacity: disabled ? 0.5 : 1 }}>
|
|
65
|
-
{label ?
|
|
68
|
+
{label ? (
|
|
69
|
+
<LabelForm title={label} testID={getTestID(testID, 'label')} />
|
|
70
|
+
) : null}
|
|
66
71
|
<Pressable
|
|
72
|
+
testID={testID}
|
|
67
73
|
style={styles.touchArea}
|
|
68
74
|
onPress={handlePress}
|
|
69
75
|
disabled={disabled}
|
package/src/Input/TextArea.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { StyleSheet, TextInput, View } from 'react-native';
|
|
|
2
2
|
import LabelForm from '../LabelForm/LabelForm';
|
|
3
3
|
import Color from '../Color/Color';
|
|
4
4
|
import Typography from '../Typography/Typography';
|
|
5
|
+
import { getTestID } from '../helpers/getTestID';
|
|
5
6
|
import type { TextAreaProps } from './type';
|
|
6
7
|
|
|
7
8
|
export default function TextArea({
|
|
@@ -12,6 +13,7 @@ export default function TextArea({
|
|
|
12
13
|
hint,
|
|
13
14
|
onChangeText,
|
|
14
15
|
required,
|
|
16
|
+
testID,
|
|
15
17
|
...props
|
|
16
18
|
}: TextAreaProps) {
|
|
17
19
|
const handleOnChangeText = (value: string) => {
|
|
@@ -20,7 +22,13 @@ export default function TextArea({
|
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
24
|
<View style={styles.gap}>
|
|
23
|
-
{label ?
|
|
25
|
+
{label ? (
|
|
26
|
+
<LabelForm
|
|
27
|
+
testID={getTestID(testID, 'label')}
|
|
28
|
+
required={required}
|
|
29
|
+
title={label}
|
|
30
|
+
/>
|
|
31
|
+
) : null}
|
|
24
32
|
|
|
25
33
|
<View
|
|
26
34
|
style={[
|
|
@@ -32,6 +40,7 @@ export default function TextArea({
|
|
|
32
40
|
]}
|
|
33
41
|
>
|
|
34
42
|
<TextInput
|
|
43
|
+
testID={getTestID(testID, 'input')}
|
|
35
44
|
onChangeText={handleOnChangeText}
|
|
36
45
|
editable
|
|
37
46
|
multiline
|
|
@@ -43,7 +52,11 @@ export default function TextArea({
|
|
|
43
52
|
/>
|
|
44
53
|
</View>
|
|
45
54
|
{hint ? (
|
|
46
|
-
<Typography
|
|
55
|
+
<Typography
|
|
56
|
+
testID={getTestID(testID, 'error')}
|
|
57
|
+
color={hasError ? Color.danger[500] : ''}
|
|
58
|
+
variant="t2"
|
|
59
|
+
>
|
|
47
60
|
{hint}
|
|
48
61
|
</Typography>
|
|
49
62
|
) : null}
|
|
@@ -13,6 +13,7 @@ interface Props {
|
|
|
13
13
|
onPress?: () => void;
|
|
14
14
|
hasError?: boolean;
|
|
15
15
|
hint?: string;
|
|
16
|
+
testID?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export default function CardTrigger({
|
|
@@ -22,6 +23,7 @@ export default function CardTrigger({
|
|
|
22
23
|
onPress,
|
|
23
24
|
hint,
|
|
24
25
|
hasError,
|
|
26
|
+
testID,
|
|
25
27
|
}: Props) {
|
|
26
28
|
return (
|
|
27
29
|
<Card
|
|
@@ -54,6 +56,7 @@ export default function CardTrigger({
|
|
|
54
56
|
</Typography>
|
|
55
57
|
</View>
|
|
56
58
|
<Button
|
|
59
|
+
testID={testID}
|
|
57
60
|
color="primary"
|
|
58
61
|
title={btnSelect}
|
|
59
62
|
size="small"
|
|
@@ -22,6 +22,7 @@ interface Props {
|
|
|
22
22
|
onReplace?: (index: number) => void;
|
|
23
23
|
onDelete?: (index: number) => void;
|
|
24
24
|
hasError?: boolean;
|
|
25
|
+
testID?: string;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export default function CardTriggerSmall({
|
|
@@ -33,6 +34,7 @@ export default function CardTriggerSmall({
|
|
|
33
34
|
onPreview,
|
|
34
35
|
onReplace,
|
|
35
36
|
hasError,
|
|
37
|
+
testID,
|
|
36
38
|
}: Props) {
|
|
37
39
|
const Component = files?.length === 0 ? View : TouchableOpacity;
|
|
38
40
|
return (
|
|
@@ -48,7 +50,7 @@ export default function CardTriggerSmall({
|
|
|
48
50
|
files.length > 0 ? layouting.flex.col : {},
|
|
49
51
|
files.length > 0 ? spacing.gap[6] : {},
|
|
50
52
|
]}
|
|
51
|
-
{...(files?.length > 0 && { onPress: onChooseFile })}
|
|
53
|
+
{...(files?.length > 0 && { onPress: onChooseFile, testID })}
|
|
52
54
|
>
|
|
53
55
|
<Image
|
|
54
56
|
source={require('../../assets/input-file.png')}
|
|
@@ -65,6 +67,7 @@ export default function CardTriggerSmall({
|
|
|
65
67
|
|
|
66
68
|
{files.length === 0 && (
|
|
67
69
|
<Button
|
|
70
|
+
testID={testID}
|
|
68
71
|
title={textButton}
|
|
69
72
|
color="primary"
|
|
70
73
|
size="small"
|
|
@@ -9,6 +9,7 @@ import Card from '../../../Ui/Card';
|
|
|
9
9
|
import Color from '../../../Color/Color';
|
|
10
10
|
import Typography from '../../../Typography/Typography';
|
|
11
11
|
import Icon from '../../../Icon';
|
|
12
|
+
import { getTestID } from '../../../helpers/getTestID';
|
|
12
13
|
import type { FileItem } from '../../type';
|
|
13
14
|
|
|
14
15
|
interface Props {
|
|
@@ -19,6 +20,7 @@ interface Props {
|
|
|
19
20
|
onDelete: (index: number) => void;
|
|
20
21
|
variant?: 'default' | 'small';
|
|
21
22
|
loading?: boolean;
|
|
23
|
+
testID?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export default function ItemPreview({
|
|
@@ -29,12 +31,14 @@ export default function ItemPreview({
|
|
|
29
31
|
onReplace,
|
|
30
32
|
variant = 'default',
|
|
31
33
|
loading = false,
|
|
34
|
+
testID,
|
|
32
35
|
}: Props) {
|
|
33
36
|
const Wrapper = variant === 'default' ? Card : View;
|
|
34
37
|
|
|
35
38
|
return (
|
|
36
39
|
<Wrapper>
|
|
37
40
|
<TouchableOpacity
|
|
41
|
+
testID={testID}
|
|
38
42
|
onPress={onPress}
|
|
39
43
|
style={styles.containerPreview}
|
|
40
44
|
activeOpacity={0.7}
|
|
@@ -125,11 +129,17 @@ export default function ItemPreview({
|
|
|
125
129
|
/>
|
|
126
130
|
)}
|
|
127
131
|
|
|
128
|
-
<TouchableOpacity
|
|
132
|
+
<TouchableOpacity
|
|
133
|
+
testID={getTestID(testID, 'replace')}
|
|
134
|
+
onPress={() => onReplace(index)}
|
|
135
|
+
>
|
|
129
136
|
<Icon name="rotate-right" size={18} color={Color.gray[700]} />
|
|
130
137
|
</TouchableOpacity>
|
|
131
138
|
|
|
132
|
-
<TouchableOpacity
|
|
139
|
+
<TouchableOpacity
|
|
140
|
+
testID={getTestID(testID, 'delete')}
|
|
141
|
+
onPress={() => onDelete(index)}
|
|
142
|
+
>
|
|
133
143
|
<Icon name="Times" size={12} color={Color.gray[700]} />
|
|
134
144
|
</TouchableOpacity>
|
|
135
145
|
</View>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Pressable, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
2
|
+
import Color from '../../Color/Color';
|
|
3
|
+
import Icon from '../../Icon/Icon';
|
|
4
|
+
import Typography from '../../Typography/Typography';
|
|
5
|
+
import { getTestID } from '../../helpers/getTestID';
|
|
6
|
+
import { layouting } from '../../styles/layouting';
|
|
7
|
+
import { spacing } from '../../styles/spacing';
|
|
8
|
+
|
|
9
|
+
interface PickerFieldProps {
|
|
10
|
+
/** Omitted entirely when absent -- no empty element is left behind. */
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
placeholderEnd?: string;
|
|
14
|
+
mode?: 'single' | 'range';
|
|
15
|
+
/** Already formatted for display; the field does no formatting itself. */
|
|
16
|
+
display?: string | null;
|
|
17
|
+
displayEnd?: string | null;
|
|
18
|
+
hasClear?: boolean;
|
|
19
|
+
onPress: () => void;
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
testID?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The read-only trigger a picker-backed field sits behind: a label, one or two
|
|
26
|
+
* pressable slots, and an optional clear button.
|
|
27
|
+
*
|
|
28
|
+
* Shared by InputMonth and InputYear so the two cannot drift apart visually,
|
|
29
|
+
* and so neither has to restate InputDate's markup. It holds no state and does
|
|
30
|
+
* no formatting -- callers pass strings that are ready to show.
|
|
31
|
+
*/
|
|
32
|
+
export default function PickerField({
|
|
33
|
+
label,
|
|
34
|
+
placeholder,
|
|
35
|
+
placeholderEnd,
|
|
36
|
+
mode = 'single',
|
|
37
|
+
display,
|
|
38
|
+
displayEnd,
|
|
39
|
+
hasClear,
|
|
40
|
+
onPress,
|
|
41
|
+
onClear,
|
|
42
|
+
testID,
|
|
43
|
+
}: PickerFieldProps) {
|
|
44
|
+
return (
|
|
45
|
+
<View style={styles.gap4}>
|
|
46
|
+
{label ? (
|
|
47
|
+
<Typography
|
|
48
|
+
testID={getTestID(testID, 'label')}
|
|
49
|
+
variant="t2"
|
|
50
|
+
weight="semibold"
|
|
51
|
+
color={Color.gray[900]}
|
|
52
|
+
>
|
|
53
|
+
{label}
|
|
54
|
+
</Typography>
|
|
55
|
+
) : null}
|
|
56
|
+
|
|
57
|
+
<View style={styles.wrapper}>
|
|
58
|
+
<Pressable
|
|
59
|
+
testID={getTestID(testID, 'trigger')}
|
|
60
|
+
style={[styles.pickerTrigger, !!display && styles.hasValue]}
|
|
61
|
+
onPress={onPress}
|
|
62
|
+
>
|
|
63
|
+
<Typography variant="t2" color={Color.gray[900]} weight="medium">
|
|
64
|
+
{display || placeholder}
|
|
65
|
+
</Typography>
|
|
66
|
+
<View style={[layouting.flex.rowCenter, spacing.gap[8]]}>
|
|
67
|
+
{hasClear && !!display && (
|
|
68
|
+
<TouchableOpacity
|
|
69
|
+
testID={getTestID(testID, 'clear')}
|
|
70
|
+
style={styles.clear}
|
|
71
|
+
onPress={onClear}
|
|
72
|
+
>
|
|
73
|
+
<Icon name="times-new" size={14} color="white" />
|
|
74
|
+
</TouchableOpacity>
|
|
75
|
+
)}
|
|
76
|
+
<Icon name="ArrowDown" size={14} color={Color.gray[700]} />
|
|
77
|
+
</View>
|
|
78
|
+
</Pressable>
|
|
79
|
+
|
|
80
|
+
{mode === 'range' && (
|
|
81
|
+
<Pressable
|
|
82
|
+
testID={getTestID(testID, 'trigger-end')}
|
|
83
|
+
style={[styles.pickerTrigger, !!displayEnd && styles.hasValue]}
|
|
84
|
+
onPress={onPress}
|
|
85
|
+
>
|
|
86
|
+
<Typography variant="t2" color={Color.gray[900]} weight="medium">
|
|
87
|
+
{displayEnd || placeholderEnd}
|
|
88
|
+
</Typography>
|
|
89
|
+
<Icon name="ArrowDown" size={14} color={Color.gray[700]} />
|
|
90
|
+
</Pressable>
|
|
91
|
+
)}
|
|
92
|
+
</View>
|
|
93
|
+
</View>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const styles = StyleSheet.create({
|
|
98
|
+
gap4: {
|
|
99
|
+
gap: 4,
|
|
100
|
+
},
|
|
101
|
+
pickerTrigger: {
|
|
102
|
+
paddingVertical: 10,
|
|
103
|
+
paddingHorizontal: 12,
|
|
104
|
+
borderRadius: 8,
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
justifyContent: 'space-between',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
borderWidth: 1,
|
|
109
|
+
borderColor: Color.gray[200],
|
|
110
|
+
flex: 1,
|
|
111
|
+
},
|
|
112
|
+
hasValue: {
|
|
113
|
+
borderColor: Color.primary[300],
|
|
114
|
+
},
|
|
115
|
+
wrapper: {
|
|
116
|
+
flexDirection: 'row',
|
|
117
|
+
gap: 8,
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
},
|
|
120
|
+
clear: {
|
|
121
|
+
backgroundColor: Color.gray[600],
|
|
122
|
+
borderRadius: 999,
|
|
123
|
+
padding: 3,
|
|
124
|
+
},
|
|
125
|
+
});
|
package/src/Input/type.tsx
CHANGED
|
@@ -90,6 +90,7 @@ export type FileItem = (PickedFile | ImageAsset) & FileItemExtras;
|
|
|
90
90
|
export type DocumentType = (typeof types)[keyof typeof types];
|
|
91
91
|
|
|
92
92
|
export interface BaseInputFileProps {
|
|
93
|
+
testID?: string;
|
|
93
94
|
title?: string;
|
|
94
95
|
accept?: string[] | DocumentType[];
|
|
95
96
|
multiple?: boolean;
|
|
@@ -126,3 +127,16 @@ export type SmallVariantProps = BaseInputFileProps & {
|
|
|
126
127
|
};
|
|
127
128
|
|
|
128
129
|
export type InputFileProps = DefaultVariantProps | SmallVariantProps;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* What a picker-backed field reports back.
|
|
133
|
+
*
|
|
134
|
+
* `value` carries a single selection; `startValue`/`endValue` carry a range.
|
|
135
|
+
* Only one pair is ever populated, decided by the field's `mode`. Shared by
|
|
136
|
+
* InputMonth and InputYear so both read the same on the consumer side.
|
|
137
|
+
*/
|
|
138
|
+
export interface PickerFieldValue {
|
|
139
|
+
value: number | null;
|
|
140
|
+
startValue: number | null;
|
|
141
|
+
endValue: number | null;
|
|
142
|
+
}
|
package/src/Label/Label.tsx
CHANGED
|
@@ -12,6 +12,7 @@ interface LabelProps {
|
|
|
12
12
|
color?: string;
|
|
13
13
|
icon?: IconNameProps;
|
|
14
14
|
size?: 'medium' | 'small';
|
|
15
|
+
testID?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
type LabelColor = ColorVariantType;
|
|
@@ -73,6 +74,7 @@ export default function Label({
|
|
|
73
74
|
icon,
|
|
74
75
|
children,
|
|
75
76
|
color = 'default',
|
|
77
|
+
testID,
|
|
76
78
|
}: LabelProps) {
|
|
77
79
|
const safeColor = validColors.includes(color as LabelColor)
|
|
78
80
|
? (color as LabelColor)
|
|
@@ -81,6 +83,7 @@ export default function Label({
|
|
|
81
83
|
|
|
82
84
|
return (
|
|
83
85
|
<View
|
|
86
|
+
testID={testID}
|
|
84
87
|
style={[styles.container, { backgroundColor: colors.backgroundColor }]}
|
|
85
88
|
>
|
|
86
89
|
{children ? (
|