rsuite 6.0.0-canary-20250416 → 6.0.0-canary-20250507

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 (547) hide show
  1. package/AutoComplete/styles/index.css +32 -71
  2. package/Button/styles/index.css +4 -6
  3. package/CHANGELOG.md +15 -0
  4. package/Calendar/styles/index.css +8 -16
  5. package/CascadeTree/styles/index.css +8 -16
  6. package/Cascader/styles/index.css +36 -79
  7. package/CheckPicker/styles/index.css +32 -66
  8. package/CheckTree/styles/index.css +34 -70
  9. package/CheckTreePicker/styles/index.css +34 -70
  10. package/Checkbox/styles/index.css +7 -9
  11. package/Checkbox/styles/index.less +1 -1
  12. package/DateInput/styles/index.css +6 -9
  13. package/DatePicker/styles/index.css +38 -81
  14. package/DateRangeInput/styles/index.css +6 -9
  15. package/DateRangePicker/styles/index.css +38 -81
  16. package/Dropdown/styles/index.css +6 -10
  17. package/FormControl/styles/index.css +2 -2
  18. package/FormControl/styles/index.less +2 -2
  19. package/IconButton/styles/index.css +4 -6
  20. package/Input/styles/index.css +6 -9
  21. package/Input/styles/mixin.less +2 -3
  22. package/InputGroup/styles/index.css +7 -13
  23. package/InputGroup/styles/index.less +3 -4
  24. package/InputNumber/styles/index.css +36 -35
  25. package/InputNumber/styles/index.less +1 -67
  26. package/InputPicker/styles/index.css +32 -71
  27. package/Message/styles/index.css +5 -15
  28. package/Message/styles/index.less +4 -3
  29. package/MultiCascadeTree/styles/index.css +38 -80
  30. package/MultiCascader/styles/index.css +38 -80
  31. package/Nav/styles/index.css +8 -14
  32. package/Navbar/styles/index.css +16 -40
  33. package/NumberInput/package.json +7 -0
  34. package/NumberInput/styles/index.css +1402 -0
  35. package/NumberInput/styles/index.less +74 -0
  36. package/{InputNumber → NumberInput}/styles/mixin.less +0 -0
  37. package/Pagination/styles/index.css +34 -75
  38. package/PasswordInput/styles/index.css +6 -9
  39. package/PinInput/package.json +7 -0
  40. package/PinInput/styles/index.css +212 -0
  41. package/PinInput/styles/index.less +66 -0
  42. package/Radio/styles/index.css +7 -9
  43. package/Radio/styles/index.less +1 -1
  44. package/RangeSlider/styles/index.css +2 -0
  45. package/SelectPicker/styles/index.css +32 -71
  46. package/Sidenav/styles/index.css +30 -67
  47. package/Slider/styles/index.css +2 -0
  48. package/Slider/styles/index.less +2 -0
  49. package/Stat/styles/index.css +4 -6
  50. package/Tabs/styles/index.css +8 -14
  51. package/Tag/styles/index.css +0 -15
  52. package/TagInput/styles/index.css +34 -72
  53. package/TagPicker/styles/index.css +34 -72
  54. package/TimePicker/styles/index.css +38 -81
  55. package/TimeRangePicker/styles/index.css +38 -81
  56. package/Toggle/styles/index.css +9 -13
  57. package/Toggle/styles/index.less +3 -4
  58. package/Tree/styles/index.css +34 -75
  59. package/TreePicker/styles/index.css +34 -75
  60. package/Uploader/styles/index.css +6 -10
  61. package/cjs/Accordion/Accordion.js +2 -2
  62. package/cjs/Affix/Affix.js +1 -2
  63. package/cjs/Animation/Bounce.js +1 -2
  64. package/cjs/Animation/Collapse.js +1 -2
  65. package/cjs/Animation/Fade.js +1 -2
  66. package/cjs/Animation/Slide.js +1 -2
  67. package/cjs/AutoComplete/AutoComplete.d.ts +2 -2
  68. package/cjs/AutoComplete/AutoComplete.js +1 -2
  69. package/cjs/Avatar/Avatar.js +1 -2
  70. package/cjs/AvatarGroup/AvatarGroup.js +1 -2
  71. package/cjs/Badge/Badge.js +1 -2
  72. package/cjs/Breadcrumb/Breadcrumb.js +1 -2
  73. package/cjs/Button/Button.d.ts +2 -2
  74. package/cjs/Button/Button.js +1 -2
  75. package/cjs/ButtonGroup/ButtonGroup.d.ts +2 -2
  76. package/cjs/ButtonGroup/ButtonGroup.js +1 -2
  77. package/cjs/ButtonToolbar/ButtonToolbar.js +1 -2
  78. package/cjs/Calendar/Calendar.js +4 -4
  79. package/cjs/Calendar/CalendarBody.js +1 -4
  80. package/cjs/Calendar/CalendarContainer.js +1 -1
  81. package/cjs/Calendar/CalendarHeader.js +3 -3
  82. package/cjs/Calendar/CalendarProvider.d.ts +1 -1
  83. package/cjs/Calendar/Grid/GridCell.js +1 -2
  84. package/cjs/Calendar/Grid/GridHeaderRow.js +1 -2
  85. package/cjs/Calendar/Grid/GridRow.d.ts +2 -0
  86. package/cjs/Calendar/Grid/GridRow.js +5 -4
  87. package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -2
  88. package/cjs/Calendar/hooks/useCalendar.d.ts +24 -2
  89. package/cjs/Calendar/hooks/useCalendar.js +34 -1
  90. package/cjs/Card/Card.js +1 -2
  91. package/cjs/CardGroup/CardGroup.js +1 -2
  92. package/cjs/Carousel/Carousel.js +1 -2
  93. package/cjs/CascadeTree/CascadeTree.js +1 -2
  94. package/cjs/CascadeTree/SearchView.js +1 -2
  95. package/cjs/CascadeTree/TreeView.js +1 -2
  96. package/cjs/Cascader/Cascader.js +1 -2
  97. package/cjs/CheckPicker/CheckPicker.js +1 -2
  98. package/cjs/CheckTree/CheckTree.js +1 -2
  99. package/cjs/CheckTree/CheckTreeNode.js +1 -2
  100. package/cjs/CheckTree/CheckTreeView.js +1 -2
  101. package/cjs/CheckTreePicker/CheckTreePicker.js +1 -2
  102. package/cjs/Checkbox/Checkbox.js +1 -2
  103. package/cjs/CheckboxGroup/CheckboxGroup.js +1 -2
  104. package/cjs/Container/Container.js +1 -2
  105. package/cjs/CustomProvider/CustomProvider.d.ts +1 -271
  106. package/cjs/CustomProvider/CustomProvider.js +2 -3
  107. package/cjs/CustomProvider/index.d.ts +1 -6
  108. package/cjs/CustomProvider/index.js +3 -12
  109. package/cjs/DateInput/DateInput.js +1 -2
  110. package/cjs/DateInput/hooks/useDateInputState.js +2 -2
  111. package/cjs/DatePicker/DatePicker.js +2 -3
  112. package/cjs/DatePicker/hooks/useFocus.js +1 -2
  113. package/cjs/DateRangeInput/DateRangeInput.js +1 -2
  114. package/cjs/DateRangePicker/DateRangePicker.js +2 -3
  115. package/cjs/DateRangePicker/Header.js +3 -3
  116. package/cjs/DateRangePicker/utils.d.ts +1 -1
  117. package/cjs/DateRangePicker/utils.js +1 -1
  118. package/cjs/Divider/Divider.js +1 -2
  119. package/cjs/Drawer/Drawer.js +1 -2
  120. package/cjs/Dropdown/Dropdown.js +1 -2
  121. package/cjs/Dropdown/DropdownMenu.js +1 -2
  122. package/cjs/FlexboxGrid/FlexboxGrid.js +1 -2
  123. package/cjs/Form/Form.js +1 -2
  124. package/cjs/Form/FormContext.d.ts +1 -1
  125. package/cjs/Form/hooks/useFormValidate.js +5 -5
  126. package/cjs/FormControl/FormControl.js +54 -86
  127. package/cjs/FormControlLabel/FormControlLabel.js +1 -2
  128. package/cjs/FormErrorMessage/FormErrorMessage.js +1 -2
  129. package/cjs/FormGroup/FormGroup.js +1 -2
  130. package/cjs/FormHelpText/FormHelpText.js +1 -2
  131. package/cjs/FormStack/FormStack.js +1 -2
  132. package/cjs/Grid/Col.js +1 -2
  133. package/cjs/Grid/Grid.js +1 -2
  134. package/cjs/Grid/Row.js +1 -2
  135. package/cjs/Heading/Heading.js +1 -2
  136. package/cjs/Highlight/Highlight.js +2 -3
  137. package/cjs/IconButton/IconButton.js +1 -2
  138. package/cjs/Image/Image.js +2 -3
  139. package/cjs/InlineEdit/InlineEdit.js +1 -2
  140. package/cjs/Input/Input.js +3 -3
  141. package/cjs/InputGroup/InputGroup.js +1 -2
  142. package/cjs/InputNumber/index.d.ts +12 -2
  143. package/cjs/InputNumber/index.js +11 -4
  144. package/cjs/InputPicker/InputPicker.js +1 -2
  145. package/cjs/InputPicker/utils.d.ts +1 -1
  146. package/cjs/Kbd/Kbd.js +1 -2
  147. package/cjs/Link/Link.js +1 -2
  148. package/cjs/List/List.js +1 -2
  149. package/cjs/Loader/Loader.js +1 -2
  150. package/cjs/MaskedInput/MaskedInput.js +2 -2
  151. package/cjs/Message/Message.js +1 -2
  152. package/cjs/Modal/Modal.js +1 -2
  153. package/cjs/Modal/ModalHeader.js +1 -2
  154. package/cjs/MultiCascadeTree/MultiCascadeTree.js +1 -2
  155. package/cjs/MultiCascadeTree/SearchView.js +1 -2
  156. package/cjs/MultiCascadeTree/TreeView.js +1 -2
  157. package/cjs/MultiCascader/MultiCascader.js +1 -2
  158. package/cjs/Nav/Nav.js +1 -2
  159. package/cjs/Nav/NavDropdownMenu.js +1 -2
  160. package/cjs/Navbar/Navbar.d.ts +1 -1
  161. package/cjs/Navbar/Navbar.js +1 -2
  162. package/cjs/Navbar/NavbarDropdownMenu.js +1 -2
  163. package/cjs/Navbar/NavbarToggle.d.ts +8 -3
  164. package/cjs/Navbar/NavbarToggle.js +9 -14
  165. package/cjs/Notification/Notification.js +1 -2
  166. package/{esm/InputNumber/InputNumber.d.ts → cjs/NumberInput/NumberInput.d.ts} +20 -8
  167. package/cjs/NumberInput/NumberInput.js +162 -0
  168. package/cjs/NumberInput/hooks/useEvents.d.ts +22 -0
  169. package/cjs/NumberInput/hooks/useEvents.js +114 -0
  170. package/cjs/NumberInput/hooks/useNumberInputValue.d.ts +7 -0
  171. package/cjs/NumberInput/hooks/useNumberInputValue.js +34 -0
  172. package/cjs/NumberInput/hooks/useWheelHandler.d.ts +5 -0
  173. package/cjs/NumberInput/hooks/useWheelHandler.js +25 -0
  174. package/cjs/NumberInput/index.d.ts +4 -0
  175. package/cjs/NumberInput/index.js +11 -0
  176. package/cjs/NumberInput/utils/number.d.ts +17 -0
  177. package/cjs/NumberInput/utils/number.js +67 -0
  178. package/cjs/Pagination/LimitPicker.d.ts +2 -2
  179. package/cjs/Pagination/Pagination.d.ts +2 -2
  180. package/cjs/Pagination/Pagination.js +1 -2
  181. package/cjs/Pagination/PaginationGroup.js +1 -2
  182. package/cjs/Panel/Panel.js +1 -2
  183. package/cjs/PanelGroup/PanelGroup.js +1 -2
  184. package/cjs/PasswordInput/PasswordInput.d.ts +4 -0
  185. package/cjs/PasswordInput/PasswordInput.js +5 -4
  186. package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.js +1 -2
  187. package/cjs/PinInput/PinInput.d.ts +36 -0
  188. package/cjs/PinInput/PinInput.js +224 -0
  189. package/cjs/PinInput/hooks/usePinInputRefs.d.ts +12 -0
  190. package/cjs/PinInput/hooks/usePinInputRefs.js +62 -0
  191. package/cjs/PinInput/hooks/usePinValue.d.ts +14 -0
  192. package/cjs/PinInput/hooks/usePinValue.js +73 -0
  193. package/cjs/PinInput/index.d.ts +4 -0
  194. package/cjs/PinInput/index.js +9 -0
  195. package/cjs/Placeholder/PlaceholderGraph.js +1 -2
  196. package/cjs/Placeholder/PlaceholderGrid.js +1 -2
  197. package/cjs/Placeholder/PlaceholderParagraph.js +1 -2
  198. package/cjs/Popover/Popover.js +1 -2
  199. package/cjs/Progress/ProgressCircle.js +1 -2
  200. package/cjs/Progress/ProgressLine.js +1 -2
  201. package/cjs/Radio/Radio.js +1 -2
  202. package/cjs/RadioGroup/RadioGroup.js +1 -2
  203. package/cjs/RadioTile/RadioTile.js +1 -2
  204. package/cjs/RadioTileGroup/RadioTileGroup.js +1 -2
  205. package/cjs/RangeSlider/RangeSlider.js +2 -3
  206. package/cjs/Rate/Rate.js +1 -2
  207. package/cjs/SelectPicker/SelectPicker.js +1 -2
  208. package/cjs/Sidebar/Sidebar.js +1 -2
  209. package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +1 -2
  210. package/cjs/Sidenav/Sidenav.js +1 -2
  211. package/cjs/Sidenav/SidenavDropdownMenu.js +1 -2
  212. package/cjs/Slider/Slider.d.ts +5 -1
  213. package/cjs/Slider/Slider.js +13 -14
  214. package/cjs/Stack/Stack.js +1 -2
  215. package/cjs/Stat/Stat.js +1 -2
  216. package/cjs/Stat/StatValue.js +2 -2
  217. package/cjs/StatGroup/StatGroup.js +1 -2
  218. package/cjs/Steps/Steps.js +1 -2
  219. package/cjs/Table/Table.js +2 -2
  220. package/cjs/Tabs/Tabs.js +1 -2
  221. package/cjs/Tag/Tag.js +1 -2
  222. package/cjs/TagInput/TagInput.js +2 -2
  223. package/cjs/TagPicker/TagPicker.js +2 -2
  224. package/cjs/Text/Text.js +1 -2
  225. package/cjs/Textarea/Textarea.js +1 -2
  226. package/cjs/TimePicker/TimePicker.d.ts +1 -2
  227. package/cjs/TimePicker/TimePicker.js +2 -2
  228. package/cjs/TimeRangePicker/TimeRangePicker.js +2 -2
  229. package/cjs/Timeline/Timeline.js +1 -2
  230. package/cjs/Toggle/Toggle.js +1 -2
  231. package/cjs/Tooltip/Tooltip.js +1 -2
  232. package/cjs/Tree/Tree.js +1 -2
  233. package/cjs/Tree/TreeNode.js +1 -2
  234. package/cjs/Tree/TreeNodeToggle.js +1 -2
  235. package/cjs/Tree/TreeView.js +1 -2
  236. package/cjs/Tree/hooks/useFocusTree.js +1 -2
  237. package/cjs/TreePicker/TreePicker.js +1 -2
  238. package/cjs/Uploader/Uploader.js +1 -2
  239. package/cjs/Whisper/Whisper.js +2 -2
  240. package/cjs/index.d.ts +3 -0
  241. package/cjs/index.js +18 -0
  242. package/cjs/internals/Box/index.d.ts +1 -0
  243. package/cjs/internals/Box/index.js +1 -0
  244. package/cjs/internals/Burger/Burger.d.ts +16 -0
  245. package/cjs/internals/Burger/Burger.js +46 -0
  246. package/cjs/internals/Burger/index.d.ts +4 -0
  247. package/cjs/internals/Burger/index.js +11 -0
  248. package/cjs/internals/CloseButton/CloseButton.js +1 -2
  249. package/cjs/internals/Menu/Menu.js +1 -2
  250. package/cjs/internals/Menu/Menubar.js +2 -2
  251. package/cjs/internals/Picker/PickerIndicator.js +1 -2
  252. package/cjs/internals/Picker/hooks/useCombobox.d.ts +1 -1
  253. package/cjs/internals/Plaintext/Plaintext.js +1 -2
  254. package/cjs/internals/Provider/CustomContext.d.ts +253 -0
  255. package/cjs/internals/Provider/CustomContext.js +8 -0
  256. package/cjs/internals/Provider/types.d.ts +236 -0
  257. package/cjs/internals/Ripple/Ripple.js +1 -2
  258. package/cjs/internals/SafeAnchor/SafeAnchor.js +2 -2
  259. package/cjs/internals/Windowing/List.js +2 -2
  260. package/cjs/internals/hooks/index.d.ts +1 -0
  261. package/cjs/internals/hooks/index.js +3 -1
  262. package/cjs/{CustomProvider → internals/hooks}/useCustom.d.ts +4 -4
  263. package/cjs/{CustomProvider → internals/hooks}/useCustom.js +5 -5
  264. package/cjs/internals/hooks/useStyles.js +2 -2
  265. package/cjs/internals/hooks/useToggleCaret.js +2 -2
  266. package/cjs/{CustomProvider → internals/intl}/FormattedDate.js +2 -2
  267. package/cjs/{CustomProvider → internals/intl}/FormattedNumber.js +2 -2
  268. package/cjs/internals/types/picker.d.ts +2 -2
  269. package/cjs/internals/types/sizes.d.ts +2 -0
  270. package/cjs/internals/types/sizes.js +2 -1
  271. package/cjs/internals/utils/date/getWeekStartDates.d.ts +0 -1
  272. package/cjs/internals/utils/date/getWeekStartDates.js +2 -4
  273. package/cjs/internals/utils/react/createComponent.js +15 -4
  274. package/cjs/{FormControl → useFormControl}/hooks/useField.d.ts +3 -3
  275. package/cjs/{FormControl → useFormControl}/hooks/useField.js +5 -6
  276. package/cjs/useFormControl/hooks/useRegisterModel.d.ts +2 -0
  277. package/cjs/{FormControl → useFormControl}/hooks/useRegisterModel.js +2 -3
  278. package/cjs/useFormControl/index.d.ts +4 -0
  279. package/cjs/useFormControl/index.js +11 -0
  280. package/cjs/useFormControl/useFormControl.d.ts +38 -0
  281. package/cjs/useFormControl/useFormControl.js +138 -0
  282. package/cjs/{FormControl/utils.js → useFormControl/utils/nameToPath.js} +0 -0
  283. package/cjs/useToaster/useToaster.js +2 -5
  284. package/dist/rsuite-no-reset-rtl.css +246 -265
  285. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  286. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  287. package/dist/rsuite-no-reset.css +246 -265
  288. package/dist/rsuite-no-reset.min.css +1 -1
  289. package/dist/rsuite-no-reset.min.css.map +1 -1
  290. package/dist/rsuite-rtl.css +246 -265
  291. package/dist/rsuite-rtl.min.css +1 -1
  292. package/dist/rsuite-rtl.min.css.map +1 -1
  293. package/dist/rsuite.css +246 -265
  294. package/dist/rsuite.js +389 -257
  295. package/dist/rsuite.js.map +1 -1
  296. package/dist/rsuite.min.css +1 -1
  297. package/dist/rsuite.min.css.map +1 -1
  298. package/dist/rsuite.min.js +1 -1
  299. package/dist/rsuite.min.js.map +1 -1
  300. package/esm/Accordion/Accordion.js +1 -1
  301. package/esm/Affix/Affix.js +1 -2
  302. package/esm/Animation/Bounce.js +1 -2
  303. package/esm/Animation/Collapse.js +1 -2
  304. package/esm/Animation/Fade.js +1 -2
  305. package/esm/Animation/Slide.js +1 -2
  306. package/esm/AutoComplete/AutoComplete.d.ts +2 -2
  307. package/esm/AutoComplete/AutoComplete.js +1 -2
  308. package/esm/Avatar/Avatar.js +1 -2
  309. package/esm/AvatarGroup/AvatarGroup.js +1 -2
  310. package/esm/Badge/Badge.js +1 -2
  311. package/esm/Breadcrumb/Breadcrumb.js +1 -2
  312. package/esm/Button/Button.d.ts +2 -2
  313. package/esm/Button/Button.js +1 -2
  314. package/esm/ButtonGroup/ButtonGroup.d.ts +2 -2
  315. package/esm/ButtonGroup/ButtonGroup.js +1 -2
  316. package/esm/ButtonToolbar/ButtonToolbar.js +1 -2
  317. package/esm/Calendar/Calendar.js +3 -4
  318. package/esm/Calendar/CalendarBody.js +1 -4
  319. package/esm/Calendar/CalendarContainer.js +1 -1
  320. package/esm/Calendar/CalendarHeader.js +1 -1
  321. package/esm/Calendar/CalendarProvider.d.ts +1 -1
  322. package/esm/Calendar/Grid/GridCell.js +1 -2
  323. package/esm/Calendar/Grid/GridHeaderRow.js +1 -2
  324. package/esm/Calendar/Grid/GridRow.d.ts +2 -0
  325. package/esm/Calendar/Grid/GridRow.js +5 -4
  326. package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -2
  327. package/esm/Calendar/hooks/useCalendar.d.ts +24 -2
  328. package/esm/Calendar/hooks/useCalendar.js +35 -2
  329. package/esm/Card/Card.js +1 -2
  330. package/esm/CardGroup/CardGroup.js +1 -2
  331. package/esm/Carousel/Carousel.js +1 -2
  332. package/esm/CascadeTree/CascadeTree.js +1 -2
  333. package/esm/CascadeTree/SearchView.js +1 -2
  334. package/esm/CascadeTree/TreeView.js +1 -2
  335. package/esm/Cascader/Cascader.js +1 -2
  336. package/esm/CheckPicker/CheckPicker.js +1 -2
  337. package/esm/CheckTree/CheckTree.js +1 -2
  338. package/esm/CheckTree/CheckTreeNode.js +1 -2
  339. package/esm/CheckTree/CheckTreeView.js +1 -2
  340. package/esm/CheckTreePicker/CheckTreePicker.js +1 -2
  341. package/esm/Checkbox/Checkbox.js +1 -2
  342. package/esm/CheckboxGroup/CheckboxGroup.js +1 -2
  343. package/esm/Container/Container.js +1 -2
  344. package/esm/CustomProvider/CustomProvider.d.ts +1 -271
  345. package/esm/CustomProvider/CustomProvider.js +1 -1
  346. package/esm/CustomProvider/index.d.ts +1 -6
  347. package/esm/CustomProvider/index.js +0 -6
  348. package/esm/DateInput/DateInput.js +1 -2
  349. package/esm/DateInput/hooks/useDateInputState.js +1 -1
  350. package/esm/DatePicker/DatePicker.js +2 -3
  351. package/esm/DatePicker/hooks/useFocus.js +1 -2
  352. package/esm/DateRangeInput/DateRangeInput.js +1 -2
  353. package/esm/DateRangePicker/DateRangePicker.js +2 -3
  354. package/esm/DateRangePicker/Header.js +1 -1
  355. package/esm/DateRangePicker/utils.d.ts +1 -1
  356. package/esm/DateRangePicker/utils.js +1 -1
  357. package/esm/Divider/Divider.js +1 -2
  358. package/esm/Drawer/Drawer.js +1 -2
  359. package/esm/Dropdown/Dropdown.js +1 -2
  360. package/esm/Dropdown/DropdownMenu.js +1 -2
  361. package/esm/FlexboxGrid/FlexboxGrid.js +1 -2
  362. package/esm/Form/Form.js +1 -2
  363. package/esm/Form/FormContext.d.ts +1 -1
  364. package/esm/Form/hooks/useFormValidate.js +1 -1
  365. package/esm/FormControl/FormControl.js +54 -85
  366. package/esm/FormControlLabel/FormControlLabel.js +1 -2
  367. package/esm/FormErrorMessage/FormErrorMessage.js +1 -2
  368. package/esm/FormGroup/FormGroup.js +1 -2
  369. package/esm/FormHelpText/FormHelpText.js +1 -2
  370. package/esm/FormStack/FormStack.js +1 -2
  371. package/esm/Grid/Col.js +1 -2
  372. package/esm/Grid/Grid.js +1 -2
  373. package/esm/Grid/Row.js +1 -2
  374. package/esm/Heading/Heading.js +1 -2
  375. package/esm/Highlight/Highlight.js +2 -3
  376. package/esm/IconButton/IconButton.js +1 -2
  377. package/esm/Image/Image.js +2 -3
  378. package/esm/InlineEdit/InlineEdit.js +1 -2
  379. package/esm/Input/Input.js +2 -2
  380. package/esm/InputGroup/InputGroup.js +1 -2
  381. package/esm/InputNumber/index.d.ts +12 -2
  382. package/esm/InputNumber/index.js +8 -1
  383. package/esm/InputPicker/InputPicker.js +1 -2
  384. package/esm/InputPicker/utils.d.ts +1 -1
  385. package/esm/Kbd/Kbd.js +1 -2
  386. package/esm/Link/Link.js +1 -2
  387. package/esm/List/List.js +1 -2
  388. package/esm/Loader/Loader.js +1 -2
  389. package/esm/MaskedInput/MaskedInput.js +1 -1
  390. package/esm/Message/Message.js +1 -2
  391. package/esm/Modal/Modal.js +1 -2
  392. package/esm/Modal/ModalHeader.js +1 -2
  393. package/esm/MultiCascadeTree/MultiCascadeTree.js +1 -2
  394. package/esm/MultiCascadeTree/SearchView.js +1 -2
  395. package/esm/MultiCascadeTree/TreeView.js +1 -2
  396. package/esm/MultiCascader/MultiCascader.js +1 -2
  397. package/esm/Nav/Nav.js +1 -2
  398. package/esm/Nav/NavDropdownMenu.js +1 -2
  399. package/esm/Navbar/Navbar.d.ts +1 -1
  400. package/esm/Navbar/Navbar.js +1 -2
  401. package/esm/Navbar/NavbarDropdownMenu.js +1 -2
  402. package/esm/Navbar/NavbarToggle.d.ts +8 -3
  403. package/esm/Navbar/NavbarToggle.js +10 -15
  404. package/esm/Notification/Notification.js +1 -2
  405. package/{cjs/InputNumber/InputNumber.d.ts → esm/NumberInput/NumberInput.d.ts} +20 -8
  406. package/esm/NumberInput/NumberInput.js +157 -0
  407. package/esm/NumberInput/hooks/useEvents.d.ts +22 -0
  408. package/esm/NumberInput/hooks/useEvents.js +110 -0
  409. package/esm/NumberInput/hooks/useNumberInputValue.d.ts +7 -0
  410. package/esm/NumberInput/hooks/useNumberInputValue.js +29 -0
  411. package/esm/NumberInput/hooks/useWheelHandler.d.ts +5 -0
  412. package/esm/NumberInput/hooks/useWheelHandler.js +21 -0
  413. package/esm/NumberInput/index.d.ts +4 -0
  414. package/esm/NumberInput/index.js +8 -0
  415. package/esm/NumberInput/utils/number.d.ts +17 -0
  416. package/esm/NumberInput/utils/number.js +59 -0
  417. package/esm/Pagination/LimitPicker.d.ts +2 -2
  418. package/esm/Pagination/Pagination.d.ts +2 -2
  419. package/esm/Pagination/Pagination.js +1 -2
  420. package/esm/Pagination/PaginationGroup.js +1 -2
  421. package/esm/Panel/Panel.js +1 -2
  422. package/esm/PanelGroup/PanelGroup.js +1 -2
  423. package/esm/PasswordInput/PasswordInput.d.ts +4 -0
  424. package/esm/PasswordInput/PasswordInput.js +5 -4
  425. package/esm/PasswordStrengthMeter/PasswordStrengthMeter.js +1 -2
  426. package/esm/PinInput/PinInput.d.ts +36 -0
  427. package/esm/PinInput/PinInput.js +219 -0
  428. package/esm/PinInput/hooks/usePinInputRefs.d.ts +12 -0
  429. package/esm/PinInput/hooks/usePinInputRefs.js +58 -0
  430. package/esm/PinInput/hooks/usePinValue.d.ts +14 -0
  431. package/esm/PinInput/hooks/usePinValue.js +69 -0
  432. package/esm/PinInput/index.d.ts +4 -0
  433. package/esm/PinInput/index.js +4 -0
  434. package/esm/Placeholder/PlaceholderGraph.js +1 -2
  435. package/esm/Placeholder/PlaceholderGrid.js +1 -2
  436. package/esm/Placeholder/PlaceholderParagraph.js +1 -2
  437. package/esm/Popover/Popover.js +1 -2
  438. package/esm/Progress/ProgressCircle.js +1 -2
  439. package/esm/Progress/ProgressLine.js +1 -2
  440. package/esm/Radio/Radio.js +1 -2
  441. package/esm/RadioGroup/RadioGroup.js +1 -2
  442. package/esm/RadioTile/RadioTile.js +1 -2
  443. package/esm/RadioTileGroup/RadioTileGroup.js +1 -2
  444. package/esm/RangeSlider/RangeSlider.js +1 -2
  445. package/esm/Rate/Rate.js +1 -2
  446. package/esm/SelectPicker/SelectPicker.js +1 -2
  447. package/esm/Sidebar/Sidebar.js +1 -2
  448. package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +1 -2
  449. package/esm/Sidenav/Sidenav.js +1 -2
  450. package/esm/Sidenav/SidenavDropdownMenu.js +1 -2
  451. package/esm/Slider/Slider.d.ts +5 -1
  452. package/esm/Slider/Slider.js +12 -13
  453. package/esm/Stack/Stack.js +1 -2
  454. package/esm/Stat/Stat.js +1 -2
  455. package/esm/Stat/StatValue.js +1 -1
  456. package/esm/StatGroup/StatGroup.js +1 -2
  457. package/esm/Steps/Steps.js +1 -2
  458. package/esm/Table/Table.js +1 -1
  459. package/esm/Tabs/Tabs.js +1 -2
  460. package/esm/Tag/Tag.js +1 -2
  461. package/esm/TagInput/TagInput.js +1 -1
  462. package/esm/TagPicker/TagPicker.js +1 -1
  463. package/esm/Text/Text.js +1 -2
  464. package/esm/Textarea/Textarea.js +1 -2
  465. package/esm/TimePicker/TimePicker.d.ts +1 -2
  466. package/esm/TimePicker/TimePicker.js +1 -1
  467. package/esm/TimeRangePicker/TimeRangePicker.js +1 -1
  468. package/esm/Timeline/Timeline.js +1 -2
  469. package/esm/Toggle/Toggle.js +1 -2
  470. package/esm/Tooltip/Tooltip.js +1 -2
  471. package/esm/Tree/Tree.js +1 -2
  472. package/esm/Tree/TreeNode.js +1 -2
  473. package/esm/Tree/TreeNodeToggle.js +1 -2
  474. package/esm/Tree/TreeView.js +1 -2
  475. package/esm/Tree/hooks/useFocusTree.js +1 -2
  476. package/esm/TreePicker/TreePicker.js +1 -2
  477. package/esm/Uploader/Uploader.js +1 -2
  478. package/esm/Whisper/Whisper.js +1 -1
  479. package/esm/index.d.ts +3 -0
  480. package/esm/index.js +3 -0
  481. package/esm/internals/Box/index.d.ts +1 -0
  482. package/esm/internals/Box/index.js +1 -0
  483. package/esm/internals/Burger/Burger.d.ts +16 -0
  484. package/esm/internals/Burger/Burger.js +41 -0
  485. package/esm/internals/Burger/index.d.ts +4 -0
  486. package/esm/internals/Burger/index.js +8 -0
  487. package/esm/internals/CloseButton/CloseButton.js +1 -2
  488. package/esm/internals/Menu/Menu.js +1 -1
  489. package/esm/internals/Menu/Menubar.js +1 -1
  490. package/esm/internals/Picker/PickerIndicator.js +1 -2
  491. package/esm/internals/Picker/hooks/useCombobox.d.ts +1 -1
  492. package/esm/internals/Plaintext/Plaintext.js +1 -2
  493. package/esm/internals/Provider/CustomContext.d.ts +253 -0
  494. package/esm/internals/Provider/CustomContext.js +3 -0
  495. package/esm/internals/Provider/types.d.ts +236 -0
  496. package/esm/internals/Ripple/Ripple.js +1 -2
  497. package/esm/internals/SafeAnchor/SafeAnchor.js +1 -1
  498. package/esm/internals/Windowing/List.js +1 -1
  499. package/esm/internals/hooks/index.d.ts +1 -0
  500. package/esm/internals/hooks/index.js +1 -0
  501. package/esm/{CustomProvider → internals/hooks}/useCustom.d.ts +4 -4
  502. package/esm/{CustomProvider → internals/hooks}/useCustom.js +4 -4
  503. package/esm/internals/hooks/useStyles.js +1 -1
  504. package/esm/internals/hooks/useToggleCaret.js +1 -1
  505. package/esm/{CustomProvider → internals/intl}/FormattedDate.js +1 -1
  506. package/esm/{CustomProvider → internals/intl}/FormattedNumber.js +1 -1
  507. package/esm/internals/types/picker.d.ts +2 -2
  508. package/esm/internals/types/sizes.d.ts +2 -0
  509. package/esm/internals/types/sizes.js +3 -1
  510. package/esm/internals/utils/date/getWeekStartDates.d.ts +0 -1
  511. package/esm/internals/utils/date/getWeekStartDates.js +2 -4
  512. package/esm/internals/utils/react/createComponent.js +12 -2
  513. package/esm/{FormControl → useFormControl}/hooks/useField.d.ts +3 -3
  514. package/esm/{FormControl → useFormControl}/hooks/useField.js +4 -5
  515. package/esm/useFormControl/hooks/useRegisterModel.d.ts +2 -0
  516. package/esm/{FormControl → useFormControl}/hooks/useRegisterModel.js +2 -3
  517. package/esm/useFormControl/index.d.ts +4 -0
  518. package/esm/useFormControl/index.js +8 -0
  519. package/esm/useFormControl/useFormControl.d.ts +38 -0
  520. package/esm/useFormControl/useFormControl.js +133 -0
  521. package/esm/{FormControl/utils.js → useFormControl/utils/nameToPath.js} +0 -0
  522. package/esm/useToaster/useToaster.js +1 -3
  523. package/internals/Burger/styles/index.less +67 -0
  524. package/internals/CloseButton/styles/index.less +0 -10
  525. package/internals/Picker/styles/index.less +13 -10
  526. package/internals/Picker/styles/mixin.less +3 -3
  527. package/package.json +3 -3
  528. package/styles/color-modes/dark.less +7 -10
  529. package/styles/color-modes/high-contrast.less +3 -6
  530. package/styles/color-modes/light.less +5 -8
  531. package/styles/index.less +3 -1
  532. package/styles/mixins/utilities.less +2 -5
  533. package/useFormControl/package.json +7 -0
  534. package/cjs/CustomProvider/types.d.ts +0 -234
  535. package/cjs/FormControl/hooks/useRegisterModel.d.ts +0 -3
  536. package/cjs/InputNumber/InputNumber.js +0 -300
  537. package/esm/CustomProvider/types.d.ts +0 -234
  538. package/esm/FormControl/hooks/useRegisterModel.d.ts +0 -3
  539. package/esm/InputNumber/InputNumber.js +0 -293
  540. /package/cjs/{CustomProvider → internals/Provider}/types.js +0 -0
  541. /package/cjs/{CustomProvider → internals/intl}/FormattedDate.d.ts +0 -0
  542. /package/cjs/{CustomProvider → internals/intl}/FormattedNumber.d.ts +0 -0
  543. /package/cjs/{FormControl/utils.d.ts → useFormControl/utils/nameToPath.d.ts} +0 -0
  544. /package/esm/{CustomProvider → internals/Provider}/types.js +0 -0
  545. /package/esm/{CustomProvider → internals/intl}/FormattedDate.d.ts +0 -0
  546. /package/esm/{CustomProvider → internals/intl}/FormattedNumber.d.ts +0 -0
  547. /package/esm/{FormControl/utils.d.ts → useFormControl/utils/nameToPath.d.ts} +0 -0
@@ -0,0 +1,36 @@
1
+ import { BoxProps } from '../internals/Box';
2
+ import type { BasicSize } from '../internals/types';
3
+ export interface PinInputProps extends BoxProps {
4
+ /** Whether input fields are attached (no gap between) */
5
+ attached?: boolean;
6
+ /** Whether to auto-focus the first input on mount */
7
+ autoFocus?: boolean;
8
+ /** Type of allowed input: number, alphabetic, alphanumeric, or custom regex */
9
+ type?: 'number' | 'alphabetic' | 'alphanumeric' | RegExp;
10
+ /** Default PIN value */
11
+ defaultValue?: string;
12
+ /** Whether to disable PIN input */
13
+ disabled?: boolean;
14
+ /** Number of PIN digits */
15
+ length?: number;
16
+ /** Whether to mask PIN input (like password) */
17
+ mask?: boolean;
18
+ /** Name for form submission */
19
+ name?: string;
20
+ /** Whether to optimize for one-time password (OTP) input */
21
+ otp?: boolean;
22
+ /** Placeholder for input fields */
23
+ placeholder?: string;
24
+ /** Whether the input is read-only */
25
+ readOnly?: boolean;
26
+ /** Input size */
27
+ size?: BasicSize;
28
+ /** PIN value */
29
+ value?: string;
30
+ /** Callback function when PIN input is completed */
31
+ onComplete?: (value: string) => void;
32
+ /** Callback function when PIN value changes */
33
+ onChange?: (value: string) => void;
34
+ }
35
+ declare const PinInput: import("../internals/types").InternalRefForwardingComponent<"div", PinInputProps, never> & Record<string, never>;
36
+ export default PinInput;
@@ -0,0 +1,224 @@
1
+ 'use client';
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _Input = _interopRequireDefault(require("../Input"));
10
+ var _usePinInputRefs = _interopRequireDefault(require("./hooks/usePinInputRefs"));
11
+ var _usePinValue = _interopRequireDefault(require("./hooks/usePinValue"));
12
+ var _Box = require("../internals/Box");
13
+ var _Stack = require("../Stack");
14
+ var _utils = require("../internals/utils");
15
+ var _hooks = require("../internals/hooks");
16
+ /**
17
+ * Map `type` prop to regex for allowed keys
18
+ */
19
+ function getAllowedKeys(type) {
20
+ if (type instanceof RegExp) {
21
+ return type;
22
+ }
23
+ switch (type) {
24
+ case 'alphabetic':
25
+ return /[A-Za-z]/;
26
+ case 'alphanumeric':
27
+ return /[A-Za-z0-9]/;
28
+ default:
29
+ // number and any other fallback
30
+ return /\d/;
31
+ }
32
+ }
33
+ const PinInput = (0, _utils.forwardRef)((props, ref) => {
34
+ const {
35
+ propsWithDefaults
36
+ } = (0, _hooks.useCustom)('PinInput', props);
37
+ const {
38
+ type = 'number',
39
+ as,
40
+ autoFocus,
41
+ attached,
42
+ className,
43
+ classPrefix = 'pin-input',
44
+ defaultValue = '',
45
+ disabled,
46
+ length = 4,
47
+ mask,
48
+ name,
49
+ otp,
50
+ placeholder,
51
+ readOnly,
52
+ size = 'md',
53
+ value: controlValue,
54
+ onChange,
55
+ onComplete,
56
+ ...rest
57
+ } = propsWithDefaults;
58
+
59
+ // Regex for filtering input chars based on type prop
60
+ const allowedKeys = getAllowedKeys(type);
61
+
62
+ // Determine inputMode based on type prop
63
+ const inputModeValue = type === 'number' ? 'numeric' : 'text';
64
+
65
+ // Determine input type attribute based on type prop and mask
66
+ const inputTypeValue = mask ? 'password' : type === 'number' ? 'tel' : 'text';
67
+ const {
68
+ withPrefix,
69
+ prefix,
70
+ merge
71
+ } = (0, _hooks.useStyles)(classPrefix);
72
+
73
+ // Use our custom hook for handling input refs and focus behavior
74
+ const {
75
+ focusInput,
76
+ focusNextInput,
77
+ focusPrevInput,
78
+ getRefSetter
79
+ } = (0, _usePinInputRefs.default)(length, autoFocus);
80
+
81
+ // Use our custom hook for managing PIN values
82
+ const {
83
+ valueArray,
84
+ setDigit,
85
+ clearDigit,
86
+ updateValue
87
+ } = (0, _usePinValue.default)(controlValue, defaultValue, length, onChange, onComplete);
88
+
89
+ // Handle input change
90
+ const handleInputChange = (0, _hooks.useEventCallback)((inputValue, e, index) => {
91
+ // Safety check for event object
92
+ if (!e || !e.target) return;
93
+
94
+ // For single character input, use it directly
95
+ // For longer input (like paste or browser autofill), take the last character
96
+ const char = inputValue.length > 0 ? inputValue.charAt(inputValue.length - 1) : '';
97
+
98
+ // Filter by allowedKeys if provided
99
+ if (!allowedKeys.test(char)) {
100
+ return;
101
+ }
102
+
103
+ // Always allow overwriting the current value
104
+ // Update the value using our hook
105
+ setDigit(index, char);
106
+
107
+ // Focus the next input if we have a character and there's a next input
108
+ if (char && index < length - 1) {
109
+ // Use setTimeout to ensure the focus happens after the current event cycle
110
+ focusNextInput(index);
111
+ }
112
+
113
+ // If this is the last input and a character was entered, keep focus on it
114
+ if (char && index === length - 1) {
115
+ focusInput(index);
116
+ }
117
+ });
118
+
119
+ // Handle key down
120
+ const handleKeyDown = (0, _hooks.useEventCallback)((e, index) => {
121
+ // Safety check for event object
122
+ if (!e) return;
123
+ const target = e.target;
124
+ const inputValue = (target === null || target === void 0 ? void 0 : target.value) || '';
125
+
126
+ // Handle backspace
127
+ if (e.key === 'Backspace') {
128
+ if (inputValue === '') {
129
+ // Focus the previous input if the current one is empty
130
+ if (index > 0) {
131
+ clearDigit(index - 1);
132
+ focusPrevInput(index);
133
+ }
134
+ } else {
135
+ // Clear the current input but keep focus on it
136
+ clearDigit(index);
137
+ }
138
+ }
139
+ // Handle arrow keys
140
+ else if (e.key === 'ArrowLeft') {
141
+ focusPrevInput(index);
142
+ } else if (e.key === 'ArrowRight') {
143
+ focusNextInput(index);
144
+ }
145
+ // Allow only keys matching allowedKeys
146
+ else if (allowedKeys.test(e.key)) {
147
+ setDigit(index, e.key);
148
+
149
+ // Move focus to the next input if there is one
150
+ if (index < length - 1) {
151
+ setTimeout(() => {
152
+ focusNextInput(index);
153
+ }, 10);
154
+ }
155
+ }
156
+ });
157
+
158
+ // Handle paste
159
+ const handlePaste = (0, _hooks.useEventCallback)((e, index) => {
160
+ if (disabled || readOnly) return;
161
+
162
+ // Safety check for event object
163
+ if (!e || !e.clipboardData) return;
164
+ e.preventDefault();
165
+ const pastedData = e.clipboardData.getData('text') || '';
166
+
167
+ // Filter pasted data by allowedKeys
168
+ const filteredData = pastedData.split('').filter(ch => allowedKeys.test(ch)).join('');
169
+ if (filteredData) {
170
+ // Create a new value with pasted characters
171
+ const newValueArray = [...valueArray];
172
+ for (let i = 0; i < filteredData.length && index + i < length; i++) {
173
+ newValueArray[index + i] = filteredData[i];
174
+ }
175
+
176
+ // Update value with our hook
177
+ updateValue(newValueArray.join(''));
178
+
179
+ // Focus the input after the last pasted character or the last input
180
+ // Use setTimeout to ensure focus happens after DOM updates
181
+ const nextIndex = Math.min(index + filteredData.length, length - 1);
182
+ setTimeout(() => {
183
+ focusInput(nextIndex);
184
+ }, 10);
185
+ }
186
+ });
187
+ const classes = merge(className, withPrefix({
188
+ attached
189
+ }));
190
+ return /*#__PURE__*/_react.default.createElement(_Box.Box, (0, _extends2.default)({
191
+ as: as,
192
+ ref: ref,
193
+ className: classes
194
+ }, rest), /*#__PURE__*/_react.default.createElement("input", {
195
+ type: "hidden",
196
+ value: valueArray.join(''),
197
+ name: name,
198
+ "aria-label": "Pin input"
199
+ }), /*#__PURE__*/_react.default.createElement(_Stack.HStack, {
200
+ spacing: attached ? 0 : 8
201
+ }, Array.from({
202
+ length
203
+ }).map((_, index) => /*#__PURE__*/_react.default.createElement(_Input.default, {
204
+ key: index,
205
+ className: prefix('segment', {
206
+ masked: mask
207
+ }),
208
+ size: size,
209
+ value: valueArray[index] || '',
210
+ onChange: (v, e) => handleInputChange(v, e, index),
211
+ onKeyDown: e => handleKeyDown(e, index),
212
+ onPaste: e => handlePaste(e, index),
213
+ disabled: disabled,
214
+ readOnly: readOnly,
215
+ maxLength: 1,
216
+ autoComplete: otp ? 'one-time-code' : 'off',
217
+ inputMode: inputModeValue,
218
+ placeholder: placeholder,
219
+ type: inputTypeValue,
220
+ ref: getRefSetter(index)
221
+ }))));
222
+ });
223
+ PinInput.displayName = 'PinInput';
224
+ var _default = exports.default = PinInput;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * A hook that manages the refs and focus behavior for a PIN input component
4
+ */
5
+ export declare const usePinInputRefs: (length: number, autoFocus?: boolean) => {
6
+ inputRefs: import("react").RefObject<(HTMLInputElement | null)[]>;
7
+ focusInput: (index: number) => boolean;
8
+ focusNextInput: (currentIndex: number) => boolean;
9
+ focusPrevInput: (currentIndex: number) => boolean;
10
+ getRefSetter: (index: number) => (el: HTMLInputElement | null) => void;
11
+ };
12
+ export default usePinInputRefs;
@@ -0,0 +1,62 @@
1
+ 'use client';
2
+ "use strict";
3
+
4
+ exports.__esModule = true;
5
+ exports.usePinInputRefs = exports.default = void 0;
6
+ var _react = require("react");
7
+ /**
8
+ * A hook that manages the refs and focus behavior for a PIN input component
9
+ */
10
+ const usePinInputRefs = (length, autoFocus) => {
11
+ // Create ref to store input elements
12
+ const inputRefs = (0, _react.useRef)([]);
13
+
14
+ // Initialize the refs array when length changes
15
+ (0, _react.useEffect)(() => {
16
+ inputRefs.current = inputRefs.current.slice(0, length);
17
+ }, [length]);
18
+
19
+ // Auto focus the first input on mount if autoFocus is true
20
+ (0, _react.useEffect)(() => {
21
+ if (autoFocus && inputRefs.current[0]) {
22
+ var _inputRefs$current$;
23
+ (_inputRefs$current$ = inputRefs.current[0]) === null || _inputRefs$current$ === void 0 || _inputRefs$current$.focus();
24
+ }
25
+ }, [autoFocus]);
26
+
27
+ // Focus a specific input by index
28
+ const focusInput = (0, _react.useCallback)(index => {
29
+ if (index >= 0 && index < length && inputRefs.current[index]) {
30
+ var _inputRefs$current$in;
31
+ (_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
32
+ return true;
33
+ }
34
+ return false;
35
+ }, [length]);
36
+
37
+ // Focus the next input
38
+ const focusNextInput = (0, _react.useCallback)(currentIndex => {
39
+ return focusInput(currentIndex + 1);
40
+ }, [focusInput]);
41
+
42
+ // Focus the previous input
43
+ const focusPrevInput = (0, _react.useCallback)(currentIndex => {
44
+ return focusInput(currentIndex - 1);
45
+ }, [focusInput]);
46
+
47
+ // Get ref setter for an input
48
+ const getRefSetter = (0, _react.useCallback)(index => {
49
+ return el => {
50
+ inputRefs.current[index] = el;
51
+ };
52
+ }, []);
53
+ return {
54
+ inputRefs,
55
+ focusInput,
56
+ focusNextInput,
57
+ focusPrevInput,
58
+ getRefSetter
59
+ };
60
+ };
61
+ exports.usePinInputRefs = usePinInputRefs;
62
+ var _default = exports.default = usePinInputRefs;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Hook for managing pin input value
3
+ * - Handles controlled/uncontrolled value
4
+ * - Normalizes value to array format
5
+ * - Manages array updates and modifications
6
+ */
7
+ export declare const usePinValue: (controlValue: string | undefined, defaultValue: string, length: number, onChange?: ((value: string) => void) | undefined, onComplete?: ((value: string) => void) | undefined) => {
8
+ value: string;
9
+ valueArray: string[];
10
+ setDigit: (index: number, digit: string) => void;
11
+ clearDigit: (index: number) => void;
12
+ updateValue: (newValue: string) => void;
13
+ };
14
+ export default usePinValue;
@@ -0,0 +1,73 @@
1
+ 'use client';
2
+ "use strict";
3
+
4
+ exports.__esModule = true;
5
+ exports.usePinValue = exports.default = void 0;
6
+ var _react = require("react");
7
+ var _hooks = require("../../internals/hooks");
8
+ /**
9
+ * Hook for managing pin input value
10
+ * - Handles controlled/uncontrolled value
11
+ * - Normalizes value to array format
12
+ * - Manages array updates and modifications
13
+ */
14
+ const usePinValue = (controlValue, defaultValue, length, onChange, onComplete) => {
15
+ // Use controlled pattern for value management
16
+ const [value, setValue] = (0, _hooks.useControlled)(controlValue, defaultValue);
17
+
18
+ // Convert string value to array of characters
19
+ const valueArray = (0, _react.useMemo)(() => {
20
+ // Ensure value is a string and split it into an array of characters
21
+ const valueString = value || '';
22
+ const chars = valueString.split('');
23
+
24
+ // Pad the array with empty strings if needed
25
+ while (chars.length < length) {
26
+ chars.push('');
27
+ }
28
+
29
+ // Trim the array if it's too long
30
+ if (chars.length > length) {
31
+ chars.length = length;
32
+ }
33
+ return chars;
34
+ }, [value, length]);
35
+
36
+ // Update specific digit at index
37
+ const setDigit = (index, digit) => {
38
+ if (index < 0 || index >= length) return;
39
+ const newValueArray = [...valueArray];
40
+ newValueArray[index] = digit;
41
+ updateValue(newValueArray.join(''));
42
+ };
43
+
44
+ // Clear specific digit at index
45
+ const clearDigit = index => {
46
+ if (index < 0 || index >= length) return;
47
+ const newValueArray = [...valueArray];
48
+ newValueArray[index] = '';
49
+ updateValue(newValueArray.join(''));
50
+ };
51
+
52
+ // Set entire value at once
53
+ const updateValue = newValue => {
54
+ // Filter out any extra characters beyond length
55
+ const filteredValue = newValue.slice(0, length);
56
+ setValue(filteredValue);
57
+ onChange === null || onChange === void 0 || onChange(filteredValue);
58
+
59
+ // Call onComplete if the value is complete
60
+ if (filteredValue.length === length) {
61
+ onComplete === null || onComplete === void 0 || onComplete(filteredValue);
62
+ }
63
+ };
64
+ return {
65
+ value,
66
+ valueArray,
67
+ setDigit,
68
+ clearDigit,
69
+ updateValue
70
+ };
71
+ };
72
+ exports.usePinValue = usePinValue;
73
+ var _default = exports.default = usePinValue;
@@ -0,0 +1,4 @@
1
+ import PinInput from './PinInput';
2
+ export type { PinInputProps } from './PinInput';
3
+ export { PinInput };
4
+ export default PinInput;
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+ var _PinInput = _interopRequireDefault(require("./PinInput"));
8
+ exports.PinInput = _PinInput.default;
9
+ var _default = exports.default = _PinInput.default;
@@ -8,7 +8,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _hooks = require("../internals/hooks");
11
- var _CustomProvider = require("../CustomProvider");
12
11
  var _utils = require("../internals/utils");
13
12
  /**
14
13
  * The `Placeholder.Graph` component is used to display the loading state of the block.
@@ -17,7 +16,7 @@ var _utils = require("../internals/utils");
17
16
  const PlaceholderGraph = (0, _utils.forwardRef)((props, ref) => {
18
17
  const {
19
18
  propsWithDefaults
20
- } = (0, _CustomProvider.useCustom)('PlaceholderGraph', props);
19
+ } = (0, _hooks.useCustom)('PlaceholderGraph', props);
21
20
  const {
22
21
  as,
23
22
  className,
@@ -8,7 +8,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _hooks = require("../internals/hooks");
11
- var _CustomProvider = require("../CustomProvider");
12
11
  var _utils = require("../internals/utils");
13
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -19,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
19
18
  const PlaceholderGrid = (0, _utils.forwardRef)((props, ref) => {
20
19
  const {
21
20
  propsWithDefaults
22
- } = (0, _CustomProvider.useCustom)('PlaceholderGrid', props);
21
+ } = (0, _hooks.useCustom)('PlaceholderGrid', props);
23
22
  const {
24
23
  as,
25
24
  className,
@@ -8,7 +8,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _hooks = require("../internals/hooks");
11
- var _CustomProvider = require("../CustomProvider");
12
11
  var _utils = require("../internals/utils");
13
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -19,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
19
18
  const PlaceholderParagraph = (0, _utils.forwardRef)((props, ref) => {
20
19
  const {
21
20
  propsWithDefaults
22
- } = (0, _CustomProvider.useCustom)('PlaceholderParagraph', props);
21
+ } = (0, _hooks.useCustom)('PlaceholderParagraph', props);
23
22
  const {
24
23
  as,
25
24
  className,
@@ -10,7 +10,6 @@ var _Heading = _interopRequireDefault(require("../Heading"));
10
10
  var _Box = _interopRequireDefault(require("../internals/Box"));
11
11
  var _utils = require("../internals/utils");
12
12
  var _hooks = require("../internals/hooks");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  /**
@@ -20,7 +19,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
20
19
  const Popover = (0, _utils.forwardRef)((props, ref) => {
21
20
  const {
22
21
  propsWithDefaults
23
- } = (0, _CustomProvider.useCustom)('Popover', props);
22
+ } = (0, _hooks.useCustom)('Popover', props);
24
23
  const {
25
24
  as,
26
25
  classPrefix = 'popover',
@@ -10,7 +10,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _statusIcons = require("../internals/constants/statusIcons");
11
11
  var _utils = require("../internals/utils");
12
12
  var _hooks = require("../internals/hooks");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  /**
@@ -20,7 +19,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
20
19
  const ProgressCircle = (0, _utils.forwardRef)((props, ref) => {
21
20
  const {
22
21
  propsWithDefaults
23
- } = (0, _CustomProvider.useCustom)('ProgressCircle', props);
22
+ } = (0, _hooks.useCustom)('ProgressCircle', props);
24
23
  const {
25
24
  as,
26
25
  strokeWidth = 6,
@@ -10,7 +10,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _statusIcons = require("../internals/constants/statusIcons");
11
11
  var _utils = require("../internals/utils");
12
12
  var _hooks = require("../internals/hooks");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  /**
15
14
  * The `Progress.Line` component is used to display the progress of current operation.
16
15
  * @see https://rsuitejs.com/components/progress/#line
@@ -18,7 +17,7 @@ var _CustomProvider = require("../CustomProvider");
18
17
  const ProgressLine = (0, _utils.forwardRef)((props, ref) => {
19
18
  const {
20
19
  propsWithDefaults
21
- } = (0, _CustomProvider.useCustom)('ProgressLine', props);
20
+ } = (0, _hooks.useCustom)('ProgressLine', props);
22
21
  const {
23
22
  as,
24
23
  className,
@@ -10,7 +10,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _RadioGroup = require("../RadioGroup/RadioGroup");
11
11
  var _hooks = require("../internals/hooks");
12
12
  var _utils = require("../internals/utils");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  /**
@@ -21,7 +20,7 @@ const Radio = (0, _utils.forwardRef)((props, ref) => {
21
20
  const radioContext = (0, _react.useContext)(_RadioGroup.RadioContext);
22
21
  const {
23
22
  propsWithDefaults
24
- } = (0, _CustomProvider.useCustom)('Radio', props);
23
+ } = (0, _hooks.useCustom)('Radio', props);
25
24
  const {
26
25
  value: groupValue,
27
26
  inline: inlineContext,
@@ -10,7 +10,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
10
10
  var _Plaintext = _interopRequireDefault(require("../internals/Plaintext"));
11
11
  var _utils = require("../internals/utils");
12
12
  var _hooks = require("../internals/hooks");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  const RadioContext = exports.RadioContext = /*#__PURE__*/_react.default.createContext(void 0);
@@ -22,7 +21,7 @@ const RadioContext = exports.RadioContext = /*#__PURE__*/_react.default.createCo
22
21
  const RadioGroup = (0, _utils.forwardRef)((props, ref) => {
23
22
  const {
24
23
  propsWithDefaults
25
- } = (0, _CustomProvider.useCustom)('RadioGroup', props);
24
+ } = (0, _hooks.useCustom)('RadioGroup', props);
26
25
  const {
27
26
  as,
28
27
  className,
@@ -11,7 +11,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
11
11
  var _RadioTileGroup = require("../RadioTileGroup/RadioTileGroup");
12
12
  var _utils = require("../internals/utils");
13
13
  var _hooks = require("../internals/hooks");
14
- var _CustomProvider = require("../CustomProvider");
15
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
16
  /**
@@ -22,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
22
21
  const RadioTile = (0, _utils.forwardRef)((props, ref) => {
23
22
  const {
24
23
  propsWithDefaults
25
- } = (0, _CustomProvider.useCustom)('RadioTile', props);
24
+ } = (0, _hooks.useCustom)('RadioTile', props);
26
25
  const {
27
26
  value: groupValue,
28
27
  name: nameContext,
@@ -10,7 +10,6 @@ var _Stack = _interopRequireDefault(require("../Stack"));
10
10
  var _Box = _interopRequireDefault(require("../internals/Box"));
11
11
  var _hooks = require("../internals/hooks");
12
12
  var _utils = require("../internals/utils");
13
- var _CustomProvider = require("../CustomProvider");
14
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
15
  const RadioTileContext = exports.RadioTileContext = /*#__PURE__*/_react.default.createContext({});
@@ -23,7 +22,7 @@ const RadioTileContext = exports.RadioTileContext = /*#__PURE__*/_react.default.
23
22
  const RadioTileGroup = (0, _utils.forwardRef)((props, ref) => {
24
23
  const {
25
24
  propsWithDefaults
26
- } = (0, _CustomProvider.useCustom)('RadioTileGroup', props);
25
+ } = (0, _hooks.useCustom)('RadioTileGroup', props);
27
26
  const {
28
27
  as = _Stack.default,
29
28
  className,
@@ -17,7 +17,6 @@ var _Box = _interopRequireDefault(require("../internals/Box"));
17
17
  var _utils = require("../internals/utils");
18
18
  var _hooks = require("../internals/hooks");
19
19
  var _utils2 = require("../Slider/utils");
20
- var _CustomProvider = require("../CustomProvider");
21
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
22
  const defaultDefaultValue = [0, 0];
@@ -29,7 +28,7 @@ const defaultDefaultValue = [0, 0];
29
28
  const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
30
29
  const {
31
30
  propsWithDefaults
32
- } = (0, _CustomProvider.useCustom)('RangeSlider', props);
31
+ } = (0, _hooks.useCustom)('RangeSlider', props);
33
32
  const {
34
33
  'aria-label': ariaLabel,
35
34
  'aria-labelledby': ariaLabelledby,
@@ -76,7 +75,7 @@ const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
76
75
  } = (0, _hooks.useStyles)(classPrefix);
77
76
  const {
78
77
  rtl
79
- } = (0, _CustomProvider.useCustom)('RangeSlider');
78
+ } = (0, _hooks.useCustom)('RangeSlider');
80
79
  const classes = merge(className, withPrefix({
81
80
  vertical,
82
81
  disabled,