@herca/rn-kit 0.1.113 → 0.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (506) hide show
  1. package/README.md +66 -0
  2. package/lib/module/Accordion/Accordion.js +4 -1
  3. package/lib/module/Accordion/Accordion.js.map +1 -1
  4. package/lib/module/Accordion/AccordionItem.js +3 -1
  5. package/lib/module/Accordion/AccordionItem.js.map +1 -1
  6. package/lib/module/Accordion/README.md +2 -0
  7. package/lib/module/Alert/Alert.js +3 -1
  8. package/lib/module/Alert/Alert.js.map +1 -1
  9. package/lib/module/Alert/README.md +1 -0
  10. package/lib/module/Avatar/Avatar.js +3 -1
  11. package/lib/module/Avatar/Avatar.js.map +1 -1
  12. package/lib/module/Avatar/AvatarGroup.js +3 -1
  13. package/lib/module/Avatar/AvatarGroup.js.map +1 -1
  14. package/lib/module/Avatar/README_AVATAR.md +1 -0
  15. package/lib/module/Avatar/README_AVATARGROUP.md +1 -0
  16. package/lib/module/Badge/Badge.js +4 -1
  17. package/lib/module/Badge/Badge.js.map +1 -1
  18. package/lib/module/Badge/README.md +1 -0
  19. package/lib/module/BadgeIcon/BadgeIcon.js +3 -1
  20. package/lib/module/BadgeIcon/BadgeIcon.js.map +1 -1
  21. package/lib/module/BadgeIcon/README.md +1 -0
  22. package/lib/module/BottomSheet/BottomSheet.js +17 -8
  23. package/lib/module/BottomSheet/BottomSheet.js.map +1 -1
  24. package/lib/module/BottomSheet/README.md +1 -0
  25. package/lib/module/Button/Button.js +3 -1
  26. package/lib/module/Button/Button.js.map +1 -1
  27. package/lib/module/Button/README.md +1 -0
  28. package/lib/module/Button/type.js.map +1 -1
  29. package/lib/module/Calendar/Calendar.js +9 -1
  30. package/lib/module/Calendar/Calendar.js.map +1 -1
  31. package/lib/module/Calendar/README.md +2 -0
  32. package/lib/module/CheckBox/CheckBox.js +8 -3
  33. package/lib/module/CheckBox/CheckBox.js.map +1 -1
  34. package/lib/module/CheckBox/CheckBoxList.js +7 -2
  35. package/lib/module/CheckBox/CheckBoxList.js.map +1 -1
  36. package/lib/module/CheckBox/README_CHECKBOX.md +1 -0
  37. package/lib/module/CheckBox/README_CHECKBOXLIST.md +1 -0
  38. package/lib/module/Chip/Chip.js +19 -6
  39. package/lib/module/Chip/Chip.js.map +1 -1
  40. package/lib/module/Chip/ChipItem.js +3 -1
  41. package/lib/module/Chip/ChipItem.js.map +1 -1
  42. package/lib/module/Chip/README.md +26 -2
  43. package/lib/module/Chip/README_CHIP_ITEM.md +1 -0
  44. package/lib/module/CounterButton/CounterButton.js +6 -1
  45. package/lib/module/CounterButton/CounterButton.js.map +1 -1
  46. package/lib/module/CounterButton/README.md +1 -0
  47. package/lib/module/DatePicker/DatePicker.js +13 -1
  48. package/lib/module/DatePicker/DatePicker.js.map +1 -1
  49. package/lib/module/DatePicker/MonthPicker.js +35 -2
  50. package/lib/module/DatePicker/MonthPicker.js.map +1 -1
  51. package/lib/module/DatePicker/README_DATEPICKER.md +1 -0
  52. package/lib/module/DatePicker/README_MONTHPICKER.md +2 -0
  53. package/lib/module/DatePicker/README_TIMEPICKER.md +1 -0
  54. package/lib/module/DatePicker/README_YEARPICKER.md +2 -0
  55. package/lib/module/DatePicker/TimePicker.js +8 -1
  56. package/lib/module/DatePicker/TimePicker.js.map +1 -1
  57. package/lib/module/DatePicker/YearPicker.js +50 -5
  58. package/lib/module/DatePicker/YearPicker.js.map +1 -1
  59. package/lib/module/Drawing/Drawing.js +3 -1
  60. package/lib/module/Drawing/Drawing.js.map +1 -1
  61. package/lib/module/Drawing/README.md +1 -0
  62. package/lib/module/DropDown/DropDown.js +6 -1
  63. package/lib/module/DropDown/DropDown.js.map +1 -1
  64. package/lib/module/DropDown/README.md +1 -0
  65. package/lib/module/FileView/PDF_VIEW_README.md +11 -0
  66. package/lib/module/FileView/PdfView.js +5 -1
  67. package/lib/module/FileView/PdfView.js.map +1 -1
  68. package/lib/module/Icon/Icon.js +14 -2
  69. package/lib/module/Icon/Icon.js.map +1 -1
  70. package/lib/module/Icon/README.md +1 -0
  71. package/lib/module/Input/Input.js +7 -0
  72. package/lib/module/Input/Input.js.map +1 -1
  73. package/lib/module/Input/InputDate.js +35 -8
  74. package/lib/module/Input/InputDate.js.map +1 -1
  75. package/lib/module/Input/InputFile.js +28 -11
  76. package/lib/module/Input/InputFile.js.map +1 -1
  77. package/lib/module/Input/InputMonth.js +126 -1
  78. package/lib/module/Input/InputMonth.js.map +1 -1
  79. package/lib/module/Input/InputOtp.js +6 -1
  80. package/lib/module/Input/InputOtp.js.map +1 -1
  81. package/lib/module/Input/InputPassword.js +5 -1
  82. package/lib/module/Input/InputPassword.js.map +1 -1
  83. package/lib/module/Input/InputSelect.js +21 -2
  84. package/lib/module/Input/InputSelect.js.map +1 -1
  85. package/lib/module/Input/InputYear.js +103 -0
  86. package/lib/module/Input/InputYear.js.map +1 -0
  87. package/lib/module/Input/README_INPUT.md +1 -0
  88. package/lib/module/Input/README_INPUT_DATE.md +18 -0
  89. package/lib/module/Input/README_INPUT_FILE.md +1 -0
  90. package/lib/module/Input/README_INPUT_MONTH.md +132 -0
  91. package/lib/module/Input/README_INPUT_OTP.md +1 -0
  92. package/lib/module/Input/README_INPUT_SELECT.md +1 -0
  93. package/lib/module/Input/README_INPUT_YEAR.md +115 -0
  94. package/lib/module/Input/Switch.js +6 -2
  95. package/lib/module/Input/Switch.js.map +1 -1
  96. package/lib/module/Input/TextArea.js +5 -0
  97. package/lib/module/Input/TextArea.js.map +1 -1
  98. package/lib/module/Input/partials/InputFile/CardTrigger.js +3 -1
  99. package/lib/module/Input/partials/InputFile/CardTrigger.js.map +1 -1
  100. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js +5 -2
  101. package/lib/module/Input/partials/InputFile/CardTriggerSmall.js.map +1 -1
  102. package/lib/module/Input/partials/InputFile/ItemPreview.js +6 -1
  103. package/lib/module/Input/partials/InputFile/ItemPreview.js.map +1 -1
  104. package/lib/module/Input/partials/PickerField.js +114 -0
  105. package/lib/module/Input/partials/PickerField.js.map +1 -0
  106. package/lib/module/Label/Label.js +3 -1
  107. package/lib/module/Label/Label.js.map +1 -1
  108. package/lib/module/Label/README.md +1 -0
  109. package/lib/module/LabelForm/LabelForm.js +3 -1
  110. package/lib/module/LabelForm/LabelForm.js.map +1 -1
  111. package/lib/module/List/List.js +3 -1
  112. package/lib/module/List/List.js.map +1 -1
  113. package/lib/module/List/ListItem.js +3 -1
  114. package/lib/module/List/ListItem.js.map +1 -1
  115. package/lib/module/List/README.md +2 -0
  116. package/lib/module/Loading/Loading.js +3 -1
  117. package/lib/module/Loading/Loading.js.map +1 -1
  118. package/lib/module/Modal/Modal.js +8 -2
  119. package/lib/module/Modal/Modal.js.map +1 -1
  120. package/lib/module/Modal/README.md +1 -0
  121. package/lib/module/Provider/RequiredUpdateAppsProvider.js +10 -1
  122. package/lib/module/Provider/RequiredUpdateAppsProvider.js.map +1 -1
  123. package/lib/module/RadioButton/README.md +1 -0
  124. package/lib/module/RadioButton/RadioButton.js +7 -2
  125. package/lib/module/RadioButton/RadioButton.js.map +1 -1
  126. package/lib/module/Select/README.md +1 -0
  127. package/lib/module/Select/README_Select.md +1 -0
  128. package/lib/module/Select/Select.js +12 -3
  129. package/lib/module/Select/Select.js.map +1 -1
  130. package/lib/module/Skeleton/README.md +1 -0
  131. package/lib/module/Skeleton/Skeleton.js +3 -1
  132. package/lib/module/Skeleton/Skeleton.js.map +1 -1
  133. package/lib/module/Spinner/Spinner.js +3 -1
  134. package/lib/module/Spinner/Spinner.js.map +1 -1
  135. package/lib/module/Step/README.md +2 -0
  136. package/lib/module/Step/Step.js +3 -1
  137. package/lib/module/Step/Step.js.map +1 -1
  138. package/lib/module/Step/StepItem.js +4 -1
  139. package/lib/module/Step/StepItem.js.map +1 -1
  140. package/lib/module/Tab/README.md +1 -0
  141. package/lib/module/Tab/Tab.js +6 -1
  142. package/lib/module/Tab/Tab.js.map +1 -1
  143. package/lib/module/TextEditor/LinkSheet.js +84 -0
  144. package/lib/module/TextEditor/LinkSheet.js.map +1 -0
  145. package/lib/module/TextEditor/README.md +52 -2
  146. package/lib/module/TextEditor/TextEditor.js +77 -458
  147. package/lib/module/TextEditor/TextEditor.js.map +1 -1
  148. package/lib/module/TextEditor/Toolbar.js +71 -0
  149. package/lib/module/TextEditor/Toolbar.js.map +1 -0
  150. package/lib/module/TextEditor/editorDocument.js +235 -0
  151. package/lib/module/TextEditor/editorDocument.js.map +1 -0
  152. package/lib/module/TextEditor/formatState.js +186 -0
  153. package/lib/module/TextEditor/formatState.js.map +1 -0
  154. package/lib/module/TextEditor/toolbarButtons.js +81 -0
  155. package/lib/module/TextEditor/toolbarButtons.js.map +1 -0
  156. package/lib/module/TextEditor/types.js +2 -0
  157. package/lib/module/Timeline/README.md +2 -0
  158. package/lib/module/Timeline/Timeline.js +3 -1
  159. package/lib/module/Timeline/Timeline.js.map +1 -1
  160. package/lib/module/Timeline/TimelineItem.js +3 -1
  161. package/lib/module/Timeline/TimelineItem.js.map +1 -1
  162. package/lib/module/Toast/README.md +16 -0
  163. package/lib/module/Toast/Toast.js +6 -1
  164. package/lib/module/Toast/Toast.js.map +1 -1
  165. package/lib/module/Typography/README.md +1 -0
  166. package/lib/module/Typography/Typography.js +3 -1
  167. package/lib/module/Typography/Typography.js.map +1 -1
  168. package/lib/module/Ui/Card.js +4 -1
  169. package/lib/module/Ui/Card.js.map +1 -1
  170. package/lib/module/Ui/Center.js +3 -1
  171. package/lib/module/Ui/Center.js.map +1 -1
  172. package/lib/module/Ui/Col.js +3 -1
  173. package/lib/module/Ui/Col.js.map +1 -1
  174. package/lib/module/Ui/Container.js +3 -1
  175. package/lib/module/Ui/Container.js.map +1 -1
  176. package/lib/module/Ui/Devider.js +4 -1
  177. package/lib/module/Ui/Devider.js.map +1 -1
  178. package/lib/module/Ui/Footer.js +4 -2
  179. package/lib/module/Ui/Footer.js.map +1 -1
  180. package/lib/module/Ui/Gap.js +3 -1
  181. package/lib/module/Ui/Gap.js.map +1 -1
  182. package/lib/module/Ui/Grid.js +3 -1
  183. package/lib/module/Ui/Grid.js.map +1 -1
  184. package/lib/module/Ui/README_CARD.md +1 -0
  185. package/lib/module/Ui/README_CONTAINER.md +1 -0
  186. package/lib/module/Ui/README_DEVIDER.md +5 -0
  187. package/lib/module/Ui/README_FOOTER.md +9 -0
  188. package/lib/module/Ui/README_VIEWINSETS.md +1 -0
  189. package/lib/module/function/README_DATE_FORMATTER.md +35 -0
  190. package/lib/module/function/dateFormatter.js +29 -0
  191. package/lib/module/function/dateFormatter.js.map +1 -1
  192. package/lib/module/helpers/getTestID.js +15 -0
  193. package/lib/module/helpers/getTestID.js.map +1 -0
  194. package/lib/module/index.js +2 -0
  195. package/lib/module/index.js.map +1 -1
  196. package/lib/typescript/src/Accordion/Accordion.d.ts +1 -1
  197. package/lib/typescript/src/Accordion/Accordion.d.ts.map +1 -1
  198. package/lib/typescript/src/Accordion/AccordionItem.d.ts +1 -1
  199. package/lib/typescript/src/Accordion/AccordionItem.d.ts.map +1 -1
  200. package/lib/typescript/src/Accordion/type.d.ts +2 -0
  201. package/lib/typescript/src/Accordion/type.d.ts.map +1 -1
  202. package/lib/typescript/src/Alert/Alert.d.ts +1 -0
  203. package/lib/typescript/src/Alert/Alert.d.ts.map +1 -1
  204. package/lib/typescript/src/Avatar/Avatar.d.ts.map +1 -1
  205. package/lib/typescript/src/Avatar/AvatarGroup.d.ts.map +1 -1
  206. package/lib/typescript/src/Avatar/type.d.ts +2 -0
  207. package/lib/typescript/src/Avatar/type.d.ts.map +1 -1
  208. package/lib/typescript/src/Badge/Badge.d.ts +1 -0
  209. package/lib/typescript/src/Badge/Badge.d.ts.map +1 -1
  210. package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts +1 -0
  211. package/lib/typescript/src/BadgeIcon/BadgeIcon.d.ts.map +1 -1
  212. package/lib/typescript/src/BottomSheet/BottomSheet.d.ts +1 -1
  213. package/lib/typescript/src/BottomSheet/BottomSheet.d.ts.map +1 -1
  214. package/lib/typescript/src/BottomSheet/type.d.ts +1 -0
  215. package/lib/typescript/src/BottomSheet/type.d.ts.map +1 -1
  216. package/lib/typescript/src/Button/Button.d.ts.map +1 -1
  217. package/lib/typescript/src/Button/type.d.ts +1 -0
  218. package/lib/typescript/src/Button/type.d.ts.map +1 -1
  219. package/lib/typescript/src/Calendar/Calendar.d.ts +1 -1
  220. package/lib/typescript/src/Calendar/Calendar.d.ts.map +1 -1
  221. package/lib/typescript/src/Calendar/CalendarPropsType.d.ts +6 -0
  222. package/lib/typescript/src/Calendar/CalendarPropsType.d.ts.map +1 -1
  223. package/lib/typescript/src/CheckBox/CheckBox.d.ts +1 -0
  224. package/lib/typescript/src/CheckBox/CheckBox.d.ts.map +1 -1
  225. package/lib/typescript/src/CheckBox/CheckBoxList.d.ts +1 -0
  226. package/lib/typescript/src/CheckBox/CheckBoxList.d.ts.map +1 -1
  227. package/lib/typescript/src/Chip/Chip.d.ts.map +1 -1
  228. package/lib/typescript/src/Chip/ChipItem.d.ts +1 -1
  229. package/lib/typescript/src/Chip/ChipItem.d.ts.map +1 -1
  230. package/lib/typescript/src/Chip/type.d.ts +2 -0
  231. package/lib/typescript/src/Chip/type.d.ts.map +1 -1
  232. package/lib/typescript/src/CounterButton/CounterButton.d.ts +1 -1
  233. package/lib/typescript/src/CounterButton/CounterButton.d.ts.map +1 -1
  234. package/lib/typescript/src/CounterButton/type.d.ts +1 -0
  235. package/lib/typescript/src/CounterButton/type.d.ts.map +1 -1
  236. package/lib/typescript/src/DatePicker/DatePicker.d.ts +2 -1
  237. package/lib/typescript/src/DatePicker/DatePicker.d.ts.map +1 -1
  238. package/lib/typescript/src/DatePicker/MonthPicker.d.ts +11 -1
  239. package/lib/typescript/src/DatePicker/MonthPicker.d.ts.map +1 -1
  240. package/lib/typescript/src/DatePicker/TimePicker.d.ts +2 -1
  241. package/lib/typescript/src/DatePicker/TimePicker.d.ts.map +1 -1
  242. package/lib/typescript/src/DatePicker/YearPicker.d.ts +14 -1
  243. package/lib/typescript/src/DatePicker/YearPicker.d.ts.map +1 -1
  244. package/lib/typescript/src/Drawing/Drawing.d.ts +2 -1
  245. package/lib/typescript/src/Drawing/Drawing.d.ts.map +1 -1
  246. package/lib/typescript/src/DropDown/DropDown.d.ts +1 -1
  247. package/lib/typescript/src/DropDown/DropDown.d.ts.map +1 -1
  248. package/lib/typescript/src/DropDown/type.d.ts +1 -0
  249. package/lib/typescript/src/DropDown/type.d.ts.map +1 -1
  250. package/lib/typescript/src/FileView/PdfView.d.ts +2 -1
  251. package/lib/typescript/src/FileView/PdfView.d.ts.map +1 -1
  252. package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
  253. package/lib/typescript/src/Icon/type.d.ts +1 -0
  254. package/lib/typescript/src/Icon/type.d.ts.map +1 -1
  255. package/lib/typescript/src/Input/Input.d.ts.map +1 -1
  256. package/lib/typescript/src/Input/InputDate.d.ts +6 -2
  257. package/lib/typescript/src/Input/InputDate.d.ts.map +1 -1
  258. package/lib/typescript/src/Input/InputFile.d.ts +1 -1
  259. package/lib/typescript/src/Input/InputFile.d.ts.map +1 -1
  260. package/lib/typescript/src/Input/InputMonth.d.ts +29 -1
  261. package/lib/typescript/src/Input/InputMonth.d.ts.map +1 -1
  262. package/lib/typescript/src/Input/InputOtp.d.ts +1 -0
  263. package/lib/typescript/src/Input/InputOtp.d.ts.map +1 -1
  264. package/lib/typescript/src/Input/InputPassword.d.ts +2 -1
  265. package/lib/typescript/src/Input/InputPassword.d.ts.map +1 -1
  266. package/lib/typescript/src/Input/InputSelect.d.ts +4 -2
  267. package/lib/typescript/src/Input/InputSelect.d.ts.map +1 -1
  268. package/lib/typescript/src/Input/InputYear.d.ts +34 -0
  269. package/lib/typescript/src/Input/InputYear.d.ts.map +1 -0
  270. package/lib/typescript/src/Input/Switch.d.ts +2 -1
  271. package/lib/typescript/src/Input/Switch.d.ts.map +1 -1
  272. package/lib/typescript/src/Input/TextArea.d.ts +1 -1
  273. package/lib/typescript/src/Input/TextArea.d.ts.map +1 -1
  274. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts +2 -1
  275. package/lib/typescript/src/Input/partials/InputFile/CardTrigger.d.ts.map +1 -1
  276. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts +2 -1
  277. package/lib/typescript/src/Input/partials/InputFile/CardTriggerSmall.d.ts.map +1 -1
  278. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts +2 -1
  279. package/lib/typescript/src/Input/partials/InputFile/ItemPreview.d.ts.map +1 -1
  280. package/lib/typescript/src/Input/partials/PickerField.d.ts +25 -0
  281. package/lib/typescript/src/Input/partials/PickerField.d.ts.map +1 -0
  282. package/lib/typescript/src/Input/type.d.ts +13 -0
  283. package/lib/typescript/src/Input/type.d.ts.map +1 -1
  284. package/lib/typescript/src/Label/Label.d.ts +2 -1
  285. package/lib/typescript/src/Label/Label.d.ts.map +1 -1
  286. package/lib/typescript/src/LabelForm/LabelForm.d.ts +2 -1
  287. package/lib/typescript/src/LabelForm/LabelForm.d.ts.map +1 -1
  288. package/lib/typescript/src/List/List.d.ts +1 -1
  289. package/lib/typescript/src/List/List.d.ts.map +1 -1
  290. package/lib/typescript/src/List/ListItem.d.ts +1 -1
  291. package/lib/typescript/src/List/ListItem.d.ts.map +1 -1
  292. package/lib/typescript/src/List/type.d.ts +2 -0
  293. package/lib/typescript/src/List/type.d.ts.map +1 -1
  294. package/lib/typescript/src/Loading/Loading.d.ts +1 -0
  295. package/lib/typescript/src/Loading/Loading.d.ts.map +1 -1
  296. package/lib/typescript/src/Modal/Modal.d.ts +1 -0
  297. package/lib/typescript/src/Modal/Modal.d.ts.map +1 -1
  298. package/lib/typescript/src/Provider/RequiredUpdateAppsProvider.d.ts.map +1 -1
  299. package/lib/typescript/src/RadioButton/RadioButton.d.ts +1 -0
  300. package/lib/typescript/src/RadioButton/RadioButton.d.ts.map +1 -1
  301. package/lib/typescript/src/Select/Select.d.ts +1 -1
  302. package/lib/typescript/src/Select/Select.d.ts.map +1 -1
  303. package/lib/typescript/src/Select/type.d.ts +1 -0
  304. package/lib/typescript/src/Select/type.d.ts.map +1 -1
  305. package/lib/typescript/src/Skeleton/Skeleton.d.ts.map +1 -1
  306. package/lib/typescript/src/Skeleton/type.d.ts +1 -0
  307. package/lib/typescript/src/Skeleton/type.d.ts.map +1 -1
  308. package/lib/typescript/src/Spinner/Spinner.d.ts +7 -4
  309. package/lib/typescript/src/Spinner/Spinner.d.ts.map +1 -1
  310. package/lib/typescript/src/Step/Step.d.ts +1 -1
  311. package/lib/typescript/src/Step/Step.d.ts.map +1 -1
  312. package/lib/typescript/src/Step/StepItem.d.ts +1 -1
  313. package/lib/typescript/src/Step/StepItem.d.ts.map +1 -1
  314. package/lib/typescript/src/Step/type.d.ts +2 -0
  315. package/lib/typescript/src/Step/type.d.ts.map +1 -1
  316. package/lib/typescript/src/Tab/Tab.d.ts.map +1 -1
  317. package/lib/typescript/src/Tab/type.d.ts +1 -0
  318. package/lib/typescript/src/Tab/type.d.ts.map +1 -1
  319. package/lib/typescript/src/TextEditor/LinkSheet.d.ts +26 -0
  320. package/lib/typescript/src/TextEditor/LinkSheet.d.ts.map +1 -0
  321. package/lib/typescript/src/TextEditor/TextEditor.d.ts +2 -19
  322. package/lib/typescript/src/TextEditor/TextEditor.d.ts.map +1 -1
  323. package/lib/typescript/src/TextEditor/Toolbar.d.ts +16 -0
  324. package/lib/typescript/src/TextEditor/Toolbar.d.ts.map +1 -0
  325. package/lib/typescript/src/TextEditor/editorDocument.d.ts +20 -0
  326. package/lib/typescript/src/TextEditor/editorDocument.d.ts.map +1 -0
  327. package/lib/typescript/src/TextEditor/formatState.d.ts +34 -0
  328. package/lib/typescript/src/TextEditor/formatState.d.ts.map +1 -0
  329. package/lib/typescript/src/TextEditor/toolbarButtons.d.ts +5 -0
  330. package/lib/typescript/src/TextEditor/toolbarButtons.d.ts.map +1 -0
  331. package/lib/typescript/src/TextEditor/types.d.ts +42 -0
  332. package/lib/typescript/src/TextEditor/types.d.ts.map +1 -1
  333. package/lib/typescript/src/Timeline/Timeline.d.ts +2 -1
  334. package/lib/typescript/src/Timeline/Timeline.d.ts.map +1 -1
  335. package/lib/typescript/src/Timeline/TimelineItem.d.ts +2 -1
  336. package/lib/typescript/src/Timeline/TimelineItem.d.ts.map +1 -1
  337. package/lib/typescript/src/Toast/Toast.d.ts +2 -1
  338. package/lib/typescript/src/Toast/Toast.d.ts.map +1 -1
  339. package/lib/typescript/src/Typography/Typography.d.ts.map +1 -1
  340. package/lib/typescript/src/Typography/type.d.ts +1 -0
  341. package/lib/typescript/src/Typography/type.d.ts.map +1 -1
  342. package/lib/typescript/src/Ui/Card.d.ts +2 -1
  343. package/lib/typescript/src/Ui/Card.d.ts.map +1 -1
  344. package/lib/typescript/src/Ui/Center.d.ts +2 -1
  345. package/lib/typescript/src/Ui/Center.d.ts.map +1 -1
  346. package/lib/typescript/src/Ui/Col.d.ts +1 -0
  347. package/lib/typescript/src/Ui/Col.d.ts.map +1 -1
  348. package/lib/typescript/src/Ui/Container.d.ts +2 -1
  349. package/lib/typescript/src/Ui/Container.d.ts.map +1 -1
  350. package/lib/typescript/src/Ui/Devider.d.ts +3 -1
  351. package/lib/typescript/src/Ui/Devider.d.ts.map +1 -1
  352. package/lib/typescript/src/Ui/Footer.d.ts +1 -0
  353. package/lib/typescript/src/Ui/Footer.d.ts.map +1 -1
  354. package/lib/typescript/src/Ui/Gap.d.ts +2 -1
  355. package/lib/typescript/src/Ui/Gap.d.ts.map +1 -1
  356. package/lib/typescript/src/Ui/Grid.d.ts +1 -0
  357. package/lib/typescript/src/Ui/Grid.d.ts.map +1 -1
  358. package/lib/typescript/src/function/dateFormatter.d.ts +11 -0
  359. package/lib/typescript/src/function/dateFormatter.d.ts.map +1 -1
  360. package/lib/typescript/src/helpers/getTestID.d.ts +10 -0
  361. package/lib/typescript/src/helpers/getTestID.d.ts.map +1 -0
  362. package/lib/typescript/src/index.d.ts +6 -0
  363. package/lib/typescript/src/index.d.ts.map +1 -1
  364. package/package.json +16 -3
  365. package/src/Accordion/Accordion.tsx +6 -1
  366. package/src/Accordion/AccordionItem.tsx +2 -1
  367. package/src/Accordion/README.md +2 -0
  368. package/src/Accordion/type.tsx +2 -0
  369. package/src/Alert/Alert.tsx +3 -0
  370. package/src/Alert/README.md +1 -0
  371. package/src/Avatar/Avatar.tsx +2 -0
  372. package/src/Avatar/AvatarGroup.tsx +2 -1
  373. package/src/Avatar/README_AVATAR.md +1 -0
  374. package/src/Avatar/README_AVATARGROUP.md +1 -0
  375. package/src/Avatar/type.tsx +2 -0
  376. package/src/Badge/Badge.tsx +4 -0
  377. package/src/Badge/README.md +1 -0
  378. package/src/BadgeIcon/BadgeIcon.tsx +3 -0
  379. package/src/BadgeIcon/README.md +1 -0
  380. package/src/BottomSheet/BottomSheet.tsx +20 -13
  381. package/src/BottomSheet/README.md +1 -0
  382. package/src/BottomSheet/type.tsx +1 -0
  383. package/src/Button/Button.tsx +2 -0
  384. package/src/Button/README.md +1 -0
  385. package/src/Button/type.tsx +1 -0
  386. package/src/Calendar/Calendar.tsx +8 -1
  387. package/src/Calendar/CalendarPropsType.tsx +6 -0
  388. package/src/Calendar/README.md +2 -0
  389. package/src/CheckBox/CheckBox.tsx +13 -2
  390. package/src/CheckBox/CheckBoxList.tsx +7 -1
  391. package/src/CheckBox/README_CHECKBOX.md +1 -0
  392. package/src/CheckBox/README_CHECKBOXLIST.md +1 -0
  393. package/src/Chip/Chip.tsx +18 -5
  394. package/src/Chip/ChipItem.tsx +2 -0
  395. package/src/Chip/README.md +26 -2
  396. package/src/Chip/README_CHIP_ITEM.md +1 -0
  397. package/src/Chip/type.tsx +2 -0
  398. package/src/CounterButton/CounterButton.tsx +5 -0
  399. package/src/CounterButton/README.md +1 -0
  400. package/src/CounterButton/type.tsx +1 -0
  401. package/src/DatePicker/DatePicker.tsx +21 -5
  402. package/src/DatePicker/MonthPicker.tsx +40 -1
  403. package/src/DatePicker/README_DATEPICKER.md +1 -0
  404. package/src/DatePicker/README_MONTHPICKER.md +2 -0
  405. package/src/DatePicker/README_TIMEPICKER.md +1 -0
  406. package/src/DatePicker/README_YEARPICKER.md +2 -0
  407. package/src/DatePicker/TimePicker.tsx +8 -0
  408. package/src/DatePicker/YearPicker.tsx +59 -4
  409. package/src/Drawing/Drawing.tsx +3 -1
  410. package/src/Drawing/README.md +1 -0
  411. package/src/DropDown/DropDown.tsx +12 -1
  412. package/src/DropDown/README.md +1 -0
  413. package/src/DropDown/type.tsx +1 -0
  414. package/src/FileView/PDF_VIEW_README.md +11 -0
  415. package/src/FileView/PdfView.tsx +4 -3
  416. package/src/Icon/Icon.tsx +10 -2
  417. package/src/Icon/README.md +1 -0
  418. package/src/Icon/type.tsx +1 -0
  419. package/src/Input/Input.tsx +17 -2
  420. package/src/Input/InputDate.tsx +40 -15
  421. package/src/Input/InputFile.tsx +27 -14
  422. package/src/Input/InputMonth.tsx +170 -1
  423. package/src/Input/InputOtp.tsx +12 -2
  424. package/src/Input/InputPassword.tsx +6 -1
  425. package/src/Input/InputSelect.tsx +30 -13
  426. package/src/Input/InputYear.tsx +134 -0
  427. package/src/Input/README_INPUT.md +1 -0
  428. package/src/Input/README_INPUT_DATE.md +18 -0
  429. package/src/Input/README_INPUT_FILE.md +1 -0
  430. package/src/Input/README_INPUT_MONTH.md +132 -0
  431. package/src/Input/README_INPUT_OTP.md +1 -0
  432. package/src/Input/README_INPUT_SELECT.md +1 -0
  433. package/src/Input/README_INPUT_YEAR.md +115 -0
  434. package/src/Input/Switch.tsx +7 -1
  435. package/src/Input/TextArea.tsx +15 -2
  436. package/src/Input/partials/InputFile/CardTrigger.tsx +3 -0
  437. package/src/Input/partials/InputFile/CardTriggerSmall.tsx +4 -1
  438. package/src/Input/partials/InputFile/ItemPreview.tsx +12 -2
  439. package/src/Input/partials/PickerField.tsx +125 -0
  440. package/src/Input/type.tsx +14 -0
  441. package/src/Label/Label.tsx +3 -0
  442. package/src/Label/README.md +1 -0
  443. package/src/LabelForm/LabelForm.tsx +3 -1
  444. package/src/List/List.tsx +2 -2
  445. package/src/List/ListItem.tsx +2 -0
  446. package/src/List/README.md +2 -0
  447. package/src/List/type.tsx +2 -0
  448. package/src/Loading/Loading.tsx +3 -1
  449. package/src/Modal/Modal.tsx +15 -3
  450. package/src/Modal/README.md +1 -0
  451. package/src/Provider/RequiredUpdateAppsProvider.tsx +10 -1
  452. package/src/RadioButton/README.md +1 -0
  453. package/src/RadioButton/RadioButton.tsx +12 -2
  454. package/src/Select/README.md +1 -0
  455. package/src/Select/README_Select.md +1 -0
  456. package/src/Select/Select.tsx +13 -3
  457. package/src/Select/type.tsx +1 -0
  458. package/src/Skeleton/README.md +1 -0
  459. package/src/Skeleton/Skeleton.tsx +2 -0
  460. package/src/Skeleton/type.ts +1 -0
  461. package/src/Spinner/Spinner.tsx +15 -2
  462. package/src/Step/README.md +2 -0
  463. package/src/Step/Step.tsx +2 -2
  464. package/src/Step/StepItem.tsx +7 -2
  465. package/src/Step/type.tsx +2 -0
  466. package/src/Tab/README.md +1 -0
  467. package/src/Tab/Tab.tsx +12 -2
  468. package/src/Tab/type.tsx +1 -0
  469. package/src/TextEditor/LinkSheet.tsx +100 -0
  470. package/src/TextEditor/README.md +52 -2
  471. package/src/TextEditor/TextEditor.tsx +92 -500
  472. package/src/TextEditor/Toolbar.tsx +104 -0
  473. package/src/TextEditor/editorDocument.ts +246 -0
  474. package/src/TextEditor/formatState.ts +186 -0
  475. package/src/TextEditor/toolbarButtons.ts +41 -0
  476. package/src/TextEditor/types.tsx +63 -0
  477. package/src/Timeline/README.md +2 -0
  478. package/src/Timeline/Timeline.tsx +7 -2
  479. package/src/Timeline/TimelineItem.tsx +3 -1
  480. package/src/Toast/README.md +16 -0
  481. package/src/Toast/Toast.tsx +13 -2
  482. package/src/Typography/README.md +1 -0
  483. package/src/Typography/Typography.tsx +6 -1
  484. package/src/Typography/type.tsx +1 -0
  485. package/src/Ui/Card.tsx +4 -0
  486. package/src/Ui/Center.tsx +7 -2
  487. package/src/Ui/Col.tsx +7 -2
  488. package/src/Ui/Container.tsx +7 -2
  489. package/src/Ui/Devider.tsx +2 -2
  490. package/src/Ui/Footer.tsx +6 -3
  491. package/src/Ui/Gap.tsx +8 -2
  492. package/src/Ui/Grid.tsx +3 -2
  493. package/src/Ui/README_CARD.md +1 -0
  494. package/src/Ui/README_CONTAINER.md +1 -0
  495. package/src/Ui/README_DEVIDER.md +5 -0
  496. package/src/Ui/README_FOOTER.md +9 -0
  497. package/src/Ui/README_VIEWINSETS.md +1 -0
  498. package/src/function/README_DATE_FORMATTER.md +35 -0
  499. package/src/function/dateFormatter.ts +40 -0
  500. package/src/helpers/getTestID.ts +15 -0
  501. package/src/index.tsx +6 -0
  502. package/lib/module/Button/tests/Button.test.js +0 -70
  503. package/lib/module/Button/tests/Button.test.js.map +0 -1
  504. package/lib/typescript/src/Button/tests/Button.test.d.ts +0 -2
  505. package/lib/typescript/src/Button/tests/Button.test.d.ts.map +0 -1
  506. package/src/Button/tests/Button.test.tsx +0 -49
@@ -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 ? <LabelForm title={label} required={required} /> : null}
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 onPress={onPressIconRight} hitSlop={10}>
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"
@@ -1,17 +1,18 @@
1
- import {
2
- Color,
3
- DatePicker,
4
- Icon,
5
- Typography,
6
- type CalendarModeType,
7
- type DateRangeProps,
8
- } from '@herca/rn-kit';
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 variant="t2" weight="semibold" color={Color.gray[900]}>
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
- style={{
182
- backgroundColor: Color.gray[600],
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
- {...datePickerProps}
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
  });
@@ -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
- <Typography variant="t3" color={Color.danger[500]}>
393
- {internalErrorMessage}
394
- </Typography>
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
- <Typography
408
+ <View
403
409
  key={index}
404
- variant="t3"
405
- color={Color.danger[500]}
410
+ testID={getTestID(testID, `error-${index}`)}
406
411
  >
407
- {file.hint}
408
- </Typography>
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
- <Typography
447
- variant="t3"
448
- color={!file.error ? Color.gray[700] : Color.danger[500]}
449
- >
450
- {file.hint}
451
- </Typography>
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'}
@@ -1 +1,170 @@
1
- export default function InputMonth() {}
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
+ /**
65
+ * Back to the 0-based index MonthPicker indexes its options by. Anything
66
+ * outside 1-12 maps to nothing, matching what the field renders.
67
+ */
68
+ const zeroBased = (month: number | null | undefined) =>
69
+ month === null || month === undefined || month < 1 || month > 12
70
+ ? null
71
+ : month - 1;
72
+
73
+ export default function InputMonth({
74
+ label,
75
+ placeholder,
76
+ placeholderEnd,
77
+ value,
78
+ valueEnd,
79
+ mode = 'single',
80
+ onSelectClick,
81
+ onPickerClose,
82
+ onChange,
83
+ language,
84
+ hasClear,
85
+ title,
86
+ cancelLabel,
87
+ confirmLabel,
88
+ testID,
89
+ }: InputMonthProps) {
90
+ const [isOpen, setIsOpen] = useState(false);
91
+ const [selected, setSelected] = useState<PickerFieldValue>(EMPTY);
92
+
93
+ // A given prop wins, so the field can be driven from outside; otherwise it
94
+ // shows whatever was last picked.
95
+ const start = value ?? (mode === 'range' ? selected.startValue : selected.value); // prettier-ignore
96
+ const end = valueEnd ?? selected.endValue;
97
+
98
+ // What the sheet should open on. Without this the picker only knows about
99
+ // taps it saw itself, so a value coming from a prop -- or a clear -- would
100
+ // show in the field but leave the sheet blank.
101
+ const pickerValue =
102
+ mode === 'range'
103
+ ? { startDate: zeroBased(start), endDate: zeroBased(end) }
104
+ : ([zeroBased(start)].filter((m) => m !== null) as number[]);
105
+
106
+ const handleOpen = () => {
107
+ setIsOpen(true);
108
+ onSelectClick?.();
109
+ };
110
+
111
+ const handleClose = () => {
112
+ setIsOpen(false);
113
+ onPickerClose?.();
114
+ };
115
+
116
+ const handleChange = (
117
+ picked: number[] | { startDate: number | null; endDate: number | null }
118
+ ) => {
119
+ // MonthPicker reports an array in single mode and a pair in range mode,
120
+ // both 0-based. Shift to 1-based on the way out, so January is 1 for the
121
+ // consumer -- the picker's indices never leak past this line.
122
+ const oneBased = (month: number | null | undefined) =>
123
+ month === null || month === undefined ? null : month + 1;
124
+
125
+ const next: PickerFieldValue = Array.isArray(picked)
126
+ ? { value: oneBased(picked[0]), startValue: null, endValue: null }
127
+ : {
128
+ value: null,
129
+ startValue: oneBased(picked.startDate),
130
+ endValue: oneBased(picked.endDate),
131
+ };
132
+
133
+ setSelected(next);
134
+ onChange?.(next);
135
+ };
136
+
137
+ const handleClear = () => {
138
+ setSelected(EMPTY);
139
+ onChange?.(EMPTY);
140
+ };
141
+
142
+ return (
143
+ <View>
144
+ <PickerField
145
+ label={label}
146
+ placeholder={placeholder}
147
+ placeholderEnd={placeholderEnd}
148
+ mode={mode}
149
+ display={monthLabel(start, language)}
150
+ displayEnd={monthLabel(end, language)}
151
+ hasClear={hasClear}
152
+ onPress={handleOpen}
153
+ onClear={handleClear}
154
+ testID={testID}
155
+ />
156
+
157
+ <MonthPicker
158
+ testID={testID}
159
+ isOpen={isOpen}
160
+ mode={mode}
161
+ value={pickerValue}
162
+ onClose={handleClose}
163
+ onChange={handleChange}
164
+ {...(title ? { title } : {})}
165
+ {...(cancelLabel ? { cancelLabel } : {})}
166
+ {...(confirmLabel ? { confirmLabel } : {})}
167
+ />
168
+ </View>
169
+ );
170
+ }
@@ -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 ? <LabelForm title={label} /> : null}
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 color={hasError ? Color.danger[500] : ''} variant="t3">
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(props: InputPasswordProps) {
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)}
@@ -1,19 +1,18 @@
1
- import {
2
- Badge,
3
- Color,
4
- Icon,
5
- LabelForm,
6
- Select,
7
- Typography,
8
- type ChipOptionProps,
9
- type IconNameProps,
10
- } from '@herca/rn-kit';
1
+ import Badge from '../Badge/Badge';
2
+ import Color from '../Color/Color';
3
+ import Icon from '../Icon/Icon';
4
+ import LabelForm from '../LabelForm/LabelForm';
5
+ import Select from '../Select/Select';
6
+ import Typography from '../Typography/Typography';
7
+ import type { ChipOptionProps } from '../Chip/type';
8
+ import type { IconNameProps } from '../Icon/type';
11
9
  import { useState, useEffect } from 'react';
12
10
  import { Pressable, StyleSheet, TouchableOpacity, View } from 'react-native';
13
11
  import { spacing } from '../styles/spacing';
14
12
  import { border } from '../styles/border';
15
13
  import { layouting } from '../styles/layouting';
16
14
  import type { Variant } from '../Badge/type';
15
+ import { getTestID } from '../helpers/getTestID';
17
16
 
18
17
  type SelectProps = React.ComponentProps<typeof Select>;
19
18
  type SelectPropsWithoutData = Omit<SelectProps, 'data'>;
@@ -59,6 +58,7 @@ export default function InputSelect({
59
58
  useModal = true,
60
59
  required,
61
60
  labelColor,
61
+ testID,
62
62
  ...props
63
63
  }: Props) {
64
64
  const [isSelectOpen, setSelectOpen] = useState<boolean>(false);
@@ -83,12 +83,23 @@ export default function InputSelect({
83
83
  setInternalValue(value);
84
84
  }, [value]);
85
85
 
86
+ // Strip any caller-provided testID out of selectProps before spreading it
87
+ // onto <Select>, so it can never clobber the derived `-sheet` id below.
88
+ const selectPropsWithoutTestID = { ...selectProps };
89
+ delete selectPropsWithoutTestID.testID;
90
+
86
91
  return (
87
92
  <View style={spacing.gap[4]}>
88
- <LabelForm title={label} required={required} color={labelColor} />
93
+ <LabelForm
94
+ testID={getTestID(testID, 'label')}
95
+ title={label}
96
+ required={required}
97
+ color={labelColor}
98
+ />
89
99
 
90
100
  <View style={[spacing.gap[4], layouting.flex.grow]}>
91
101
  <Pressable
102
+ testID={getTestID(testID, 'trigger')}
92
103
  style={[
93
104
  styles.select,
94
105
  hasError && border.color.danger[300],
@@ -138,7 +149,11 @@ export default function InputSelect({
138
149
  {/* right icon and action */}
139
150
  <View style={[layouting.flex.rowCenter, spacing.gap[8]]}>
140
151
  {onClear && internalValue && (
141
- <TouchableOpacity activeOpacity={0.7} onPress={handleClear}>
152
+ <TouchableOpacity
153
+ testID={getTestID(testID, 'clear')}
154
+ activeOpacity={0.7}
155
+ onPress={handleClear}
156
+ >
142
157
  <Icon name="x-circle" size={20} color="#aaa" />
143
158
  </TouchableOpacity>
144
159
  )}
@@ -152,6 +167,7 @@ export default function InputSelect({
152
167
 
153
168
  {hint && (
154
169
  <Typography
170
+ testID={getTestID(testID, 'error')}
155
171
  variant="t3"
156
172
  color={hasError ? Color.danger[500] : Color.gray[700]}
157
173
  weight="medium"
@@ -164,8 +180,9 @@ export default function InputSelect({
164
180
 
165
181
  {useModal && (
166
182
  <Select
183
+ testID={testID}
167
184
  isOpen={isSelectOpen}
168
- {...selectProps}
185
+ {...selectPropsWithoutTestID}
169
186
  data={options ?? []}
170
187
  onClose={handleCloseSelect}
171
188
  />