rsuite 6.0.0-canary-2025032014 → 6.0.0-canary-20250416

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 (484) hide show
  1. package/AutoComplete/styles/index.css +112 -62
  2. package/AutoComplete/styles/index.less +1 -1
  3. package/Box/styles/index.css +12 -0
  4. package/CHANGELOG.md +24 -0
  5. package/Calendar/styles/index.css +11 -9
  6. package/Calendar/styles/index.less +3 -1
  7. package/Cascader/styles/index.css +112 -62
  8. package/CheckPicker/styles/index.css +112 -62
  9. package/CheckPicker/styles/index.less +1 -1
  10. package/CheckTree/styles/index.css +113 -63
  11. package/CheckTree/styles/index.less +1 -1
  12. package/CheckTreePicker/styles/index.css +113 -63
  13. package/DateInput/styles/index.css +0 -7
  14. package/DatePicker/styles/index.css +122 -74
  15. package/DatePicker/styles/index.less +5 -11
  16. package/DateRangeInput/styles/index.css +0 -7
  17. package/DateRangePicker/styles/index.css +132 -78
  18. package/DateRangePicker/styles/index.less +10 -4
  19. package/Divider/styles/index.css +2 -2
  20. package/Divider/styles/index.less +2 -2
  21. package/Grid/styles/columns.less +1 -2
  22. package/Grid/styles/grid-framework.less +1 -0
  23. package/Grid/styles/index.css +9 -4
  24. package/Grid/styles/row.less +2 -2
  25. package/Input/styles/index.css +0 -7
  26. package/Input/styles/index.less +0 -6
  27. package/Input/styles/mixin.less +0 -4
  28. package/InputGroup/styles/index.css +1 -1
  29. package/InputGroup/styles/index.less +1 -1
  30. package/InputNumber/styles/index.css +1 -8
  31. package/InputPicker/styles/index.css +121 -70
  32. package/InputPicker/styles/index.less +4 -4
  33. package/Link/package.json +7 -0
  34. package/Link/styles/index.css +32 -0
  35. package/Link/styles/index.less +39 -0
  36. package/Message/styles/index.css +9 -0
  37. package/Message/styles/index.less +11 -0
  38. package/MultiCascadeTree/styles/index.css +112 -62
  39. package/MultiCascader/styles/index.css +112 -62
  40. package/Nav/styles/index.css +1 -0
  41. package/Nav/styles/index.less +1 -0
  42. package/Pagination/styles/index.css +114 -64
  43. package/PasswordInput/package.json +7 -0
  44. package/PasswordInput/styles/index.css +172 -0
  45. package/PasswordInput/styles/index.less +1 -0
  46. package/PasswordStrengthMeter/package.json +7 -0
  47. package/PasswordStrengthMeter/styles/index.css +33 -0
  48. package/PasswordStrengthMeter/styles/index.less +39 -0
  49. package/README.md +3 -3
  50. package/RadioGroup/styles/index.css +1 -0
  51. package/RadioGroup/styles/index.less +1 -0
  52. package/RangeSlider/styles/index.css +76 -43
  53. package/Rate/styles/index.css +48 -34
  54. package/Rate/styles/index.less +32 -21
  55. package/SelectPicker/styles/index.css +112 -62
  56. package/SelectPicker/styles/index.less +1 -1
  57. package/Slider/styles/index.css +76 -43
  58. package/Slider/styles/index.less +95 -48
  59. package/Tabs/styles/index.css +1 -0
  60. package/TagInput/styles/index.css +152 -91
  61. package/TagInput/styles/index.less +1 -1
  62. package/TagPicker/styles/index.css +151 -90
  63. package/TagPicker/styles/index.less +52 -41
  64. package/Textarea/package.json +7 -0
  65. package/Textarea/styles/index.css +6 -0
  66. package/Textarea/styles/index.less +7 -0
  67. package/TimePicker/styles/index.css +122 -74
  68. package/TimeRangePicker/styles/index.css +132 -78
  69. package/Toggle/styles/index.css +146 -87
  70. package/Toggle/styles/index.less +66 -38
  71. package/Tree/styles/index.css +113 -63
  72. package/Tree/styles/index.less +1 -1
  73. package/TreePicker/styles/index.css +113 -63
  74. package/cjs/AutoComplete/AutoComplete.d.ts +1 -1
  75. package/cjs/AutoComplete/AutoComplete.js +13 -11
  76. package/cjs/Avatar/Avatar.d.ts +3 -4
  77. package/cjs/Breadcrumb/Breadcrumb.js +2 -2
  78. package/cjs/Breadcrumb/BreadcrumbItem.js +1 -1
  79. package/cjs/Button/Button.js +9 -10
  80. package/cjs/Calendar/CalendarProvider.js +0 -0
  81. package/cjs/Calendar/hooks/useCalendar.js +0 -0
  82. package/cjs/Carousel/Carousel.js +2 -2
  83. package/cjs/Cascader/Cascader.js +42 -45
  84. package/cjs/Cascader/useActive.d.ts +6 -4
  85. package/cjs/Cascader/useActive.js +10 -8
  86. package/cjs/CheckPicker/CheckPicker.js +38 -41
  87. package/cjs/CheckTreePicker/CheckTreePicker.js +20 -22
  88. package/cjs/CustomProvider/CustomProvider.d.ts +1 -4
  89. package/cjs/CustomProvider/types.d.ts +10 -2
  90. package/cjs/DatePicker/DatePicker.d.ts +1 -1
  91. package/cjs/DatePicker/DatePicker.js +28 -25
  92. package/cjs/DatePicker/utils.d.ts +3 -3
  93. package/cjs/DatePicker/utils.js +3 -3
  94. package/cjs/DateRangePicker/DateRangePicker.js +39 -33
  95. package/cjs/DateRangePicker/utils.js +0 -0
  96. package/cjs/Divider/Divider.d.ts +3 -2
  97. package/cjs/Divider/Divider.js +2 -2
  98. package/cjs/Form/hooks/useFormValidate.js +0 -0
  99. package/cjs/Form/hooks/useSchemaModel.js +2 -54
  100. package/cjs/Form/utils/constructFlatSchema.d.ts +4 -0
  101. package/cjs/Form/utils/constructFlatSchema.js +41 -0
  102. package/cjs/FormControl/hooks/useField.js +0 -0
  103. package/cjs/FormControl/utils.js +0 -0
  104. package/cjs/Grid/Row.d.ts +2 -2
  105. package/cjs/Grid/Row.js +2 -20
  106. package/cjs/Grid/types.d.ts +1 -0
  107. package/cjs/Grid/utils/styles.d.ts +6 -0
  108. package/cjs/Grid/utils/styles.js +43 -0
  109. package/cjs/Image/Image.js +12 -11
  110. package/cjs/Image/hooks/useImage.d.ts +2 -0
  111. package/cjs/Image/hooks/useImage.js +19 -43
  112. package/cjs/InlineEdit/InlineEdit.js +3 -1
  113. package/cjs/InlineEdit/useEditState.d.ts +2 -0
  114. package/cjs/InlineEdit/useEditState.js +8 -0
  115. package/cjs/Input/Input.d.ts +3 -12
  116. package/cjs/Input/Input.js +12 -73
  117. package/cjs/InputPicker/InputPicker.js +27 -28
  118. package/cjs/Link/ExternalLinkIcon.d.ts +3 -0
  119. package/cjs/Link/ExternalLinkIcon.js +23 -0
  120. package/cjs/Link/Link.d.ts +14 -0
  121. package/cjs/Link/Link.js +52 -0
  122. package/cjs/Link/index.d.ts +4 -0
  123. package/cjs/Link/index.js +11 -0
  124. package/cjs/List/List.js +6 -2
  125. package/cjs/List/helper/useSortHelper.d.ts +7 -5
  126. package/cjs/List/helper/useSortHelper.js +109 -16
  127. package/cjs/List/helper/utils.js +14 -6
  128. package/cjs/MultiCascader/MultiCascader.js +40 -43
  129. package/cjs/Nav/NavItem.js +1 -1
  130. package/cjs/Nav/NavMegaMenu.d.ts +5 -0
  131. package/cjs/Nav/NavMegaMenu.js +5 -0
  132. package/cjs/Navbar/NavbarItem.js +1 -1
  133. package/cjs/Navbar/NavbarMegaMenu.js +1 -1
  134. package/cjs/PasswordInput/PasswordInput.d.ts +14 -0
  135. package/cjs/PasswordInput/PasswordInput.js +71 -0
  136. package/cjs/PasswordInput/index.d.ts +4 -0
  137. package/cjs/PasswordInput/index.js +11 -0
  138. package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
  139. package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.js +50 -0
  140. package/cjs/PasswordStrengthMeter/index.d.ts +4 -0
  141. package/cjs/PasswordStrengthMeter/index.js +11 -0
  142. package/cjs/RangeSlider/RangeSlider.js +18 -3
  143. package/cjs/Rate/Character.d.ts +4 -3
  144. package/cjs/Rate/Character.js +19 -15
  145. package/cjs/Rate/Rate.d.ts +10 -2
  146. package/cjs/Rate/Rate.js +47 -42
  147. package/cjs/Rate/types.d.ts +8 -0
  148. package/cjs/Rate/types.js +4 -0
  149. package/cjs/Rate/useRatingStates.d.ts +20 -0
  150. package/cjs/Rate/useRatingStates.js +48 -0
  151. package/cjs/Rate/utils.d.ts +14 -3
  152. package/cjs/Rate/utils.js +50 -9
  153. package/cjs/SelectPicker/SelectPicker.js +45 -46
  154. package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
  155. package/cjs/Sidenav/SidenavItem.js +1 -1
  156. package/cjs/Slider/Graduated.d.ts +4 -0
  157. package/cjs/Slider/Graduated.js +43 -20
  158. package/cjs/Slider/Handle.d.ts +1 -1
  159. package/cjs/Slider/Handle.js +12 -12
  160. package/cjs/Slider/Slider.d.ts +16 -1
  161. package/cjs/Slider/Slider.js +7 -2
  162. package/cjs/Slider/useDrag.d.ts +1 -0
  163. package/cjs/Slider/useDrag.js +8 -3
  164. package/cjs/Steps/Steps.js +2 -2
  165. package/cjs/Tabs/Tabs.js +2 -2
  166. package/cjs/Textarea/Textarea.d.ts +32 -0
  167. package/cjs/Textarea/Textarea.js +51 -0
  168. package/cjs/Textarea/index.d.ts +4 -0
  169. package/cjs/Textarea/index.js +11 -0
  170. package/cjs/Timeline/Timeline.js +2 -2
  171. package/cjs/Toggle/Toggle.d.ts +10 -1
  172. package/cjs/Toggle/Toggle.js +12 -9
  173. package/cjs/TreePicker/TreePicker.js +18 -19
  174. package/cjs/index.d.ts +4 -1
  175. package/cjs/index.js +24 -6
  176. package/cjs/internals/Box/Box.d.ts +4 -0
  177. package/cjs/internals/Box/Box.js +1 -1
  178. package/cjs/internals/Box/utils.js +5 -1
  179. package/cjs/internals/InputBase/InputBase.d.ts +45 -0
  180. package/cjs/internals/InputBase/InputBase.js +96 -0
  181. package/cjs/internals/InputBase/index.d.ts +3 -0
  182. package/cjs/internals/InputBase/index.js +8 -0
  183. package/cjs/internals/Overlay/Modal.d.ts +1 -1
  184. package/cjs/internals/Overlay/OverlayTrigger.d.ts +4 -3
  185. package/cjs/internals/Overlay/OverlayTrigger.js +8 -3
  186. package/cjs/internals/Picker/Listbox.js +7 -9
  187. package/cjs/internals/Picker/PickerDrawer.d.ts +8 -0
  188. package/cjs/internals/Picker/PickerDrawer.js +31 -0
  189. package/cjs/internals/Picker/PickerPopup.js +5 -3
  190. package/cjs/internals/Picker/PickerToggle.d.ts +1 -0
  191. package/cjs/internals/Picker/PickerToggle.js +10 -3
  192. package/cjs/internals/Picker/PickerToggleTrigger.d.ts +51 -11
  193. package/cjs/internals/Picker/PickerToggleTrigger.js +59 -13
  194. package/cjs/internals/Picker/hooks/index.d.ts +0 -1
  195. package/cjs/internals/Picker/hooks/index.js +2 -4
  196. package/cjs/internals/Picker/hooks/useCombobox.d.ts +1 -0
  197. package/cjs/internals/Picker/hooks/useCombobox.js +3 -1
  198. package/cjs/internals/Picker/index.d.ts +1 -2
  199. package/cjs/internals/Picker/index.js +10 -12
  200. package/{esm → cjs/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
  201. package/cjs/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
  202. package/cjs/internals/Tree/TreeView.js +3 -4
  203. package/cjs/internals/hooks/useRootClose.js +4 -4
  204. package/cjs/internals/index.d.ts +4 -0
  205. package/cjs/internals/index.js +13 -1
  206. package/cjs/internals/types/html.d.ts +2 -0
  207. package/cjs/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
  208. package/cjs/internals/utils/{dom.js → html/dom.js} +8 -0
  209. package/cjs/internals/utils/{events.js → html/events.js} +0 -0
  210. package/cjs/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
  211. package/cjs/internals/utils/html/index.d.ts +4 -0
  212. package/cjs/internals/utils/html/index.js +28 -0
  213. package/cjs/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
  214. package/cjs/internals/utils/index.d.ts +3 -15
  215. package/cjs/internals/utils/index.js +20 -49
  216. package/cjs/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
  217. package/cjs/internals/utils/{ReactChildren.js → react/ReactChildren.js} +5 -25
  218. package/cjs/internals/utils/react/ReactIs.d.ts +7 -0
  219. package/cjs/internals/utils/react/ReactIs.js +26 -0
  220. package/{esm/internals/utils → cjs/internals/utils/react}/createComponent.d.ts +2 -2
  221. package/cjs/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
  222. package/cjs/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
  223. package/cjs/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
  224. package/cjs/internals/utils/react/index.d.ts +7 -0
  225. package/cjs/internals/utils/react/index.js +46 -0
  226. package/cjs/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
  227. package/cjs/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
  228. package/cjs/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -3
  229. package/cjs/internals/utils/string/index.d.ts +4 -0
  230. package/cjs/internals/utils/string/index.js +28 -0
  231. package/cjs/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
  232. package/cjs/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
  233. package/cjs/locales/en_GB.js +2 -2
  234. package/cjs/locales/en_US.js +2 -2
  235. package/cjs/locales/index.js +0 -0
  236. package/cjs/locales/pl_PL.js +2 -3
  237. package/cjs/useBreakpointValue/useBreakpointValue.d.ts +6 -2
  238. package/cjs/useBreakpointValue/useBreakpointValue.js +9 -4
  239. package/cjs/useMediaQuery/breakpoints.d.ts +24 -0
  240. package/cjs/useMediaQuery/breakpoints.js +248 -0
  241. package/cjs/useMediaQuery/index.d.ts +1 -1
  242. package/cjs/useMediaQuery/types.d.ts +45 -0
  243. package/cjs/useMediaQuery/types.js +4 -0
  244. package/cjs/useMediaQuery/useMediaQuery.d.ts +4 -13
  245. package/cjs/useMediaQuery/useMediaQuery.js +30 -12
  246. package/cjs/useToaster/useToaster.d.ts +1 -1
  247. package/cjs/useToaster/useToaster.js +1 -1
  248. package/dist/rsuite-no-reset-rtl.css +565 -276
  249. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  250. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  251. package/dist/rsuite-no-reset.css +565 -276
  252. package/dist/rsuite-no-reset.min.css +1 -1
  253. package/dist/rsuite-no-reset.min.css.map +1 -1
  254. package/dist/rsuite-rtl.css +565 -276
  255. package/dist/rsuite-rtl.min.css +1 -1
  256. package/dist/rsuite-rtl.min.css.map +1 -1
  257. package/dist/rsuite.css +565 -276
  258. package/dist/rsuite.js +508 -211
  259. package/dist/rsuite.js.map +1 -1
  260. package/dist/rsuite.min.css +1 -1
  261. package/dist/rsuite.min.css.map +1 -1
  262. package/dist/rsuite.min.js +1 -1
  263. package/dist/rsuite.min.js.map +1 -1
  264. package/esm/AutoComplete/AutoComplete.d.ts +1 -1
  265. package/esm/AutoComplete/AutoComplete.js +13 -11
  266. package/esm/Avatar/Avatar.d.ts +3 -4
  267. package/esm/Breadcrumb/Breadcrumb.js +3 -3
  268. package/esm/Breadcrumb/BreadcrumbItem.js +1 -1
  269. package/esm/Button/Button.js +10 -11
  270. package/esm/Calendar/CalendarProvider.js +0 -0
  271. package/esm/Calendar/hooks/useCalendar.js +0 -0
  272. package/esm/Carousel/Carousel.js +3 -3
  273. package/esm/Cascader/Cascader.js +43 -46
  274. package/esm/Cascader/useActive.d.ts +6 -4
  275. package/esm/Cascader/useActive.js +10 -8
  276. package/esm/CheckPicker/CheckPicker.js +39 -42
  277. package/esm/CheckTreePicker/CheckTreePicker.js +21 -23
  278. package/esm/CustomProvider/CustomProvider.d.ts +1 -4
  279. package/esm/CustomProvider/types.d.ts +10 -2
  280. package/esm/DatePicker/DatePicker.d.ts +1 -1
  281. package/esm/DatePicker/DatePicker.js +29 -26
  282. package/esm/DatePicker/utils.d.ts +3 -3
  283. package/esm/DatePicker/utils.js +4 -4
  284. package/esm/DateRangePicker/DateRangePicker.js +35 -29
  285. package/esm/DateRangePicker/utils.js +0 -0
  286. package/esm/Divider/Divider.d.ts +3 -2
  287. package/esm/Divider/Divider.js +2 -2
  288. package/esm/Form/hooks/useFormValidate.js +0 -0
  289. package/esm/Form/hooks/useSchemaModel.js +3 -55
  290. package/esm/Form/utils/constructFlatSchema.d.ts +4 -0
  291. package/esm/Form/utils/constructFlatSchema.js +37 -0
  292. package/esm/FormControl/hooks/useField.js +0 -0
  293. package/esm/FormControl/utils.js +0 -0
  294. package/esm/Grid/Row.d.ts +2 -2
  295. package/esm/Grid/Row.js +2 -20
  296. package/esm/Grid/types.d.ts +1 -0
  297. package/esm/Grid/utils/styles.d.ts +6 -0
  298. package/esm/Grid/utils/styles.js +37 -0
  299. package/esm/Image/Image.js +12 -11
  300. package/esm/Image/hooks/useImage.d.ts +2 -0
  301. package/esm/Image/hooks/useImage.js +20 -43
  302. package/esm/InlineEdit/InlineEdit.js +3 -1
  303. package/esm/InlineEdit/useEditState.d.ts +2 -0
  304. package/esm/InlineEdit/useEditState.js +8 -0
  305. package/esm/Input/Input.d.ts +3 -12
  306. package/esm/Input/Input.js +12 -74
  307. package/esm/InputPicker/InputPicker.js +28 -29
  308. package/esm/Link/ExternalLinkIcon.d.ts +3 -0
  309. package/esm/Link/ExternalLinkIcon.js +18 -0
  310. package/esm/Link/Link.d.ts +14 -0
  311. package/esm/Link/Link.js +47 -0
  312. package/esm/Link/index.d.ts +4 -0
  313. package/esm/Link/index.js +8 -0
  314. package/esm/List/List.js +6 -2
  315. package/esm/List/helper/useSortHelper.d.ts +7 -5
  316. package/esm/List/helper/useSortHelper.js +109 -16
  317. package/esm/List/helper/utils.js +14 -6
  318. package/esm/MultiCascader/MultiCascader.js +41 -44
  319. package/esm/Nav/NavItem.js +1 -1
  320. package/esm/Nav/NavMegaMenu.d.ts +5 -0
  321. package/esm/Nav/NavMegaMenu.js +5 -0
  322. package/esm/Navbar/NavbarItem.js +1 -1
  323. package/esm/Navbar/NavbarMegaMenu.js +1 -1
  324. package/esm/PasswordInput/PasswordInput.d.ts +14 -0
  325. package/esm/PasswordInput/PasswordInput.js +66 -0
  326. package/esm/PasswordInput/index.d.ts +4 -0
  327. package/esm/PasswordInput/index.js +8 -0
  328. package/esm/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
  329. package/esm/PasswordStrengthMeter/PasswordStrengthMeter.js +45 -0
  330. package/esm/PasswordStrengthMeter/index.d.ts +4 -0
  331. package/esm/PasswordStrengthMeter/index.js +8 -0
  332. package/esm/RangeSlider/RangeSlider.js +18 -3
  333. package/esm/Rate/Character.d.ts +4 -3
  334. package/esm/Rate/Character.js +20 -16
  335. package/esm/Rate/Rate.d.ts +10 -2
  336. package/esm/Rate/Rate.js +49 -42
  337. package/esm/Rate/types.d.ts +8 -0
  338. package/esm/Rate/types.js +2 -0
  339. package/esm/Rate/useRatingStates.d.ts +20 -0
  340. package/esm/Rate/useRatingStates.js +43 -0
  341. package/esm/Rate/utils.d.ts +14 -3
  342. package/esm/Rate/utils.js +46 -7
  343. package/esm/SelectPicker/SelectPicker.js +46 -47
  344. package/esm/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
  345. package/esm/Sidenav/SidenavItem.js +1 -1
  346. package/esm/Slider/Graduated.d.ts +4 -0
  347. package/esm/Slider/Graduated.js +43 -20
  348. package/esm/Slider/Handle.d.ts +1 -1
  349. package/esm/Slider/Handle.js +12 -12
  350. package/esm/Slider/Slider.d.ts +16 -1
  351. package/esm/Slider/Slider.js +7 -2
  352. package/esm/Slider/useDrag.d.ts +1 -0
  353. package/esm/Slider/useDrag.js +8 -3
  354. package/esm/Steps/Steps.js +3 -3
  355. package/esm/Tabs/Tabs.js +3 -3
  356. package/esm/Textarea/Textarea.d.ts +32 -0
  357. package/esm/Textarea/Textarea.js +46 -0
  358. package/esm/Textarea/index.d.ts +4 -0
  359. package/esm/Textarea/index.js +8 -0
  360. package/esm/Timeline/Timeline.js +3 -3
  361. package/esm/Toggle/Toggle.d.ts +10 -1
  362. package/esm/Toggle/Toggle.js +12 -9
  363. package/esm/TreePicker/TreePicker.js +19 -20
  364. package/esm/index.d.ts +4 -1
  365. package/esm/index.js +4 -1
  366. package/esm/internals/Box/Box.d.ts +4 -0
  367. package/esm/internals/Box/Box.js +1 -1
  368. package/esm/internals/Box/utils.js +5 -1
  369. package/esm/internals/InputBase/InputBase.d.ts +45 -0
  370. package/esm/internals/InputBase/InputBase.js +89 -0
  371. package/esm/internals/InputBase/index.d.ts +3 -0
  372. package/esm/internals/InputBase/index.js +3 -0
  373. package/esm/internals/Overlay/Modal.d.ts +1 -1
  374. package/esm/internals/Overlay/OverlayTrigger.d.ts +4 -3
  375. package/esm/internals/Overlay/OverlayTrigger.js +8 -2
  376. package/esm/internals/Picker/Listbox.js +8 -10
  377. package/esm/internals/Picker/PickerDrawer.d.ts +8 -0
  378. package/esm/internals/Picker/PickerDrawer.js +26 -0
  379. package/esm/internals/Picker/PickerPopup.js +5 -3
  380. package/esm/internals/Picker/PickerToggle.d.ts +1 -0
  381. package/esm/internals/Picker/PickerToggle.js +10 -3
  382. package/esm/internals/Picker/PickerToggleTrigger.d.ts +51 -11
  383. package/esm/internals/Picker/PickerToggleTrigger.js +59 -12
  384. package/esm/internals/Picker/hooks/index.d.ts +0 -1
  385. package/esm/internals/Picker/hooks/index.js +1 -2
  386. package/esm/internals/Picker/hooks/useCombobox.d.ts +1 -0
  387. package/esm/internals/Picker/hooks/useCombobox.js +3 -1
  388. package/esm/internals/Picker/index.d.ts +1 -2
  389. package/esm/internals/Picker/index.js +1 -2
  390. package/{cjs → esm/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
  391. package/esm/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
  392. package/esm/internals/Tree/TreeView.js +4 -5
  393. package/esm/internals/hooks/useRootClose.js +1 -1
  394. package/esm/internals/index.d.ts +4 -0
  395. package/esm/internals/index.js +5 -0
  396. package/esm/internals/types/html.d.ts +2 -0
  397. package/esm/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
  398. package/esm/internals/utils/{dom.js → html/dom.js} +7 -0
  399. package/esm/internals/utils/{events.js → html/events.js} +0 -0
  400. package/esm/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
  401. package/esm/internals/utils/html/index.d.ts +4 -0
  402. package/esm/internals/utils/html/index.js +5 -0
  403. package/esm/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
  404. package/esm/internals/utils/index.d.ts +3 -15
  405. package/esm/internals/utils/index.js +3 -14
  406. package/esm/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
  407. package/esm/internals/utils/{ReactChildren.js → react/ReactChildren.js} +3 -21
  408. package/esm/internals/utils/react/ReactIs.d.ts +7 -0
  409. package/esm/internals/utils/react/ReactIs.js +22 -0
  410. package/{cjs/internals/utils → esm/internals/utils/react}/createComponent.d.ts +2 -2
  411. package/esm/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
  412. package/esm/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
  413. package/esm/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
  414. package/esm/internals/utils/react/index.d.ts +7 -0
  415. package/esm/internals/utils/react/index.js +8 -0
  416. package/esm/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
  417. package/esm/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
  418. package/esm/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -2
  419. package/esm/internals/utils/string/index.d.ts +4 -0
  420. package/esm/internals/utils/string/index.js +5 -0
  421. package/esm/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
  422. package/esm/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
  423. package/esm/locales/en_GB.js +2 -2
  424. package/esm/locales/en_US.js +2 -2
  425. package/esm/locales/index.js +0 -0
  426. package/esm/locales/pl_PL.js +1 -1
  427. package/esm/useBreakpointValue/useBreakpointValue.d.ts +6 -2
  428. package/esm/useBreakpointValue/useBreakpointValue.js +9 -4
  429. package/esm/useMediaQuery/breakpoints.d.ts +24 -0
  430. package/esm/useMediaQuery/breakpoints.js +244 -0
  431. package/esm/useMediaQuery/index.d.ts +1 -1
  432. package/esm/useMediaQuery/types.d.ts +45 -0
  433. package/esm/useMediaQuery/types.js +2 -0
  434. package/esm/useMediaQuery/useMediaQuery.d.ts +4 -13
  435. package/esm/useMediaQuery/useMediaQuery.js +29 -11
  436. package/esm/useToaster/useToaster.d.ts +1 -1
  437. package/esm/useToaster/useToaster.js +1 -1
  438. package/internals/Box/styles/index.less +4 -0
  439. package/internals/Picker/styles/index.less +105 -23
  440. package/internals/Picker/styles/mixin.less +6 -6
  441. package/package.json +3 -2
  442. package/styles/color-modes/dark.less +2 -2
  443. package/styles/color-modes/high-contrast.less +2 -2
  444. package/styles/color-modes/light.less +2 -2
  445. package/styles/index.less +3 -0
  446. package/styles/root.less +2 -0
  447. package/styles/variables.less +0 -24
  448. package/SafeAnchor/package.json +0 -7
  449. package/cjs/Form/hooks/useFormClassNames.d.ts +0 -5
  450. package/cjs/Form/hooks/useFormClassNames.js +0 -29
  451. package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
  452. package/cjs/internals/Picker/hooks/usePickerClassName.js +0 -45
  453. package/esm/Form/hooks/useFormClassNames.d.ts +0 -5
  454. package/esm/Form/hooks/useFormClassNames.js +0 -25
  455. package/esm/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
  456. package/esm/internals/Picker/hooks/usePickerClassName.js +0 -40
  457. /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
  458. /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
  459. /package/cjs/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
  460. /package/cjs/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
  461. /package/cjs/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
  462. /package/cjs/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
  463. /package/cjs/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
  464. /package/cjs/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
  465. /package/cjs/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
  466. /package/cjs/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
  467. /package/cjs/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
  468. /package/cjs/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
  469. /package/cjs/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
  470. /package/cjs/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
  471. /package/esm/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
  472. /package/esm/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
  473. /package/esm/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
  474. /package/esm/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
  475. /package/esm/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
  476. /package/esm/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
  477. /package/esm/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
  478. /package/esm/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
  479. /package/esm/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
  480. /package/esm/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
  481. /package/esm/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
  482. /package/esm/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
  483. /package/esm/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
  484. /package/esm/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
package/esm/Grid/Row.js CHANGED
@@ -4,26 +4,8 @@ import React from 'react';
4
4
  import Box from "../internals/Box/index.js";
5
5
  import { useStyles } from "../internals/hooks/index.js";
6
6
  import { useCustom } from "../CustomProvider/index.js";
7
- import { forwardRef, mergeStyles, getCssValue } from "../internals/utils/index.js";
8
- import { BREAKPOINTS } from "../internals/constants/index.js";
9
- const getResponsiveGutterStyles = gutter => {
10
- if (!gutter) {
11
- return {};
12
- }
13
- if (typeof gutter !== 'object') {
14
- return {
15
- '--rs-grid-gutter': getCssValue(gutter)
16
- };
17
- }
18
- return BREAKPOINTS.reduce((styles, breakpoint) => {
19
- const breakpointValue = gutter[breakpoint];
20
- if (!breakpointValue) return styles;
21
- const newStyles = {
22
- [`--rs-grid-gutter${breakpoint === 'xs' ? '' : `-${breakpoint}`}`]: getCssValue(breakpointValue)
23
- };
24
- return mergeStyles(styles, newStyles);
25
- }, {});
26
- };
7
+ import { forwardRef, mergeStyles } from "../internals/utils/index.js";
8
+ import { getResponsiveGutterStyles } from "./utils/styles.js";
27
9
  /**
28
10
  * The Row component is used to create a row container that can contain Col components.
29
11
  * @see https://rsuitejs.com/components/grid
@@ -1,5 +1,6 @@
1
1
  export type RowAlignment = 'top' | 'middle' | 'bottom';
2
2
  export type RowJustify = 'start' | 'end' | 'center' | 'space-around' | 'space-between';
3
+ export type GutterType = number | string | [number | string, number | string];
3
4
  /** @deprecated Use new responsive props format instead */
4
5
  export interface DeprecatedColProps {
5
6
  /** @deprecated Use span={{ xs: number }} instead */
@@ -0,0 +1,6 @@
1
+ import type { ResponsiveValue } from '../../internals/types';
2
+ import type { GutterType } from '../types';
3
+ /**
4
+ * Generates CSS variable styles for grid gutters, supporting both single values and arrays [horizontal, vertical]
5
+ */
6
+ export declare const getResponsiveGutterStyles: (gutter?: GutterType | ResponsiveValue<GutterType>) => Record<string, string>;
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+ import isPlainObject from 'lodash/isPlainObject';
3
+ import { BREAKPOINTS } from "../../internals/constants/index.js";
4
+ import { mergeStyles, getCssValue } from "../../internals/utils/index.js";
5
+ /**
6
+ * Generates CSS variable styles for grid gutters, supporting both single values and arrays [horizontal, vertical]
7
+ */
8
+ export const getResponsiveGutterStyles = gutter => {
9
+ if (typeof gutter === 'undefined') {
10
+ return {};
11
+ }
12
+
13
+ // Helper function to process gutter values and generate CSS variables
14
+ const processGutterValue = function (value, prefix) {
15
+ if (prefix === void 0) {
16
+ prefix = '';
17
+ }
18
+ const [h, v] = Array.isArray(value) ? value : [value, value];
19
+ return {
20
+ [`--rs-grid-gutter${prefix}`]: getCssValue(h),
21
+ [`--rs-grid-row-gutter${prefix}`]: getCssValue(v)
22
+ };
23
+ };
24
+
25
+ // Handle responsive object
26
+ if (isPlainObject(gutter)) {
27
+ return BREAKPOINTS.reduce((styles, breakpoint) => {
28
+ const value = gutter[breakpoint];
29
+ if (!value) return styles;
30
+ const prefix = breakpoint === 'xs' ? '' : `-${breakpoint}`;
31
+ return mergeStyles(styles, processGutterValue(value, prefix));
32
+ }, {});
33
+ }
34
+
35
+ // Handle non-responsive value
36
+ return processGutterValue(gutter);
37
+ };
@@ -45,19 +45,14 @@ const Image = forwardRef((props, ref) => {
45
45
  shaded,
46
46
  zoomed
47
47
  }));
48
- const imgProps = {
49
- crossOrigin,
50
- srcSet,
51
- sizes,
52
- loading
53
- };
54
48
  const {
55
49
  imgSrc,
56
- isLoading
50
+ isLoading,
51
+ onLoad,
52
+ onError
57
53
  } = useImage({
58
54
  src,
59
- fallbackSrc,
60
- ...imgProps
55
+ fallbackSrc
61
56
  });
62
57
  const styles = {
63
58
  ...style,
@@ -71,8 +66,14 @@ const Image = forwardRef((props, ref) => {
71
66
  className: classes,
72
67
  style: styles,
73
68
  width: width,
74
- height: height
75
- }, imgProps, rest));
69
+ height: height,
70
+ loading: loading,
71
+ onLoad: onLoad,
72
+ onError: onError,
73
+ crossOrigin: crossOrigin,
74
+ srcSet: srcSet,
75
+ sizes: sizes
76
+ }, rest));
76
77
  if (zoomed) {
77
78
  return /*#__PURE__*/React.createElement(ImageWrapper, {
78
79
  w: width,
@@ -10,5 +10,7 @@ export declare const useImage: (props: UseImageProps) => {
10
10
  imgSrc: string | null;
11
11
  isLoading: boolean;
12
12
  error: boolean;
13
+ onLoad: () => void;
14
+ onError: () => void;
13
15
  };
14
16
  export {};
@@ -1,59 +1,36 @@
1
1
  'use client';
2
- import { useState, useEffect, useRef, useCallback } from 'react';
3
- import useIsomorphicLayoutEffect from "../../internals/hooks/useIsomorphicLayoutEffect.js";
2
+ import { useState, useEffect } from 'react';
4
3
  export const useImage = props => {
5
4
  const {
6
5
  src,
7
- fallbackSrc,
8
- crossOrigin,
9
- srcSet,
10
- sizes,
11
- loading
6
+ fallbackSrc
12
7
  } = props;
13
8
  const [imgSrc, setImgSrc] = useState(src || fallbackSrc || null);
14
9
  const [isLoading, setIsLoading] = useState(!!src);
15
10
  const [error, setError] = useState(false);
16
- const imageRef = useRef(null);
17
11
  useEffect(() => {
18
- setIsLoading(!!src); // true if src exists, false otherwise
19
- }, [src]);
20
- const flush = () => {
21
- if (imageRef.current) {
22
- imageRef.current.onload = null;
23
- imageRef.current.onerror = null;
12
+ if (!src) {
13
+ setIsLoading(false);
14
+ return;
24
15
  }
16
+ setImgSrc(src);
17
+ setIsLoading(true);
18
+ setError(false);
19
+ }, [src]);
20
+ const handleLoad = () => {
21
+ setIsLoading(false);
22
+ setError(false);
23
+ };
24
+ const handleError = () => {
25
+ setIsLoading(false);
26
+ setError(true);
27
+ setImgSrc(fallbackSrc || null);
25
28
  };
26
- const loadImage = useCallback(() => {
27
- if (!src) return;
28
- flush();
29
- const image = new Image();
30
- image.src = src;
31
- if (crossOrigin) image.crossOrigin = crossOrigin;
32
- if (srcSet) image.srcset = srcSet;
33
- if (sizes) image.sizes = sizes;
34
- if (loading) image.loading = loading;
35
- image.onload = () => {
36
- flush();
37
- setImgSrc(src);
38
- setIsLoading(false);
39
- };
40
- image.onerror = () => {
41
- flush();
42
- setError(true);
43
- setImgSrc(fallbackSrc || null);
44
- setIsLoading(false);
45
- };
46
- imageRef.current = image;
47
- }, [crossOrigin, fallbackSrc, loading, sizes, src, srcSet]);
48
- useIsomorphicLayoutEffect(() => {
49
- loadImage();
50
- return () => {
51
- flush();
52
- };
53
- }, [loadImage]);
54
29
  return {
55
30
  imgSrc,
56
31
  isLoading,
57
- error
32
+ error,
33
+ onLoad: handleLoad,
34
+ onError: handleError
58
35
  };
59
36
  };
@@ -38,6 +38,7 @@ const InlineEdit = forwardRef((props, ref) => {
38
38
  onChange,
39
39
  onKeyDown,
40
40
  onClick,
41
+ onFocus,
41
42
  htmlProps
42
43
  } = useEditState({
43
44
  ...rest,
@@ -70,7 +71,8 @@ const InlineEdit = forwardRef((props, ref) => {
70
71
  disabled
71
72
  })),
72
73
  onClick: onClick,
73
- onKeyDown: onKeyDown
74
+ onKeyDown: onKeyDown,
75
+ onFocus: onFocus
74
76
  }, htmlProps), renderChildren(children, childrenProps, target), showControls && isEditing && /*#__PURE__*/React.createElement(EditableControls, {
75
77
  className: prefix('controls'),
76
78
  onSave: onSave,
@@ -8,12 +8,14 @@ interface EditStateProps {
8
8
  onCancel?: (event?: React.MouseEvent) => void;
9
9
  onSave?: (event?: React.MouseEvent) => void;
10
10
  onClick?: (event: React.SyntheticEvent) => void;
11
+ onFocus?: (event?: React.FocusEvent) => void;
11
12
  }
12
13
  declare const useEditState: (props: EditStateProps) => {
13
14
  isEditing: boolean;
14
15
  value: any;
15
16
  onClick: (...args: any[]) => any;
16
17
  onChange: (...args: any[]) => any;
18
+ onFocus: (...args: any[]) => any;
17
19
  onCancel: (...args: any[]) => any;
18
20
  onSave: (...args: any[]) => any;
19
21
  onKeyDown: (...args: any[]) => any;
@@ -11,6 +11,7 @@ const useEditState = props => {
11
11
  onCancel,
12
12
  onSave,
13
13
  onClick,
14
+ onFocus,
14
15
  ...htmlProps
15
16
  } = props;
16
17
  const [isEditing, setIsEditing] = useState(false);
@@ -27,6 +28,12 @@ const useEditState = props => {
27
28
  setIsEditing(true);
28
29
  setResetValue(value);
29
30
  });
31
+ const handleFocus = useEventCallback(event => {
32
+ if (disabled) return;
33
+ onFocus === null || onFocus === void 0 || onFocus(event);
34
+ setIsEditing(true);
35
+ setResetValue(value);
36
+ });
30
37
  const handleChange = useEventCallback((value, event) => {
31
38
  setValue(value);
32
39
  onChange === null || onChange === void 0 || onChange(value, event);
@@ -64,6 +71,7 @@ const useEditState = props => {
64
71
  value,
65
72
  onClick: handleClick,
66
73
  onChange: handleChange,
74
+ onFocus: handleFocus,
67
75
  onCancel: handleCancel,
68
76
  onSave: handleSave,
69
77
  onKeyDown: handleKeyDown,
@@ -1,19 +1,10 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '../internals/Box';
2
+ import { InputBaseCommonProps } from '../internals/InputBase';
3
3
  import { PrependParameters } from '../internals/types/utils';
4
- import type { PropsWithoutChange, SanitizedInputProps, FormControlBaseProps, Size } from '../internals/types';
5
- export interface LocaleType {
6
- unfilled: string;
7
- }
8
- export interface InputProps extends BoxProps, SanitizedInputProps, PropsWithoutChange<FormControlBaseProps> {
4
+ import type { SanitizedInputProps, PropsWithoutChange, FormControlBaseProps } from '../internals/types';
5
+ export interface InputProps extends InputBaseCommonProps, SanitizedInputProps, PropsWithoutChange<FormControlBaseProps> {
9
6
  /** The HTML input type */
10
7
  type?: string;
11
- /** The HTML input id */
12
- id?: string;
13
- /** A component can have different sizes */
14
- size?: Size;
15
- /** Ref of input element */
16
- inputRef?: React.Ref<any>;
17
8
  /**
18
9
  * The htmlSize attribute defines the width of the <input> element.
19
10
  *
@@ -1,14 +1,9 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React, { useContext } from 'react';
4
- import Plaintext from "../internals/Plaintext/index.js";
5
- import Box from "../internals/Box/index.js";
6
4
  import { forwardRef } from "../internals/utils/index.js";
7
- import { useFormGroup } from "../FormGroup/index.js";
5
+ import InputBase from "../internals/InputBase/index.js";
8
6
  import { InputGroupContext } from "../InputGroup/InputGroup.js";
9
- import { KEY_VALUES } from "../internals/constants/index.js";
10
- import { useStyles } from "../internals/hooks/index.js";
11
- import { createChainedFunction, mergeRefs } from "../internals/utils/index.js";
12
7
  import { useCustom } from "../CustomProvider/index.js";
13
8
  /**
14
9
  * The `<Input>` component is used to get user input in a text field.
@@ -21,79 +16,22 @@ const Input = forwardRef((props, ref) => {
21
16
  } = useCustom('Input', props);
22
17
  const inputGroup = useContext(InputGroupContext);
23
18
  const {
24
- as = 'input',
25
- className,
26
- classPrefix = 'input',
27
19
  type = 'text',
28
- disabled,
29
- value,
30
- defaultValue,
31
- inputRef,
32
- id,
33
- size = (inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.size) || 'md',
34
20
  htmlSize,
35
- plaintext,
36
- placeholder,
37
- readOnly,
38
- onPressEnter,
39
- onFocus,
40
- onBlur,
41
- onKeyDown,
42
- onChange,
21
+ size = (inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.size) || 'md',
22
+ classPrefix = 'input',
43
23
  ...rest
44
24
  } = propsWithDefaults;
45
- const handleKeyDown = event => {
46
- if (event.key === KEY_VALUES.ENTER) {
47
- onPressEnter === null || onPressEnter === void 0 || onPressEnter(event);
48
- }
49
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
50
- };
51
- const handleChange = event => {
52
- var _event$target;
53
- onChange === null || onChange === void 0 || onChange((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, event);
54
- };
55
- const {
56
- withPrefix,
57
- merge
58
- } = useStyles(classPrefix);
59
- const classes = merge(className, withPrefix(size, {
60
- plaintext
61
- }));
62
- const {
63
- controlId
64
- } = useFormGroup();
65
-
66
- // Make the Input component display in plain text,
67
- // and display default characters when there is no value.
68
- if (plaintext) {
69
- return /*#__PURE__*/React.createElement(Plaintext, {
70
- ref: ref,
71
- localeKey: "unfilled",
72
- placeholder: placeholder
73
- }, typeof value === 'undefined' ? defaultValue : value);
74
- }
75
- const inputable = !disabled && !readOnly;
76
- const eventProps = {};
77
- if (inputable) {
78
- eventProps.onChange = handleChange;
79
- eventProps.onKeyDown = handleKeyDown;
80
- eventProps.onFocus = createChainedFunction(onFocus, inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.onFocus);
81
- eventProps.onBlur = createChainedFunction(onBlur, inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.onBlur);
82
- }
83
- return /*#__PURE__*/React.createElement(Box, _extends({
84
- as: as
85
- }, rest, eventProps, {
86
- ref: mergeRefs(ref, inputRef),
87
- className: classes,
25
+ return /*#__PURE__*/React.createElement(InputBase, _extends({
26
+ as: "input",
27
+ ref: ref,
28
+ classPrefix: classPrefix,
29
+ size: size,
88
30
  type: type,
89
- id: id || controlId,
90
- value: value,
91
- defaultValue: defaultValue,
92
- disabled: disabled,
93
- readOnly: readOnly,
94
- size: htmlSize,
95
- placeholder: placeholder
96
- }));
31
+ inputProps: {
32
+ size: htmlSize
33
+ }
34
+ }, rest));
97
35
  });
98
36
  Input.displayName = 'Input';
99
37
  export default Input;
@@ -6,7 +6,6 @@ import isFunction from 'lodash/isFunction';
6
6
  import remove from 'lodash/remove';
7
7
  import clone from 'lodash/clone';
8
8
  import isArray from 'lodash/isArray';
9
- import omit from 'lodash/omit';
10
9
  import pick from 'lodash/pick';
11
10
  import Tag from "../Tag/index.js";
12
11
  import TextBox from "./TextBox.js";
@@ -14,7 +13,6 @@ import Stack from "../Stack/index.js";
14
13
  import useInput from "./hooks/useInput.js";
15
14
  import useData from "./hooks/useData.js";
16
15
  import Plaintext from "../internals/Plaintext/index.js";
17
- import Box from "../internals/Box/index.js";
18
16
  import { filterNodesOfTree } from "../internals/Tree/utils/index.js";
19
17
  import { useStyles, useControlled, useEventCallback } from "../internals/hooks/index.js";
20
18
  import { KEY_VALUES } from "../internals/constants/index.js";
@@ -22,7 +20,7 @@ import { useTagContext } from "./InputPickerContext.js";
22
20
  import { convertSize } from "./utils.js";
23
21
  import { useCustom } from "../CustomProvider/index.js";
24
22
  import { forwardRef, shallowEqual, getDataGroupBy, createChainedFunction, tplTransform, mergeRefs, isOneOf, mergeStyles } from "../internals/utils/index.js";
25
- import { Listbox, ListItem, ListCheckItem, PickerToggle, PickerPopup, PickerToggleTrigger, useFocusItemValue, usePickerClassName, useSearch, usePickerRef, useToggleKeyDownEvent, pickTriggerPropKeys, omitTriggerPropKeys } from "../internals/Picker/index.js";
23
+ import { Listbox, ListItem, ListCheckItem, PickerToggle, PickerPopup, PickerToggleTrigger, useFocusItemValue, useSearch, usePickerRef, useToggleKeyDownEvent, triggerPropKeys } from "../internals/Picker/index.js";
26
24
  import { getPositionStyle } from "../internals/Overlay/Position.js";
27
25
  /**
28
26
  * Single item selector with text box input.
@@ -36,8 +34,10 @@ const InputPicker = forwardRef((props, ref) => {
36
34
  const {
37
35
  as,
38
36
  appearance = 'default',
37
+ block,
39
38
  cleanable = true,
40
39
  cacheData = [],
40
+ className,
41
41
  classPrefix = 'picker',
42
42
  caretAs,
43
43
  data: controlledData = [],
@@ -564,19 +564,8 @@ const InputPicker = forwardRef((props, ref) => {
564
564
  const hasSingleValue = !isNil(value) && isFunction(renderValue) && !isNil(itemNode);
565
565
  const hasMultiValue = isArray(value) && value.length > 0 && isFunction(renderValue) && !isNil(tagElements);
566
566
  const hasValue = multi ? !!(tagElements !== null && tagElements !== void 0 && tagElements.length) || hasMultiValue : isValid || hasSingleValue;
567
- const [pickerClasses, usedClassNamePropKeys] = usePickerClassName({
568
- ...props,
569
- classPrefix,
570
- appearance,
571
- hasValue,
572
- name: 'input',
573
- cleanable
574
- });
575
- const classes = merge(pickerClasses, {
576
- [prefix`tag`]: multi,
577
- [prefix(`${multi ? 'tag' : 'input'}-${size}`)]: size,
578
- [prefix`focused`]: open,
579
- [prefix`disabled-options`]: disabledOptions
567
+ const classes = merge(className, {
568
+ [prefix`focused`]: open
580
569
  });
581
570
  const searching = !!searchKeyword && open;
582
571
  const editable = searchable && !disabled && !loading;
@@ -595,26 +584,36 @@ const InputPicker = forwardRef((props, ref) => {
595
584
  }, plaintextProps), itemNode || (tagElements !== null && tagElements !== void 0 && tagElements.length ? tagElements : null) || placeholder);
596
585
  }
597
586
  const placeholderNode = placeholder || (disabledOptions ? null : locale === null || locale === void 0 ? void 0 : locale.placeholder);
598
- return /*#__PURE__*/React.createElement(PickerToggleTrigger, {
587
+ const triggerProps = {
588
+ ...pick(props, triggerPropKeys),
589
+ onEnter: createChainedFunction(handleEnter, onEnter),
590
+ onEntered: onEntered,
591
+ onExit: createChainedFunction(handleExit, onExit),
592
+ onExited: createChainedFunction(handleExited, onExited)
593
+ };
594
+ return /*#__PURE__*/React.createElement(PickerToggleTrigger, _extends({
599
595
  id: id,
600
596
  multiple: multi,
601
- pickerProps: pick(props, pickTriggerPropKeys),
597
+ name: multi ? 'tag' : 'input',
598
+ block: block,
599
+ disabled: disabled,
600
+ appearance: appearance,
601
+ as: as,
602
+ triggerProps: triggerProps,
602
603
  ref: triggerRef,
603
604
  trigger: "active",
604
- onEnter: createChainedFunction(handleEnter, onEnter),
605
- onEntered: onEntered,
606
- onExit: createChainedFunction(handleExit, onExit),
607
- onExited: createChainedFunction(handleExited, onExited),
608
605
  speaker: renderPopup,
609
- placement: placement
610
- }, /*#__PURE__*/React.createElement(Box, _extends({
611
- as: as,
612
- className: classes,
606
+ placement: placement,
607
+ rootRef: root,
613
608
  style: style,
609
+ size: size,
610
+ classPrefix: classPrefix,
611
+ className: classes,
612
+ responsive: searchable === false,
614
613
  onClick: focus,
615
614
  onKeyDown: onPickerKeyDown,
616
- ref: root
617
- }, omit(rest, [...omitTriggerPropKeys, ...usedClassNamePropKeys])), /*#__PURE__*/React.createElement(PickerToggle, {
615
+ "data-disabled-options": disabledOptions
616
+ }, rest), /*#__PURE__*/React.createElement(PickerToggle, {
618
617
  loading: loading,
619
618
  label: label,
620
619
  appearance: appearance,
@@ -647,7 +646,7 @@ const InputPicker = forwardRef((props, ref) => {
647
646
  onBlur: onBlur,
648
647
  onFocus: handleFocus,
649
648
  onChange: handleSearch
650
- })));
649
+ }));
651
650
  });
652
651
  InputPicker.displayName = 'InputPicker';
653
652
  export default InputPicker;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ExternalLinkIcon: (props: React.HTMLAttributes<SVGElement>) => React.JSX.Element;
3
+ export default ExternalLinkIcon;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import React from 'react';
4
+ const ExternalLinkIcon = props => /*#__PURE__*/React.createElement("svg", _extends({
5
+ stroke: "currentColor",
6
+ fill: "currentColor",
7
+ strokeWidth: "0",
8
+ viewBox: "0 0 24 24",
9
+ height: "1em",
10
+ width: "1em",
11
+ xmlns: "http://www.w3.org/2000/svg"
12
+ }, props), /*#__PURE__*/React.createElement("path", {
13
+ fill: "none",
14
+ d: "M0 0h24v24H0V0z"
15
+ }), /*#__PURE__*/React.createElement("path", {
16
+ d: "M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"
17
+ }));
18
+ export default ExternalLinkIcon;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { SafeAnchorProps } from '../internals/SafeAnchor';
3
+ export interface LinkProps extends SafeAnchorProps {
4
+ /** The icon to be displayed after the link */
5
+ anchorIcon?: React.ReactNode;
6
+ /** Determines in which cases link should have text-decoration: underline styles, hover by default */
7
+ underline?: 'always' | 'hover' | 'not-hover' | 'never';
8
+ /** Whether the link is external */
9
+ external?: boolean;
10
+ /** Whether to show the anchor icon */
11
+ showAnchorIcon?: boolean;
12
+ }
13
+ declare const Link: import("../internals/types").InternalRefForwardingComponent<"a", LinkProps, never> & Record<string, never>;
14
+ export default Link;
@@ -0,0 +1,47 @@
1
+ 'use client';
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import React from 'react';
4
+ import { forwardRef } from "../internals/utils/index.js";
5
+ import { useStyles } from "../internals/hooks/index.js";
6
+ import { useCustom } from "../CustomProvider/index.js";
7
+ import SafeAnchor from "../internals/SafeAnchor/index.js";
8
+ import ExternalLinkIcon from "./ExternalLinkIcon.js";
9
+ const Link = forwardRef((props, ref) => {
10
+ const {
11
+ propsWithDefaults
12
+ } = useCustom('Link', props);
13
+ const {
14
+ as,
15
+ anchorIcon,
16
+ classPrefix = 'link',
17
+ className,
18
+ children,
19
+ disabled,
20
+ underline,
21
+ showAnchorIcon,
22
+ external,
23
+ ...rest
24
+ } = propsWithDefaults;
25
+ const {
26
+ merge,
27
+ prefix,
28
+ withPrefix
29
+ } = useStyles(classPrefix);
30
+ const classes = merge(className, withPrefix());
31
+ const icon = anchorIcon || /*#__PURE__*/React.createElement(ExternalLinkIcon, {
32
+ className: prefix('icon')
33
+ });
34
+ return /*#__PURE__*/React.createElement(SafeAnchor, _extends({
35
+ as: as,
36
+ ref: ref,
37
+ role: "link",
38
+ className: classes,
39
+ disabled: disabled,
40
+ target: external ? '_blank' : undefined,
41
+ rel: external ? 'noopener noreferrer' : undefined,
42
+ "data-underline": underline,
43
+ "data-disabled": disabled
44
+ }, rest), children, showAnchorIcon && icon);
45
+ });
46
+ Link.displayName = 'Link';
47
+ export default Link;
@@ -0,0 +1,4 @@
1
+ import Link from './Link';
2
+ export type { LinkProps } from './Link';
3
+ export { Link };
4
+ export default Link;
@@ -0,0 +1,8 @@
1
+ 'use client';
2
+ import Link from "./Link.js";
3
+
4
+ // export types
5
+
6
+ // export components
7
+ export { Link };
8
+ export default Link;
package/esm/List/List.js CHANGED
@@ -48,7 +48,9 @@ const List = forwardRef((props, ref) => {
48
48
  register,
49
49
  sorting,
50
50
  handleEnd,
51
- handleStart
51
+ handleStart,
52
+ handleTouchStart,
53
+ handleTouchEnd
52
54
  } = useSortHelper({
53
55
  autoScroll,
54
56
  onSort,
@@ -76,7 +78,9 @@ const List = forwardRef((props, ref) => {
76
78
  ref: mergeRefs(containerRef, ref),
77
79
  className: classes,
78
80
  onMouseDown: sortable ? handleStart : undefined,
79
- onMouseUp: sortable ? handleEnd : undefined
81
+ onMouseUp: sortable ? handleEnd : undefined,
82
+ onTouchStart: sortable ? handleTouchStart : undefined,
83
+ onTouchEnd: sortable ? handleTouchEnd : undefined
80
84
  }, rest), /*#__PURE__*/React.createElement(ListContext.Provider, {
81
85
  value: contextValue
82
86
  }, children));