rsuite 6.0.0-canary-20241227 → 6.0.0-canary-20250103

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 (313) hide show
  1. package/AutoComplete/styles/index.css +8 -16
  2. package/Badge/styles/index.css +83 -17
  3. package/Badge/styles/index.less +68 -9
  4. package/Button/styles/index.css +5 -10
  5. package/Button/styles/mixin.less +1 -2
  6. package/CHANGELOG.md +18 -0
  7. package/Calendar/styles/index.css +6 -12
  8. package/Cascader/styles/index.css +8 -16
  9. package/CheckPicker/styles/index.css +8 -16
  10. package/CheckTree/styles/index.css +8 -16
  11. package/CheckTreePicker/styles/index.css +8 -16
  12. package/DatePicker/styles/index.css +9 -18
  13. package/DateRangePicker/styles/index.css +9 -18
  14. package/Dropdown/styles/index.css +5 -10
  15. package/IconButton/styles/index.css +7 -14
  16. package/InputGroup/styles/index.css +6 -12
  17. package/InputNumber/styles/index.css +6 -12
  18. package/InputPicker/styles/index.css +8 -16
  19. package/MultiCascadeTree/styles/index.css +8 -16
  20. package/MultiCascader/styles/index.css +8 -16
  21. package/Nav/styles/index.css +5 -10
  22. package/Navbar/styles/index.css +5 -10
  23. package/Pagination/styles/index.css +11 -22
  24. package/Rate/styles/index.css +16 -8
  25. package/Rate/styles/index.less +6 -2
  26. package/SelectPicker/styles/index.css +8 -16
  27. package/Stat/styles/index.css +7 -14
  28. package/Table/styles/index.css +2 -2
  29. package/Tabs/styles/index.css +5 -10
  30. package/Tag/styles/index.css +29 -21
  31. package/Tag/styles/index.less +6 -3
  32. package/TagInput/styles/index.css +8 -16
  33. package/TagPicker/styles/index.css +8 -16
  34. package/TimePicker/styles/index.css +9 -18
  35. package/TimeRangePicker/styles/index.css +9 -18
  36. package/Tree/styles/index.css +8 -16
  37. package/TreePicker/styles/index.css +8 -16
  38. package/Uploader/styles/index.css +7 -14
  39. package/cjs/Accordion/Accordion.js +1 -1
  40. package/cjs/AutoComplete/AutoComplete.d.ts +2 -2
  41. package/cjs/AutoComplete/Combobox.js +1 -1
  42. package/cjs/Badge/Badge.d.ts +40 -5
  43. package/cjs/Badge/Badge.js +30 -19
  44. package/cjs/Breadcrumb/Breadcrumb.js +1 -1
  45. package/cjs/Button/Button.d.ts +5 -1
  46. package/cjs/Button/Button.js +17 -3
  47. package/cjs/Card/Card.js +1 -1
  48. package/cjs/CascadeTree/utils.js +1 -1
  49. package/cjs/CustomProvider/CustomProvider.d.ts +12 -4
  50. package/cjs/CustomProvider/CustomProvider.js +4 -3
  51. package/cjs/DateInput/hooks/useDateInputState.js +10 -8
  52. package/cjs/DateInput/hooks/useKeyboardInputEvent.js +1 -0
  53. package/cjs/DatePicker/PredefinedRanges.js +1 -1
  54. package/cjs/DateRangePicker/DateRangePicker.js +1 -1
  55. package/cjs/Drawer/Drawer.d.ts +2 -2
  56. package/cjs/Drawer/Drawer.js +1 -1
  57. package/cjs/Drawer/DrawerBody.js +7 -5
  58. package/cjs/Drawer/DrawerFooter.js +7 -5
  59. package/cjs/Drawer/DrawerHeader.js +7 -5
  60. package/cjs/Drawer/DrawerTitle.js +7 -5
  61. package/cjs/Dropdown/Dropdown.d.ts +2 -2
  62. package/cjs/Dropdown/Dropdown.js +1 -1
  63. package/cjs/Dropdown/DropdownContext.d.ts +1 -1
  64. package/cjs/Dropdown/DropdownMenu.d.ts +2 -2
  65. package/cjs/Dropdown/DropdownToggle.d.ts +2 -2
  66. package/cjs/FlexboxGrid/FlexboxGrid.js +1 -1
  67. package/cjs/Form/Form.js +1 -1
  68. package/cjs/FormControl/FormControl.d.ts +2 -2
  69. package/cjs/FormErrorMessage/FormErrorMessage.d.ts +2 -2
  70. package/cjs/InlineEdit/EditableControls.js +1 -1
  71. package/cjs/InputGroup/InputGroup.js +1 -1
  72. package/cjs/InputNumber/InputNumber.js +1 -1
  73. package/cjs/InputPicker/InputPicker.js +0 -1
  74. package/cjs/InputPicker/TagList.js +1 -0
  75. package/cjs/InputPicker/TextBox.js +1 -0
  76. package/cjs/InputPicker/hooks/useMaxWidth.js +0 -1
  77. package/cjs/List/List.js +1 -1
  78. package/cjs/MaskedInput/MaskedInput.js +1 -0
  79. package/cjs/MaskedInput/conformToMask.js +0 -1
  80. package/cjs/Modal/Modal.js +1 -1
  81. package/cjs/Modal/utils.js +0 -1
  82. package/cjs/Nav/Nav.js +1 -1
  83. package/cjs/Nav/NavDropdown.d.ts +2 -2
  84. package/cjs/Nav/NavDropdown.js +1 -1
  85. package/cjs/Nav/NavDropdownToggle.d.ts +2 -2
  86. package/cjs/Navbar/Navbar.js +1 -1
  87. package/cjs/Navbar/NavbarDropdown.d.ts +2 -2
  88. package/cjs/Navbar/NavbarDropdown.js +1 -1
  89. package/cjs/Navbar/NavbarDropdownToggle.d.ts +2 -2
  90. package/cjs/Navbar/index.js +0 -0
  91. package/cjs/RangeSlider/RangeSlider.js +4 -4
  92. package/cjs/Rate/Character.js +6 -6
  93. package/cjs/Rate/Rate.d.ts +4 -4
  94. package/cjs/Rate/Rate.js +16 -15
  95. package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
  96. package/cjs/Sidenav/Sidenav.js +1 -1
  97. package/cjs/Sidenav/SidenavDropdown.d.ts +2 -2
  98. package/cjs/Sidenav/SidenavDropdown.js +1 -1
  99. package/cjs/Sidenav/SidenavDropdownToggle.d.ts +2 -2
  100. package/cjs/Stack/HStack.js +1 -1
  101. package/cjs/Stack/Stack.js +1 -1
  102. package/cjs/Stack/VStack.js +1 -1
  103. package/cjs/Stat/Stat.js +1 -1
  104. package/cjs/Steps/Steps.js +1 -1
  105. package/cjs/Table/Table.js +2 -2
  106. package/cjs/Tabs/Tabs.js +8 -9
  107. package/cjs/Tag/Tag.d.ts +2 -2
  108. package/cjs/Tag/Tag.js +12 -6
  109. package/cjs/Timeline/Timeline.js +8 -5
  110. package/cjs/Tooltip/Tooltip.d.ts +2 -2
  111. package/cjs/Tree/hooks/useFlattenTree.js +1 -3
  112. package/cjs/Tree/hooks/useFocusTree.js +0 -1
  113. package/cjs/Tree/hooks/useTreeSearch.js +0 -1
  114. package/cjs/Uploader/UploadTrigger.js +13 -28
  115. package/cjs/Uploader/utils/ajaxUpload.js +1 -1
  116. package/cjs/internals/Disclosure/Disclosure.js +1 -0
  117. package/cjs/internals/Menu/useMenu.js +51 -49
  118. package/cjs/internals/Overlay/Overlay.d.ts +2 -2
  119. package/cjs/internals/Overlay/OverlayTrigger.d.ts +2 -2
  120. package/cjs/internals/Overlay/Position.d.ts +2 -2
  121. package/cjs/internals/Overlay/positionUtils.d.ts +2 -2
  122. package/cjs/internals/Picker/PickerToggle.d.ts +2 -2
  123. package/cjs/internals/Picker/PickerToggleTrigger.d.ts +2 -2
  124. package/cjs/internals/Picker/hooks/useFocusItemValue.js +1 -1
  125. package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
  126. package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
  127. package/cjs/internals/Tree/TreeView.js +2 -1
  128. package/cjs/internals/Tree/utils/getPathTowardsItem.js +1 -1
  129. package/cjs/internals/Windowing/AutoSizer.js +1 -0
  130. package/cjs/internals/Windowing/List.js +2 -1
  131. package/cjs/internals/hooks/useClassNames.d.ts +1 -2
  132. package/cjs/internals/hooks/useClassNames.js +0 -2
  133. package/cjs/internals/hooks/usePortal.js +1 -1
  134. package/cjs/internals/hooks/useToggleCaret.d.ts +2 -2
  135. package/cjs/internals/hooks/useToggleCaret.js +1 -1
  136. package/cjs/internals/hooks/useUpdateEffect.js +0 -1
  137. package/cjs/internals/hooks/useWillUnmount.js +0 -2
  138. package/cjs/internals/symbols.d.ts +1 -0
  139. package/cjs/internals/symbols.js +3 -2
  140. package/cjs/internals/types/colours.d.ts +10 -0
  141. package/cjs/internals/types/colours.js +15 -0
  142. package/cjs/internals/types/index.d.ts +6 -7
  143. package/cjs/internals/types/index.js +13 -1
  144. package/cjs/internals/types/placement.d.ts +5 -0
  145. package/cjs/internals/types/placement.js +4 -0
  146. package/cjs/internals/utils/BrowserDetection.d.ts +0 -2
  147. package/cjs/internals/utils/BrowserDetection.js +2 -12
  148. package/cjs/internals/utils/ReactChildren.js +0 -2
  149. package/cjs/internals/utils/colours.d.ts +21 -0
  150. package/cjs/internals/utils/colours.js +86 -0
  151. package/cjs/internals/utils/css.d.ts +13 -1
  152. package/cjs/internals/utils/css.js +42 -3
  153. package/cjs/internals/utils/getDOMNode.js +2 -2
  154. package/cjs/internals/utils/getSafeRegExpString.js +2 -1
  155. package/cjs/internals/utils/index.d.ts +2 -2
  156. package/cjs/internals/utils/index.js +17 -9
  157. package/cjs/toaster/ToastContainer.d.ts +8 -8
  158. package/cjs/toaster/ToastContainer.js +39 -36
  159. package/cjs/toaster/render.d.ts +2 -0
  160. package/cjs/toaster/render.js +25 -0
  161. package/cjs/toaster/toaster.js +29 -19
  162. package/cjs/useMediaQuery/useMediaQuery.js +1 -3
  163. package/cjs/useToaster/useToaster.js +10 -5
  164. package/dist/rsuite-no-reset-rtl.css +143 -74
  165. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  166. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  167. package/dist/rsuite-no-reset.css +143 -74
  168. package/dist/rsuite-no-reset.min.css +1 -1
  169. package/dist/rsuite-no-reset.min.css.map +1 -1
  170. package/dist/rsuite-rtl.css +143 -74
  171. package/dist/rsuite-rtl.min.css +1 -1
  172. package/dist/rsuite-rtl.min.css.map +1 -1
  173. package/dist/rsuite.css +143 -74
  174. package/dist/rsuite.js +113 -91
  175. package/dist/rsuite.js.map +1 -1
  176. package/dist/rsuite.min.css +1 -1
  177. package/dist/rsuite.min.css.map +1 -1
  178. package/dist/rsuite.min.js +1 -1
  179. package/dist/rsuite.min.js.map +1 -1
  180. package/esm/Accordion/Accordion.js +1 -1
  181. package/esm/AutoComplete/AutoComplete.d.ts +2 -2
  182. package/esm/AutoComplete/Combobox.js +1 -1
  183. package/esm/Badge/Badge.d.ts +40 -5
  184. package/esm/Badge/Badge.js +28 -19
  185. package/esm/Breadcrumb/Breadcrumb.js +1 -1
  186. package/esm/Button/Button.d.ts +5 -1
  187. package/esm/Button/Button.js +18 -4
  188. package/esm/Card/Card.js +1 -1
  189. package/esm/CascadeTree/utils.js +1 -1
  190. package/esm/CustomProvider/CustomProvider.d.ts +12 -4
  191. package/esm/CustomProvider/CustomProvider.js +5 -4
  192. package/esm/DateInput/hooks/useDateInputState.js +10 -8
  193. package/esm/DateInput/hooks/useKeyboardInputEvent.js +1 -0
  194. package/esm/DatePicker/PredefinedRanges.js +1 -1
  195. package/esm/DateRangePicker/DateRangePicker.js +1 -1
  196. package/esm/Drawer/Drawer.d.ts +2 -2
  197. package/esm/Drawer/Drawer.js +1 -1
  198. package/esm/Drawer/DrawerBody.js +7 -5
  199. package/esm/Drawer/DrawerFooter.js +7 -5
  200. package/esm/Drawer/DrawerHeader.js +7 -5
  201. package/esm/Drawer/DrawerTitle.js +7 -5
  202. package/esm/Dropdown/Dropdown.d.ts +2 -2
  203. package/esm/Dropdown/Dropdown.js +1 -1
  204. package/esm/Dropdown/DropdownContext.d.ts +1 -1
  205. package/esm/Dropdown/DropdownMenu.d.ts +2 -2
  206. package/esm/Dropdown/DropdownToggle.d.ts +2 -2
  207. package/esm/FlexboxGrid/FlexboxGrid.js +1 -1
  208. package/esm/Form/Form.js +1 -1
  209. package/esm/FormControl/FormControl.d.ts +2 -2
  210. package/esm/FormErrorMessage/FormErrorMessage.d.ts +2 -2
  211. package/esm/InlineEdit/EditableControls.js +1 -1
  212. package/esm/InputGroup/InputGroup.js +1 -1
  213. package/esm/InputNumber/InputNumber.js +1 -1
  214. package/esm/InputPicker/InputPicker.js +0 -1
  215. package/esm/InputPicker/TagList.js +1 -0
  216. package/esm/InputPicker/TextBox.js +1 -0
  217. package/esm/InputPicker/hooks/useMaxWidth.js +0 -1
  218. package/esm/List/List.js +1 -1
  219. package/esm/MaskedInput/MaskedInput.js +1 -0
  220. package/esm/MaskedInput/conformToMask.js +0 -1
  221. package/esm/Modal/Modal.js +1 -1
  222. package/esm/Modal/utils.js +0 -1
  223. package/esm/Nav/Nav.js +1 -1
  224. package/esm/Nav/NavDropdown.d.ts +2 -2
  225. package/esm/Nav/NavDropdown.js +1 -1
  226. package/esm/Nav/NavDropdownToggle.d.ts +2 -2
  227. package/esm/Navbar/Navbar.js +1 -1
  228. package/esm/Navbar/NavbarDropdown.d.ts +2 -2
  229. package/esm/Navbar/NavbarDropdown.js +1 -1
  230. package/esm/Navbar/NavbarDropdownToggle.d.ts +2 -2
  231. package/esm/Navbar/index.js +0 -0
  232. package/esm/RangeSlider/RangeSlider.js +4 -4
  233. package/esm/Rate/Character.js +8 -8
  234. package/esm/Rate/Rate.d.ts +4 -4
  235. package/esm/Rate/Rate.js +19 -18
  236. package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
  237. package/esm/Sidenav/Sidenav.js +1 -1
  238. package/esm/Sidenav/SidenavDropdown.d.ts +2 -2
  239. package/esm/Sidenav/SidenavDropdown.js +1 -1
  240. package/esm/Sidenav/SidenavDropdownToggle.d.ts +2 -2
  241. package/esm/Stack/HStack.js +1 -1
  242. package/esm/Stack/Stack.js +1 -1
  243. package/esm/Stack/VStack.js +1 -1
  244. package/esm/Stat/Stat.js +1 -1
  245. package/esm/Steps/Steps.js +1 -1
  246. package/esm/Table/Table.js +2 -2
  247. package/esm/Tabs/Tabs.js +8 -9
  248. package/esm/Tag/Tag.d.ts +2 -2
  249. package/esm/Tag/Tag.js +10 -6
  250. package/esm/Timeline/Timeline.js +8 -5
  251. package/esm/Tooltip/Tooltip.d.ts +2 -2
  252. package/esm/Tree/hooks/useFlattenTree.js +1 -3
  253. package/esm/Tree/hooks/useFocusTree.js +0 -1
  254. package/esm/Tree/hooks/useTreeSearch.js +0 -1
  255. package/esm/Uploader/UploadTrigger.js +15 -30
  256. package/esm/Uploader/utils/ajaxUpload.js +1 -1
  257. package/esm/internals/Disclosure/Disclosure.js +1 -0
  258. package/esm/internals/Menu/useMenu.js +51 -49
  259. package/esm/internals/Overlay/Overlay.d.ts +2 -2
  260. package/esm/internals/Overlay/OverlayTrigger.d.ts +2 -2
  261. package/esm/internals/Overlay/Position.d.ts +2 -2
  262. package/esm/internals/Overlay/positionUtils.d.ts +2 -2
  263. package/esm/internals/Picker/PickerToggle.d.ts +2 -2
  264. package/esm/internals/Picker/PickerToggleTrigger.d.ts +2 -2
  265. package/esm/internals/Picker/hooks/useFocusItemValue.js +1 -1
  266. package/esm/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
  267. package/esm/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
  268. package/esm/internals/Tree/TreeView.js +2 -1
  269. package/esm/internals/Tree/utils/getPathTowardsItem.js +1 -1
  270. package/esm/internals/Windowing/AutoSizer.js +1 -0
  271. package/esm/internals/Windowing/List.js +2 -1
  272. package/esm/internals/hooks/useClassNames.d.ts +1 -2
  273. package/esm/internals/hooks/useClassNames.js +0 -2
  274. package/esm/internals/hooks/usePortal.js +1 -1
  275. package/esm/internals/hooks/useToggleCaret.d.ts +2 -2
  276. package/esm/internals/hooks/useToggleCaret.js +1 -1
  277. package/esm/internals/hooks/useUpdateEffect.js +0 -1
  278. package/esm/internals/hooks/useWillUnmount.js +0 -2
  279. package/esm/internals/symbols.d.ts +1 -0
  280. package/esm/internals/symbols.js +2 -1
  281. package/esm/internals/types/colours.d.ts +10 -0
  282. package/esm/internals/types/colours.js +11 -0
  283. package/esm/internals/types/index.d.ts +6 -7
  284. package/esm/internals/types/index.js +6 -0
  285. package/esm/internals/types/placement.d.ts +5 -0
  286. package/esm/internals/types/placement.js +2 -0
  287. package/esm/internals/utils/BrowserDetection.d.ts +0 -2
  288. package/esm/internals/utils/BrowserDetection.js +1 -9
  289. package/esm/internals/utils/ReactChildren.js +0 -2
  290. package/esm/internals/utils/colours.d.ts +21 -0
  291. package/esm/internals/utils/colours.js +77 -0
  292. package/esm/internals/utils/css.d.ts +13 -1
  293. package/esm/internals/utils/css.js +40 -3
  294. package/esm/internals/utils/getDOMNode.js +1 -2
  295. package/esm/internals/utils/getSafeRegExpString.js +2 -1
  296. package/esm/internals/utils/index.d.ts +2 -2
  297. package/esm/internals/utils/index.js +3 -3
  298. package/esm/toaster/ToastContainer.d.ts +8 -8
  299. package/esm/toaster/ToastContainer.js +39 -37
  300. package/esm/toaster/render.d.ts +2 -0
  301. package/esm/toaster/render.js +21 -0
  302. package/esm/toaster/toaster.js +27 -18
  303. package/esm/useMediaQuery/useMediaQuery.js +1 -3
  304. package/esm/useToaster/useToaster.js +10 -5
  305. package/package.json +1 -1
  306. package/styles/color-modes/dark.less +1 -0
  307. package/styles/color-modes/high-contrast.less +1 -0
  308. package/styles/color-modes/light.less +1 -0
  309. package/styles/variables.less +1 -1
  310. package/cjs/internals/utils/render.d.ts +0 -7
  311. package/cjs/internals/utils/render.js +0 -26
  312. package/esm/internals/utils/render.d.ts +0 -7
  313. package/esm/internals/utils/render.js +0 -22
@@ -8,7 +8,7 @@ import { useCustom } from "../CustomProvider/index.js";
8
8
  * The `Accordion` component is used to display content that can be collapsed.
9
9
  * @see https://rsuitejs.com/components/accordion
10
10
  */
11
- const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(props, ref) {
12
12
  const {
13
13
  propsWithDefaults
14
14
  } = useCustom('Accordion', props);
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { PickerComponent } from '../internals/Picker';
3
- import { WithAsProps, FormControlPickerProps, TypeAttributes, ItemDataType } from '../internals/types';
3
+ import { WithAsProps, FormControlPickerProps, TypeAttributes, Placement, ItemDataType } from '../internals/types';
4
4
  export interface AutoCompleteProps<T = string> extends WithAsProps, FormControlPickerProps<T, any, ItemDataType | string> {
5
5
  /** Additional classes for menu */
6
6
  menuClassName?: string;
7
7
  /** The placement of component */
8
- placement?: TypeAttributes.Placement;
8
+ placement?: Placement;
9
9
  /** When set to false, the Enter key selection function is invalid */
10
10
  selectOnEnter?: boolean;
11
11
  /** A component can have different sizes */
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import { useCombobox } from "../internals/Picker/index.js";
5
5
  import Input from "../Input/index.js";
6
- const Combobox = /*#__PURE__*/React.forwardRef((props, ref) => {
6
+ const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
7
7
  const {
8
8
  id,
9
9
  popupType
@@ -1,12 +1,47 @@
1
1
  import React from 'react';
2
- import { WithAsProps, RsRefForwardingComponent, TypeAttributes } from '../internals/types';
2
+ import { Color, WithAsProps, PlacementCorners, RsRefForwardingComponent } from '../internals/types';
3
3
  export interface BadgeProps extends WithAsProps {
4
- /** Main content */
4
+ /**
5
+ * The content of the badge
6
+ */
5
7
  content?: React.ReactNode;
6
- /** Max count */
8
+ /**
9
+ * The maximum value of the badge
10
+ */
7
11
  maxCount?: number;
8
- /** A badge can have different colors */
9
- color?: TypeAttributes.Color;
12
+ /**
13
+ * A badge can have different colors
14
+ */
15
+ color?: Color | React.CSSProperties['color'];
16
+ /**
17
+ * The badge will have an outline
18
+ * @version 6.0.0
19
+ */
20
+ outline?: boolean;
21
+ /**
22
+ * The placement of the badge
23
+ * @version 6.0.0
24
+ */
25
+ placement?: PlacementCorners;
26
+ /**
27
+ * If true, the Badge will have no padding, making it appear more compact and rounded.
28
+ */
29
+ compact?: boolean;
30
+ /**
31
+ * The shape of the wrapped element
32
+ * @version 6.0.0
33
+ */
34
+ shape?: 'rectangle' | 'circle';
35
+ /**
36
+ * Define the horizontal and vertical offset of the badge relative to its wrapped element
37
+ * @version 6.0.0
38
+ */
39
+ offset?: [number | string, number | string];
40
+ /**
41
+ * The badge will be hidden
42
+ * @version 6.0.0
43
+ */
44
+ invisible?: boolean;
10
45
  }
11
46
  /**
12
47
  * The Badge component is usually used to mark or highlight the status or quantity of an object.
@@ -1,7 +1,9 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import React from 'react';
3
+ import React, { useMemo } from 'react';
4
+ import kebabCase from 'lodash/kebabCase';
4
5
  import { useClassNames } from "../internals/hooks/index.js";
6
+ import { mergeStyles, createOffsetStyles, isPresetColor, createColorVariables } from "../internals/utils/index.js";
5
7
  import { useCustom } from "../CustomProvider/index.js";
6
8
  /**
7
9
  * The Badge component is usually used to mark or highlight the status or quantity of an object.
@@ -13,12 +15,19 @@ const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
13
15
  } = useCustom('Badge', props);
14
16
  const {
15
17
  as: Component = 'div',
16
- content: contentText,
18
+ content,
17
19
  color,
18
20
  className,
19
21
  classPrefix = 'badge',
20
22
  children,
23
+ compact,
21
24
  maxCount = 99,
25
+ offset,
26
+ outline = true,
27
+ placement = 'topEnd',
28
+ shape,
29
+ style,
30
+ invisible,
22
31
  ...rest
23
32
  } = propsWithDefaults;
24
33
  const {
@@ -26,30 +35,30 @@ const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
26
35
  prefix,
27
36
  merge
28
37
  } = useClassNames(classPrefix);
29
- const dot = contentText === undefined || contentText === null;
30
- const classes = merge(className, withClassPrefix(color, {
31
- independent: !children,
38
+ const text = typeof content === 'number' && content > maxCount ? `${maxCount}+` : content;
39
+ const classes = merge(className, withClassPrefix(isPresetColor(color) && color, shape, {
40
+ compact,
41
+ outline,
42
+ hidden: invisible,
32
43
  wrapper: children,
33
- dot
44
+ independent: !children,
45
+ [kebabCase(placement)]: children
34
46
  }));
35
- if (contentText === false) {
36
- return /*#__PURE__*/React.cloneElement(children, {
37
- ref
38
- });
39
- }
40
- const content = typeof contentText === 'number' && contentText > maxCount ? `${maxCount}+` : contentText;
47
+ const styles = useMemo(() => mergeStyles(style, createOffsetStyles(offset, '--rs-badge-offset'), createColorVariables(color, '--rs-badge-bg')), [style, offset, color]);
41
48
  if (!children) {
42
- return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
49
+ return /*#__PURE__*/React.createElement(Component, _extends({
43
50
  ref: ref,
44
- className: classes
45
- }), content);
51
+ className: classes,
52
+ style: styles
53
+ }, rest), text);
46
54
  }
47
- return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
55
+ return /*#__PURE__*/React.createElement(Component, _extends({
48
56
  ref: ref,
49
- className: classes
50
- }), children, /*#__PURE__*/React.createElement("div", {
57
+ className: classes,
58
+ style: styles
59
+ }, rest), children, /*#__PURE__*/React.createElement("div", {
51
60
  className: prefix('content')
52
- }, content));
61
+ }, text));
53
62
  });
54
63
  Badge.displayName = 'Badge';
55
64
  export default Badge;
@@ -15,7 +15,7 @@ const Separator = createComponent({
15
15
  * The Breadcrumb component is used to indicate the current page location and navigate.
16
16
  * @see https://rsuitejs.com/components/breadcrumb
17
17
  */
18
- const Breadcrumb = /*#__PURE__*/React.forwardRef((props, ref) => {
18
+ const Breadcrumb = /*#__PURE__*/React.forwardRef(function Breadcrumb(props, ref) {
19
19
  const {
20
20
  propsWithDefaults
21
21
  } = useCustom('Breadcrumb', props);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
- export interface ButtonProps extends WithAsProps, React.HTMLAttributes<HTMLElement> {
3
+ export interface ButtonProps extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle'> {
4
4
  /** A button can have different appearances. */
5
5
  appearance?: TypeAttributes.Appearance;
6
6
  /** A button can show it is currently the active user selection */
@@ -27,6 +27,10 @@ export interface ButtonProps extends WithAsProps, React.HTMLAttributes<HTMLEleme
27
27
  endIcon?: React.ReactNode;
28
28
  /** Defines HTML button type attribute */
29
29
  type?: 'button' | 'reset' | 'submit';
30
+ /** A button can toggle its state between active and inactive. */
31
+ toggleable?: boolean;
32
+ /** Called when the button is clicked */
33
+ onToggle?: (active: boolean, event: React.MouseEvent) => void;
30
34
  }
31
35
  /**
32
36
  * The Button component is used to trigger a custom action.
@@ -5,7 +5,7 @@ import Ripple from "../internals/Ripple/index.js";
5
5
  import SafeAnchor from "../SafeAnchor/index.js";
6
6
  import { ButtonGroupContext } from "../ButtonGroup/index.js";
7
7
  import { isOneOf } from "../internals/utils/index.js";
8
- import { useClassNames } from "../internals/hooks/index.js";
8
+ import { useClassNames, useControlled, useEventCallback } from "../internals/hooks/index.js";
9
9
  import { useCustom } from "../CustomProvider/index.js";
10
10
  /**
11
11
  * The Button component is used to trigger a custom action.
@@ -17,7 +17,7 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
17
17
  } = useCustom('Button', props);
18
18
  const {
19
19
  as,
20
- active,
20
+ active: activeProp,
21
21
  appearance = 'default',
22
22
  block,
23
23
  className,
@@ -31,8 +31,12 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
31
31
  startIcon,
32
32
  endIcon,
33
33
  type: typeProp,
34
+ toggleable,
35
+ onToggle,
36
+ onClick,
34
37
  ...rest
35
38
  } = propsWithDefaults;
39
+ const [active, setActive] = useControlled(activeProp, false);
36
40
  const buttonGroup = useContext(ButtonGroupContext);
37
41
  const size = sizeProp !== null && sizeProp !== void 0 ? sizeProp : buttonGroup === null || buttonGroup === void 0 ? void 0 : buttonGroup.size;
38
42
  const {
@@ -57,13 +61,22 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
57
61
  className: prefix`end-icon`
58
62
  }, endIcon) : null, rippleElement);
59
63
  }, [appearance, children, endIcon, loading, prefix, ripple, startIcon]);
64
+ const handleClick = useEventCallback(event => {
65
+ if (toggleable) {
66
+ const nextActive = !active;
67
+ setActive(nextActive);
68
+ onToggle === null || onToggle === void 0 || onToggle(nextActive, event);
69
+ }
70
+ onClick === null || onClick === void 0 || onClick(event);
71
+ });
60
72
  if (rest.href) {
61
73
  return /*#__PURE__*/React.createElement(SafeAnchor, _extends({}, rest, {
62
74
  as: as,
63
75
  ref: ref,
64
76
  "aria-disabled": disabled,
65
77
  disabled: disabled,
66
- className: classes
78
+ className: classes,
79
+ onClick: handleClick
67
80
  }), buttonContent);
68
81
  }
69
82
  const Component = as || 'button';
@@ -75,7 +88,8 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
75
88
  ref: ref,
76
89
  disabled: disabled,
77
90
  "aria-disabled": disabled,
78
- className: classes
91
+ className: classes,
92
+ onClick: handleClick
79
93
  }), buttonContent);
80
94
  });
81
95
  Button.displayName = 'Button';
package/esm/Card/Card.js CHANGED
@@ -6,7 +6,7 @@ import CardBody from "./CardBody.js";
6
6
  import CardFooter from "./CardFooter.js";
7
7
  import { useCustom } from "../CustomProvider/index.js";
8
8
  import { useClassNames } from "../internals/hooks/index.js";
9
- const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
9
+ const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
10
10
  const {
11
11
  propsWithDefaults
12
12
  } = useCustom('Card', props);
@@ -28,7 +28,7 @@ export function getColumnsAndPaths(items, pathTarget, options) {
28
28
  if (children && children.length > 0) {
29
29
  columns.unshift(children);
30
30
  }
31
- for (let parent = getParent(pathTarget); !!parent; parent = getParent(parent)) {
31
+ for (let parent = getParent(pathTarget); parent; parent = getParent(parent)) {
32
32
  var _getChildren;
33
33
  columns.unshift((_getChildren = getChildren(parent)) !== null && _getChildren !== void 0 ? _getChildren : []);
34
34
  path.unshift(parent);
@@ -143,7 +143,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
143
143
  formattedDayPattern: string;
144
144
  shortDateFormat: string;
145
145
  shortTimeFormat: string;
146
- dateLocale: any;
146
+ dateLocale: any; /**
147
+ * The prefix of the component CSS class
148
+ */
147
149
  } | undefined;
148
150
  Calendar?: {
149
151
  sunday: string;
@@ -164,7 +166,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
164
166
  formattedDayPattern: string;
165
167
  shortDateFormat: string;
166
168
  shortTimeFormat: string;
167
- dateLocale: any;
169
+ dateLocale: any; /**
170
+ * The prefix of the component CSS class
171
+ */
168
172
  } | undefined;
169
173
  DatePicker?: {
170
174
  sunday: string;
@@ -185,7 +189,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
185
189
  formattedDayPattern: string;
186
190
  shortDateFormat: string;
187
191
  shortTimeFormat: string;
188
- dateLocale: any;
192
+ dateLocale: any; /**
193
+ * The prefix of the component CSS class
194
+ */
189
195
  } | undefined;
190
196
  DateRangePicker?: {
191
197
  last7Days: string;
@@ -207,7 +213,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
207
213
  formattedDayPattern: string;
208
214
  shortDateFormat: string;
209
215
  shortTimeFormat: string;
210
- dateLocale: any;
216
+ dateLocale: any; /**
217
+ * The prefix of the component CSS class
218
+ */
211
219
  } | undefined;
212
220
  Combobox?: {
213
221
  noResultsText: string;
@@ -4,7 +4,7 @@ import IconProvider from '@rsuite/icons/IconProvider';
4
4
  import { usePortal, useIsomorphicLayoutEffect } from "../internals/hooks/index.js";
5
5
  import { getClassNamePrefix, prefix } from "../internals/utils/prefix.js";
6
6
  import { addClass, removeClass, canUseDOM } from "../DOMHelper/index.js";
7
- import ToastContainer, { toastPlacements } from "../toaster/ToastContainer.js";
7
+ import ToastContainer, { toastPlacements, defaultToasterContainer } from "../toaster/ToastContainer.js";
8
8
  export const CustomContext = /*#__PURE__*/React.createContext({});
9
9
  const themes = ['light', 'dark', 'high-contrast'];
10
10
 
@@ -20,7 +20,7 @@ export default function CustomProvider(props) {
20
20
  components,
21
21
  iconClassPrefix = classPrefix,
22
22
  theme,
23
- toastContainer: container,
23
+ toastContainer = defaultToasterContainer,
24
24
  disableRipple,
25
25
  csp,
26
26
  disableInlineStyles,
@@ -30,7 +30,7 @@ export default function CustomProvider(props) {
30
30
  const {
31
31
  Portal
32
32
  } = usePortal({
33
- container,
33
+ container: toastContainer,
34
34
  waitMount: true
35
35
  });
36
36
  const value = useMemo(() => ({
@@ -39,8 +39,9 @@ export default function CustomProvider(props) {
39
39
  toasters,
40
40
  disableRipple,
41
41
  components,
42
+ toastContainer,
42
43
  ...rest
43
- }), [classPrefix, theme, disableRipple, components, rest]);
44
+ }), [classPrefix, theme, disableRipple, components, toastContainer, rest]);
44
45
  const iconContext = useMemo(() => ({
45
46
  classPrefix: iconClassPrefix,
46
47
  csp,
@@ -41,15 +41,17 @@ export function useDateInputState(_ref) {
41
41
  value = addMonths(new Date(year, month), offset).getMonth() + 1;
42
42
  break;
43
43
  case 'd':
44
- actionName = 'setDay';
45
- const prevDate = new Date(year, month, day);
46
- value = addDays(prevDate, offset).getDate();
47
- if (offset > 0) {
48
- value = isLastDayOfMonth(prevDate) ? 1 : value;
49
- } else {
50
- value = prevDate.getDate() === 1 ? lastDayOfMonth(prevDate).getDate() : value;
44
+ {
45
+ actionName = 'setDay';
46
+ const prevDate = new Date(year, month, day);
47
+ value = addDays(prevDate, offset).getDate();
48
+ if (offset > 0) {
49
+ value = isLastDayOfMonth(prevDate) ? 1 : value;
50
+ } else {
51
+ value = prevDate.getDate() === 1 ? lastDayOfMonth(prevDate).getDate() : value;
52
+ }
53
+ break;
51
54
  }
52
- break;
53
55
  case 'H':
54
56
  case 'h':
55
57
  actionName = 'setHour';
@@ -29,6 +29,7 @@ export function useKeyboardInputEvent(_ref) {
29
29
  // Allow numeric keys to be entered
30
30
  onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0 || onSegmentValueChangeWithNumericKeys(event);
31
31
  event.preventDefault();
32
+ break;
32
33
  case (_key$match2 = key.match(/[a-z]/)) === null || _key$match2 === void 0 ? void 0 : _key$match2[0]:
33
34
  // Determine whether the Ctrl or Command key is pressed, does not affect user copy and paste
34
35
  if (event.ctrlKey || event.metaKey) {
@@ -5,7 +5,7 @@ import Button from "../Button/index.js";
5
5
  import Stack from "../Stack/index.js";
6
6
  import { useUpdateEffect } from "../internals/hooks/index.js";
7
7
  import { getDefaultRanges, getRanges } from "./utils.js";
8
- const PredefinedRanges = /*#__PURE__*/React.forwardRef((props, ref) => {
8
+ const PredefinedRanges = /*#__PURE__*/React.forwardRef(function PredefinedRanges(props, ref) {
9
9
  const {
10
10
  className,
11
11
  disableShortcut,
@@ -28,7 +28,7 @@ import { useCustom } from "../CustomProvider/index.js";
28
28
  *
29
29
  * @see https://rsuitejs.com/components/date-range-picker
30
30
  */
31
- const DateRangePicker = /*#__PURE__*/React.forwardRef((props, ref) => {
31
+ const DateRangePicker = /*#__PURE__*/React.forwardRef(function DateRangePicker(props, ref) {
32
32
  var _ref, _ref2;
33
33
  const {
34
34
  formatDate,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ModalProps } from '../Modal';
3
- import { TypeAttributes } from '../internals/types';
3
+ import { PlacementCardinal } from '../internals/types';
4
4
  import DrawerBody from './DrawerBody';
5
5
  import DrawerHeader from './DrawerHeader';
6
6
  import DrawerActions from './DrawerActions';
@@ -8,7 +8,7 @@ import DrawerFooter from './DrawerFooter';
8
8
  import DrawerTitle from './DrawerTitle';
9
9
  export interface DrawerProps extends Omit<ModalProps, 'overflow'> {
10
10
  /** The placement of Drawer */
11
- placement?: TypeAttributes.Placement4;
11
+ placement?: PlacementCardinal;
12
12
  /** Custom close button */
13
13
  closeButton?: React.ReactNode | boolean;
14
14
  }
@@ -15,7 +15,7 @@ import DrawerTitle from "./DrawerTitle.js";
15
15
  * The Drawer component is used to display extra content from a main content.
16
16
  * @see https://rsuitejs.com/components/drawer
17
17
  */
18
- const Drawer = /*#__PURE__*/React.forwardRef((props, ref) => {
18
+ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
19
19
  const {
20
20
  propsWithDefaults
21
21
  } = useCustom('Drawer', props);
@@ -2,9 +2,11 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import ModalBody from "../Modal/ModalBody.js";
5
- const DrawerBody = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(ModalBody, _extends({
6
- classPrefix: "drawer-body"
7
- }, props, {
8
- ref: ref
9
- })));
5
+ const DrawerBody = /*#__PURE__*/React.forwardRef(function DrawerBody(props, ref) {
6
+ return /*#__PURE__*/React.createElement(ModalBody, _extends({
7
+ classPrefix: "drawer-body"
8
+ }, props, {
9
+ ref: ref
10
+ }));
11
+ });
10
12
  export default DrawerBody;
@@ -2,9 +2,11 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import ModalFooter from "../Modal/ModalFooter.js";
5
- const DrawerFooter = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(ModalFooter, _extends({
6
- classPrefix: "drawer-footer"
7
- }, props, {
8
- ref: ref
9
- })));
5
+ const DrawerFooter = /*#__PURE__*/React.forwardRef(function DrawerFooter(props, ref) {
6
+ return /*#__PURE__*/React.createElement(ModalFooter, _extends({
7
+ classPrefix: "drawer-footer"
8
+ }, props, {
9
+ ref: ref
10
+ }));
11
+ });
10
12
  export default DrawerFooter;
@@ -2,9 +2,11 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import ModalHeader from "../Modal/ModalHeader.js";
5
- const DrawerHeader = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(ModalHeader, _extends({
6
- classPrefix: "drawer-header"
7
- }, props, {
8
- ref: ref
9
- })));
5
+ const DrawerHeader = /*#__PURE__*/React.forwardRef(function DrawerHeader(props, ref) {
6
+ return /*#__PURE__*/React.createElement(ModalHeader, _extends({
7
+ classPrefix: "drawer-header"
8
+ }, props, {
9
+ ref: ref
10
+ }));
11
+ });
10
12
  export default DrawerHeader;
@@ -2,9 +2,11 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import ModalTitle from "../Modal/ModalTitle.js";
5
- const DrawerTitle = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(ModalTitle, _extends({
6
- classPrefix: "drawer-title"
7
- }, props, {
8
- ref: ref
9
- })));
5
+ const DrawerTitle = /*#__PURE__*/React.forwardRef(function DrawerTitle(props, ref) {
6
+ return /*#__PURE__*/React.createElement(ModalTitle, _extends({
7
+ classPrefix: "drawer-title"
8
+ }, props, {
9
+ ref: ref
10
+ }));
11
+ });
10
12
  export default DrawerTitle;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import DropdownMenu from './DropdownMenu';
3
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
4
4
  import { IconProps } from '@rsuite/icons/Icon';
5
5
  import DropdownItem from './DropdownItem';
6
6
  import Button from '../Button';
@@ -16,7 +16,7 @@ export interface DropdownProps<T = any> extends WithAsProps, Omit<React.HTMLAttr
16
16
  /** Triggering events */
17
17
  trigger?: DropdownTrigger | DropdownTrigger[];
18
18
  /** The placement of Menu */
19
- placement?: TypeAttributes.Placement8;
19
+ placement?: PlacementCorners;
20
20
  /** Whether or not component is disabled */
21
21
  disabled?: boolean;
22
22
  /** The style of the menu */
@@ -24,7 +24,7 @@ import DropdownSeparator from "./DropdownSeparator.js";
24
24
  * - When used inside `<Sidenav>`, renders a `<TreeviewRootItem>`;
25
25
  * - Otherwise renders a `<MenuRoot>`
26
26
  */
27
- const Dropdown = /*#__PURE__*/React.forwardRef((props, ref) => {
27
+ const Dropdown = /*#__PURE__*/React.forwardRef(function Dropdown(props, ref) {
28
28
  const {
29
29
  propsWithDefaults
30
30
  } = useCustom('Dropdown', props);
@@ -1,7 +1,7 @@
1
1
  import React, { Dispatch } from 'react';
2
2
  import { DropdownAction } from './DropdownState';
3
3
  export interface DropdownContextProps {
4
- activeKey?: string;
4
+ activeKey?: string | number;
5
5
  onSelect?: (eventKey: string | undefined, event: React.SyntheticEvent) => void;
6
6
  hasSelectedItem?: boolean;
7
7
  dispatch?: Dispatch<DropdownAction>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { StandardProps } from '../internals/types';
3
3
  import type { IconProps } from '@rsuite/icons/Icon';
4
- export interface DropdownMenuProps<T = string> extends StandardProps {
4
+ export interface DropdownMenuProps<T = string | number> extends StandardProps {
5
5
  /** Define the title as a submenu */
6
6
  title?: React.ReactNode;
7
7
  /** The submenu expands from the left and defaults to the right */
@@ -40,5 +40,5 @@ export interface DropdownMenuProps<T = string> extends StandardProps {
40
40
  * </Dropdown.Menu>
41
41
  * </Dropdown>
42
42
  */
43
- declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps<string> & Omit<React.HTMLAttributes<HTMLUListElement>, "title" | "onSelect"> & React.RefAttributes<HTMLElement>>;
43
+ declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps<string | number> & Omit<React.HTMLAttributes<HTMLUListElement>, "title" | "onSelect"> & React.RefAttributes<HTMLElement>>;
44
44
  export default DropdownMenu;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import Button from '../Button';
3
3
  import { IconProps } from '@rsuite/icons/Icon';
4
- import { WithAsProps, RsRefForwardingComponent, TypeAttributes } from '../internals/types';
4
+ import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
5
5
  export interface DropdownToggleProps extends WithAsProps {
6
6
  icon?: React.ReactElement<IconProps>;
7
7
  noCaret?: boolean;
8
8
  renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
9
- placement?: TypeAttributes.Placement8;
9
+ placement?: PlacementCorners;
10
10
  }
11
11
  declare const DropdownToggle: RsRefForwardingComponent<typeof Button, DropdownToggleProps>;
12
12
  export default DropdownToggle;
@@ -8,7 +8,7 @@ import { useCustom } from "../CustomProvider/index.js";
8
8
  * The FlexboxGrid component is a box that can be used to layout other components.
9
9
  * @see https://rsuitejs.com/components/flexbox-grid
10
10
  */
11
- const FlexboxGrid = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const FlexboxGrid = /*#__PURE__*/React.forwardRef(function FlexboxGrid(props, ref) {
12
12
  const {
13
13
  propsWithDefaults
14
14
  } = useCustom('FlexboxGrid', props);
package/esm/Form/Form.js CHANGED
@@ -21,7 +21,7 @@ const defaultSchema = SchemaModel({});
21
21
  * The `Form` component is a form interface for collecting and validating user input.
22
22
  * @see https://rsuitejs.com/components/form
23
23
  */
24
- const Form = /*#__PURE__*/React.forwardRef((props, ref) => {
24
+ const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
25
25
  const {
26
26
  propsWithDefaults
27
27
  } = useCustom('Form', props);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { CheckType } from 'schema-typed';
3
3
  import Input from '../Input';
4
- import { TypeAttributes, FormControlBaseProps, WithAsProps } from '../internals/types';
4
+ import { TypeAttributes, PlacementCorners, FormControlBaseProps, WithAsProps } from '../internals/types';
5
5
  /**
6
6
  * Props that FormControl passes to its accepter
7
7
  */
@@ -30,7 +30,7 @@ export interface FormControlProps<P = any, ValueType = any> extends WithAsProps,
30
30
  /** Show error messages */
31
31
  errorMessage?: React.ReactNode;
32
32
  /** The placement of error messages */
33
- errorPlacement?: TypeAttributes.Placement8;
33
+ errorPlacement?: PlacementCorners;
34
34
  /** Make the control readonly */
35
35
  readOnly?: boolean;
36
36
  /** Render the control as plain text */
@@ -1,9 +1,9 @@
1
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
1
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
2
2
  export interface FormErrorMessageProps extends WithAsProps {
3
3
  /** Show error messages */
4
4
  show?: boolean;
5
5
  /** The placement of error messages */
6
- placement?: TypeAttributes.Placement8;
6
+ placement?: PlacementCorners;
7
7
  }
8
8
  /**
9
9
  * The `<Form.ErrorMessage>` component is used to display error messages in the form.