@salt-ds/lab 1.0.0-alpha.70 → 1.0.0-alpha.71

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 (280) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/css/salt-lab.css +192 -302
  3. package/dist-cjs/app-header/AppHeader.css.js +1 -1
  4. package/dist-cjs/calendar/CalendarWeekHeader.css.js +1 -1
  5. package/dist-cjs/calendar/internal/CalendarDay.css.js +1 -1
  6. package/dist-cjs/calendar/internal/CalendarMonth.css.js +1 -1
  7. package/dist-cjs/cascading-menu/CascadingMenuItem.css.js +1 -1
  8. package/dist-cjs/color-chooser/ColorChooser.css.js +1 -1
  9. package/dist-cjs/color-chooser/ColorPicker.css.js +1 -1
  10. package/dist-cjs/color-chooser/HexInput.css.js +1 -1
  11. package/dist-cjs/color-chooser/RGBAInput.css.js +1 -1
  12. package/dist-cjs/color-chooser/Swatch.css.js +1 -1
  13. package/dist-cjs/combo-box/useCombobox.js.map +1 -1
  14. package/dist-cjs/common-hooks/selectionTypes.js.map +1 -1
  15. package/dist-cjs/common-hooks/useCollapsibleGroups.js.map +1 -1
  16. package/dist-cjs/common-hooks/useKeyboardNavigation.js.map +1 -1
  17. package/dist-cjs/common-hooks/useKeyboardNavigationPanel.js.map +1 -1
  18. package/dist-cjs/date-input/DateInput.css.js +1 -1
  19. package/dist-cjs/date-picker/DatePickerOverlay.css.js +1 -1
  20. package/dist-cjs/date-picker/DatePickerPanel.css.js +1 -1
  21. package/dist-cjs/form-field-legacy/FormFieldLegacy.css.js +1 -1
  22. package/dist-cjs/form-field-legacy/FormLabel.css.js +1 -1
  23. package/dist-cjs/index.js +0 -8
  24. package/dist-cjs/index.js.map +1 -1
  25. package/dist-cjs/input-legacy/InputLegacy.css.js +1 -1
  26. package/dist-cjs/list/List.css.js +1 -1
  27. package/dist-cjs/list/ListItem.css.js +1 -1
  28. package/dist-cjs/list/useList.js.map +1 -1
  29. package/dist-cjs/list-deprecated/List.css.js +1 -1
  30. package/dist-cjs/list-deprecated/ListItem.css.js +1 -1
  31. package/dist-cjs/list-next/ListItemNext.css.js +1 -1
  32. package/dist-cjs/list-next/ListNext.css.js +1 -1
  33. package/dist-cjs/logo/LogoSeparator.css.js +1 -1
  34. package/dist-cjs/number-input/NumberInput.css.js +1 -1
  35. package/dist-cjs/number-input/NumberInput.js +146 -79
  36. package/dist-cjs/number-input/NumberInput.js.map +1 -1
  37. package/dist-cjs/number-input/internal/useCaret.js +34 -0
  38. package/dist-cjs/number-input/internal/useCaret.js.map +1 -0
  39. package/dist-cjs/number-input/internal/utils.js +56 -14
  40. package/dist-cjs/number-input/internal/utils.js.map +1 -1
  41. package/dist-cjs/number-input/useNumberInput.js +34 -26
  42. package/dist-cjs/number-input/useNumberInput.js.map +1 -1
  43. package/dist-cjs/portal/Portal.js.map +1 -1
  44. package/dist-cjs/query-input/QueryInput.css.js +1 -1
  45. package/dist-cjs/responsive/OverflowReducer.js.map +1 -1
  46. package/dist-cjs/system-status/SystemStatus.css.js +1 -1
  47. package/dist-cjs/tabs/Tabstrip.css.js +1 -1
  48. package/dist-cjs/tabs/drag-drop/Draggable.css.js +1 -1
  49. package/dist-cjs/tabs-next/TabBar.css.js +1 -1
  50. package/dist-cjs/tabs-next/TabNext.css.js +1 -1
  51. package/dist-cjs/tabs-next/TabOverflowList.css.js +1 -1
  52. package/dist-cjs/tokenized-input/TokenizedInput.css.js +1 -1
  53. package/dist-cjs/tokenized-input-next/TokenizedInputNext.css.js +1 -1
  54. package/dist-cjs/toolbar/overflow-panel/OverflowPanel.css.js +1 -1
  55. package/dist-cjs/toolbar/overflow-panel/OverflowSeparator.css.js +1 -1
  56. package/dist-cjs/tree/useTree.js.map +1 -1
  57. package/dist-es/app-header/AppHeader.css.js +1 -1
  58. package/dist-es/calendar/CalendarWeekHeader.css.js +1 -1
  59. package/dist-es/calendar/internal/CalendarDay.css.js +1 -1
  60. package/dist-es/calendar/internal/CalendarMonth.css.js +1 -1
  61. package/dist-es/cascading-menu/CascadingMenuItem.css.js +1 -1
  62. package/dist-es/color-chooser/ColorChooser.css.js +1 -1
  63. package/dist-es/color-chooser/ColorPicker.css.js +1 -1
  64. package/dist-es/color-chooser/HexInput.css.js +1 -1
  65. package/dist-es/color-chooser/RGBAInput.css.js +1 -1
  66. package/dist-es/color-chooser/Swatch.css.js +1 -1
  67. package/dist-es/combo-box/useCombobox.js.map +1 -1
  68. package/dist-es/common-hooks/selectionTypes.js.map +1 -1
  69. package/dist-es/common-hooks/useCollapsibleGroups.js.map +1 -1
  70. package/dist-es/common-hooks/useKeyboardNavigation.js.map +1 -1
  71. package/dist-es/common-hooks/useKeyboardNavigationPanel.js.map +1 -1
  72. package/dist-es/date-input/DateInput.css.js +1 -1
  73. package/dist-es/date-picker/DatePickerOverlay.css.js +1 -1
  74. package/dist-es/date-picker/DatePickerPanel.css.js +1 -1
  75. package/dist-es/form-field-legacy/FormFieldLegacy.css.js +1 -1
  76. package/dist-es/form-field-legacy/FormLabel.css.js +1 -1
  77. package/dist-es/index.js +0 -4
  78. package/dist-es/index.js.map +1 -1
  79. package/dist-es/input-legacy/InputLegacy.css.js +1 -1
  80. package/dist-es/list/List.css.js +1 -1
  81. package/dist-es/list/ListItem.css.js +1 -1
  82. package/dist-es/list/useList.js.map +1 -1
  83. package/dist-es/list-deprecated/List.css.js +1 -1
  84. package/dist-es/list-deprecated/ListItem.css.js +1 -1
  85. package/dist-es/list-next/ListItemNext.css.js +1 -1
  86. package/dist-es/list-next/ListNext.css.js +1 -1
  87. package/dist-es/logo/LogoSeparator.css.js +1 -1
  88. package/dist-es/number-input/NumberInput.css.js +1 -1
  89. package/dist-es/number-input/NumberInput.js +149 -82
  90. package/dist-es/number-input/NumberInput.js.map +1 -1
  91. package/dist-es/number-input/internal/useCaret.js +32 -0
  92. package/dist-es/number-input/internal/useCaret.js.map +1 -0
  93. package/dist-es/number-input/internal/utils.js +52 -10
  94. package/dist-es/number-input/internal/utils.js.map +1 -1
  95. package/dist-es/number-input/useNumberInput.js +35 -27
  96. package/dist-es/number-input/useNumberInput.js.map +1 -1
  97. package/dist-es/portal/Portal.js.map +1 -1
  98. package/dist-es/query-input/QueryInput.css.js +1 -1
  99. package/dist-es/responsive/OverflowReducer.js.map +1 -1
  100. package/dist-es/system-status/SystemStatus.css.js +1 -1
  101. package/dist-es/tabs/Tabstrip.css.js +1 -1
  102. package/dist-es/tabs/drag-drop/Draggable.css.js +1 -1
  103. package/dist-es/tabs-next/TabBar.css.js +1 -1
  104. package/dist-es/tabs-next/TabNext.css.js +1 -1
  105. package/dist-es/tabs-next/TabOverflowList.css.js +1 -1
  106. package/dist-es/tokenized-input/TokenizedInput.css.js +1 -1
  107. package/dist-es/tokenized-input-next/TokenizedInputNext.css.js +1 -1
  108. package/dist-es/toolbar/overflow-panel/OverflowPanel.css.js +1 -1
  109. package/dist-es/toolbar/overflow-panel/OverflowSeparator.css.js +1 -1
  110. package/dist-es/tree/useTree.js.map +1 -1
  111. package/dist-types/app-header/AppHeader.d.ts +1 -1
  112. package/dist-types/button-bar/ButtonBar.d.ts +3 -3
  113. package/dist-types/calendar/Calendar.d.ts +1 -1
  114. package/dist-types/calendar/CalendarWeekHeader.d.ts +1 -1
  115. package/dist-types/calendar/useCalendar.d.ts +1 -1
  116. package/dist-types/calendar/useCalendarDay.d.ts +2 -1
  117. package/dist-types/calendar/useCalendarSelection.d.ts +5 -5
  118. package/dist-types/cascading-menu/internal/CascadingMenuAction.d.ts +2 -2
  119. package/dist-types/cascading-menu/internal/menuPositioning.d.ts +1 -1
  120. package/dist-types/cascading-menu/internal/stateUtils.d.ts +2 -2
  121. package/dist-types/cascading-menu/internal/useClickAway.d.ts +1 -1
  122. package/dist-types/cascading-menu/internal/useRefsManager.d.ts +1 -1
  123. package/dist-types/cascading-menu/internal/useStateReducer.d.ts +2 -2
  124. package/dist-types/cascading-menu/stateChangeTypes.d.ts +1 -1
  125. package/dist-types/color-chooser/Color.d.ts +1 -1
  126. package/dist-types/color-chooser/DictTabs.d.ts +1 -1
  127. package/dist-types/color-chooser/color-utils.d.ts +1 -1
  128. package/dist-types/combo-box/ComboBox.d.ts +3 -3
  129. package/dist-types/combo-box/useCombobox.d.ts +1 -1
  130. package/dist-types/combo-box-deprecated/ComboBoxDeprecated.d.ts +3 -3
  131. package/dist-types/combo-box-deprecated/filterHelpers.d.ts +1 -1
  132. package/dist-types/combo-box-deprecated/internal/DefaultComboBox.d.ts +1 -1
  133. package/dist-types/combo-box-deprecated/internal/MultiSelectComboBox.d.ts +1 -1
  134. package/dist-types/combo-box-deprecated/internal/useComboBox.d.ts +98 -97
  135. package/dist-types/combo-box-deprecated/internal/useMultiSelectComboBox.d.ts +214 -212
  136. package/dist-types/combo-box-deprecated/internal/usePopperStatus.d.ts +3 -3
  137. package/dist-types/common-hooks/collectionTypes.d.ts +3 -3
  138. package/dist-types/common-hooks/itemToString.d.ts +1 -1
  139. package/dist-types/common-hooks/navigationTypes.d.ts +4 -4
  140. package/dist-types/common-hooks/selectionTypes.d.ts +10 -10
  141. package/dist-types/common-hooks/useKeyboardNavigation.d.ts +1 -1
  142. package/dist-types/common-hooks/useSelection.d.ts +2 -2
  143. package/dist-types/common-hooks/utils/collection-item-utils.d.ts +2 -2
  144. package/dist-types/common-hooks/utils/filter-utils.d.ts +2 -2
  145. package/dist-types/contact-details/ContactAction.d.ts +1 -1
  146. package/dist-types/contact-details/ContactAvatar.d.ts +1 -1
  147. package/dist-types/contact-details/ContactDetails.d.ts +1 -1
  148. package/dist-types/date-input/DateInputRange.d.ts +2 -2
  149. package/dist-types/date-input/DateInputSingle.d.ts +1 -1
  150. package/dist-types/date-picker/DatePicker.d.ts +1 -1
  151. package/dist-types/date-picker/DatePickerActions.d.ts +1 -1
  152. package/dist-types/date-picker/DatePickerContext.d.ts +1 -1
  153. package/dist-types/date-picker/DatePickerOverlayProvider.d.ts +1 -1
  154. package/dist-types/date-picker/DatePickerRangeGridPanel.d.ts +1 -1
  155. package/dist-types/date-picker/DatePickerSingleGridPanel.d.ts +1 -1
  156. package/dist-types/date-picker/DatePickerSinglePanel.d.ts +1 -1
  157. package/dist-types/date-picker/useDatePicker.d.ts +1 -1
  158. package/dist-types/deck-layout/DeckLayout.d.ts +3 -3
  159. package/dist-types/dropdown/Dropdown.d.ts +3 -3
  160. package/dist-types/dropdown/DropdownBase.d.ts +1 -1
  161. package/dist-types/dropdown/dropdownTypes.d.ts +1 -1
  162. package/dist-types/dropdown/useClickAway.d.ts +1 -1
  163. package/dist-types/dropdown/useDropdown.d.ts +1 -1
  164. package/dist-types/focus-manager/internal/findAllTabbableElements.d.ts +1 -1
  165. package/dist-types/form-field-legacy/FormFieldLegacy.d.ts +5 -5
  166. package/dist-types/form-field-legacy/NecessityIndicator.d.ts +1 -1
  167. package/dist-types/form-field-legacy/StatusIndicator.d.ts +1 -1
  168. package/dist-types/formatted-input/FormattedInput.d.ts +1 -1
  169. package/dist-types/index.d.ts +0 -1
  170. package/dist-types/input-legacy/StaticInputAdornment.d.ts +1 -1
  171. package/dist-types/layer-layout/LayerLayout.d.ts +1 -1
  172. package/dist-types/list/List.d.ts +3 -3
  173. package/dist-types/list/ListItem.d.ts +1 -1
  174. package/dist-types/list/VirtualizedList.d.ts +3 -3
  175. package/dist-types/list/listTypes.d.ts +2 -2
  176. package/dist-types/list/useList.d.ts +1 -1
  177. package/dist-types/list/useVirtualization.d.ts +1 -1
  178. package/dist-types/list-deprecated/List.d.ts +2 -2
  179. package/dist-types/list-deprecated/ListBase.d.ts +2 -2
  180. package/dist-types/list-deprecated/ListItem.d.ts +1 -1
  181. package/dist-types/list-deprecated/ListItemContext.d.ts +1 -1
  182. package/dist-types/list-deprecated/ListProps.d.ts +5 -5
  183. package/dist-types/list-deprecated/itemToString.d.ts +1 -1
  184. package/dist-types/list-deprecated/useListItem.d.ts +2 -2
  185. package/dist-types/localization-provider/LocalizationProvider.d.ts +3 -3
  186. package/dist-types/logo/Logo.d.ts +1 -1
  187. package/dist-types/logo/LogoSeparator.d.ts +1 -1
  188. package/dist-types/number-input/NumberInput.d.ts +49 -27
  189. package/dist-types/number-input/internal/useCaret.d.ts +5 -0
  190. package/dist-types/number-input/internal/useInterval.d.ts +1 -1
  191. package/dist-types/number-input/internal/utils.d.ts +5 -5
  192. package/dist-types/number-input/useNumberInput.d.ts +11 -6
  193. package/dist-types/query-input/useQueryInput.d.ts +1 -1
  194. package/dist-types/responsive/OverflowReducer.d.ts +4 -4
  195. package/dist-types/responsive/overflowTypes.d.ts +20 -20
  196. package/dist-types/responsive/overflowUtils.d.ts +3 -3
  197. package/dist-types/responsive/useOverflowCollectionItems.d.ts +1 -1
  198. package/dist-types/responsive/useOverflowLayout.d.ts +1 -1
  199. package/dist-types/responsive/useResizeObserver.d.ts +2 -2
  200. package/dist-types/responsive/utils.d.ts +3 -3
  201. package/dist-types/tabs/Tab.d.ts +20 -19
  202. package/dist-types/tabs/Tabs.d.ts +1 -1
  203. package/dist-types/tabs/TabsTypes.d.ts +7 -7
  204. package/dist-types/tabs/drag-drop/Draggable.d.ts +2 -2
  205. package/dist-types/tabs/drag-drop/DropIndicator.d.ts +1 -1
  206. package/dist-types/tabs/drag-drop/drag-utils.d.ts +26 -22
  207. package/dist-types/tabs/drag-drop/dragDropTypes.d.ts +5 -5
  208. package/dist-types/tabs/drag-drop/useDragSpacers.d.ts +1 -1
  209. package/dist-types/tabs/useActivationIndicator.d.ts +1 -1
  210. package/dist-types/tabs/useEditableItem.d.ts +1 -1
  211. package/dist-types/tabs/useKeyboardNavigation.d.ts +1 -1
  212. package/dist-types/tabs/useSelection.d.ts +3 -3
  213. package/dist-types/tabs-next/hooks/useCollection.d.ts +1 -1
  214. package/dist-types/tokenized-input/TokenizedInput.d.ts +2 -2
  215. package/dist-types/tokenized-input/TokenizedInputBase.d.ts +5 -5
  216. package/dist-types/tokenized-input/internal/InputPill.d.ts +1 -1
  217. package/dist-types/tokenized-input/internal/isPlainObject.d.ts +1 -1
  218. package/dist-types/tokenized-input/useTokenizedInput.d.ts +1 -1
  219. package/dist-types/tokenized-input-next/TokenizedInputNext.d.ts +2 -2
  220. package/dist-types/tokenized-input-next/internal/InputPill.d.ts +1 -1
  221. package/dist-types/toolbar/ToolbarButton.d.ts +3 -3
  222. package/dist-types/toolbar/ToolbarProps.d.ts +1 -1
  223. package/dist-types/toolbar/TooltrayProps.d.ts +2 -2
  224. package/dist-types/toolbar/internal/ToolbarButtonRefsContext.d.ts +1 -1
  225. package/dist-types/toolbar/internal/renderTrayTools.d.ts +1 -1
  226. package/dist-types/tree/useTree.d.ts +1 -1
  227. package/dist-types/utils/forwardCallbackProps.d.ts +1 -1
  228. package/dist-types/utils/isEmail.d.ts +1 -1
  229. package/dist-types/utils/useClickOutside.d.ts +1 -1
  230. package/dist-types/utils/useSlideSelection.d.ts +1 -1
  231. package/dist-types/window/ElectronWindow.d.ts +1 -1
  232. package/dist-types/window/WindowContext.d.ts +4 -4
  233. package/package.json +2 -2
  234. package/dist-cjs/carousel/Carousel.css.js +0 -6
  235. package/dist-cjs/carousel/Carousel.css.js.map +0 -1
  236. package/dist-cjs/carousel/Carousel.js +0 -62
  237. package/dist-cjs/carousel/Carousel.js.map +0 -1
  238. package/dist-cjs/carousel/CarouselContext.js +0 -62
  239. package/dist-cjs/carousel/CarouselContext.js.map +0 -1
  240. package/dist-cjs/carousel/CarouselControls.css.js +0 -6
  241. package/dist-cjs/carousel/CarouselControls.css.js.map +0 -1
  242. package/dist-cjs/carousel/CarouselControls.js +0 -122
  243. package/dist-cjs/carousel/CarouselControls.js.map +0 -1
  244. package/dist-cjs/carousel/CarouselReducer.js +0 -77
  245. package/dist-cjs/carousel/CarouselReducer.js.map +0 -1
  246. package/dist-cjs/carousel/CarouselSlide.css.js +0 -6
  247. package/dist-cjs/carousel/CarouselSlide.css.js.map +0 -1
  248. package/dist-cjs/carousel/CarouselSlide.js +0 -110
  249. package/dist-cjs/carousel/CarouselSlide.js.map +0 -1
  250. package/dist-cjs/carousel/CarouselSlider.css.js +0 -6
  251. package/dist-cjs/carousel/CarouselSlider.css.js.map +0 -1
  252. package/dist-cjs/carousel/CarouselSlider.js +0 -93
  253. package/dist-cjs/carousel/CarouselSlider.js.map +0 -1
  254. package/dist-es/carousel/Carousel.css.js +0 -4
  255. package/dist-es/carousel/Carousel.css.js.map +0 -1
  256. package/dist-es/carousel/Carousel.js +0 -60
  257. package/dist-es/carousel/Carousel.js.map +0 -1
  258. package/dist-es/carousel/CarouselContext.js +0 -58
  259. package/dist-es/carousel/CarouselContext.js.map +0 -1
  260. package/dist-es/carousel/CarouselControls.css.js +0 -4
  261. package/dist-es/carousel/CarouselControls.css.js.map +0 -1
  262. package/dist-es/carousel/CarouselControls.js +0 -120
  263. package/dist-es/carousel/CarouselControls.js.map +0 -1
  264. package/dist-es/carousel/CarouselReducer.js +0 -75
  265. package/dist-es/carousel/CarouselReducer.js.map +0 -1
  266. package/dist-es/carousel/CarouselSlide.css.js +0 -4
  267. package/dist-es/carousel/CarouselSlide.css.js.map +0 -1
  268. package/dist-es/carousel/CarouselSlide.js +0 -108
  269. package/dist-es/carousel/CarouselSlide.js.map +0 -1
  270. package/dist-es/carousel/CarouselSlider.css.js +0 -4
  271. package/dist-es/carousel/CarouselSlider.css.js.map +0 -1
  272. package/dist-es/carousel/CarouselSlider.js +0 -91
  273. package/dist-es/carousel/CarouselSlider.js.map +0 -1
  274. package/dist-types/carousel/Carousel.d.ts +0 -23
  275. package/dist-types/carousel/CarouselContext.d.ts +0 -11
  276. package/dist-types/carousel/CarouselControls.d.ts +0 -26
  277. package/dist-types/carousel/CarouselReducer.d.ts +0 -30
  278. package/dist-types/carousel/CarouselSlide.d.ts +0 -32
  279. package/dist-types/carousel/CarouselSlider.d.ts +0 -13
  280. package/dist-types/carousel/index.d.ts +0 -4
@@ -2,33 +2,40 @@ import { type ValidationStatus } from "@salt-ds/core";
2
2
  import { type ComponentPropsWithoutRef, type InputHTMLAttributes, type ReactNode, type Ref, type SyntheticEvent } from "react";
3
3
  export interface NumberInputProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
4
4
  /**
5
- * A boolean. When `true`, the input will receive a full border.
5
+ * Styling variant with full border.
6
+ * @default false
6
7
  */
7
8
  bordered?: boolean;
8
9
  /**
9
- * The number of decimal places to display.
10
+ * A boolean that, when true, ensures the input value is clamped within the specified min and max range upon losing focus.
11
+ * @default false
10
12
  */
11
- decimalPlaces?: number;
13
+ clamp?: boolean;
12
14
  /**
13
- * Sets the initial default value of the component.
15
+ * The default value. Use when the component is uncontrolled.
14
16
  */
15
17
  defaultValue?: number | string;
16
18
  /**
17
- * If `true`, the number input will be disabled.
19
+ * Disable the `NumberInput`.
20
+ * @default false
18
21
  */
19
22
  disabled?: boolean;
20
23
  /**
21
24
  * The marker to use in an empty read only Input.
22
- * Use `''` to disable this feature. Defaults to '—'.
23
- * @default ''
25
+ * Use `''` to disable this feature.
26
+ * @default ""
24
27
  */
25
28
  emptyReadOnlyMarker?: string;
26
29
  /**
27
- * End adornment component
30
+ * End adornment component.
28
31
  */
29
32
  endAdornment?: ReactNode;
30
33
  /**
31
- * Whether to hide the number buttons. Defaults to `false`.
34
+ * A callback to format the value of the `NumberInput`.
35
+ */
36
+ format?: (value: number | string) => string | number;
37
+ /**
38
+ * Hide the number buttons.
32
39
  * @default false
33
40
  */
34
41
  hideButtons?: boolean;
@@ -37,49 +44,64 @@ export interface NumberInputProps extends Omit<ComponentPropsWithoutRef<"div">,
37
44
  */
38
45
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
39
46
  /**
40
- * Optional ref for the input component
47
+ * Optional ref for the input component.
41
48
  */
42
49
  inputRef?: Ref<HTMLInputElement>;
43
50
  /**
44
- * The maximum value that can be selected. Defaults to Number.MAX_SAFE_INTEGER.
51
+ * The maximum value that can be selected.
45
52
  * @default Number.MAX_SAFE_INTEGER
46
53
  */
47
54
  max?: number;
48
55
  /**
49
- * The minimum value that can be selected. Defaults to Number.MIN_SAFE_INTEGER.
56
+ * The minimum value that can be selected.
50
57
  * @default Number.MIN_SAFE_INTEGER
51
58
  */
52
59
  min?: number;
53
60
  /**
54
- * Callback when number input value is changed.
55
- * @param event - the event triggers value change, could be undefined during increment / decrement button long press
61
+ * Callback function that is triggered when the value of the `NumberInput` changes.
62
+ *
63
+ * @param event - The event that triggers the value change. This may be `undefined` during a long press on the increment or decrement buttons.
64
+ * @param value - The new value of the `NumberInput`, which can be a number or a string.
56
65
  */
57
66
  onChange?: (event: SyntheticEvent | undefined, value: number | string) => void;
58
67
  /**
59
- * A string. Displayed in a dimmed color when the input value is empty.
68
+ *
69
+ * A callback to parse the value of the `NumberInput`. To be used alongside
70
+ * the `format` callback.
71
+ */
72
+ parse?: (value: number | string) => string | number;
73
+ /**
74
+ * A string displayed in a dimmed color when the `NumberInput` value is empty.
75
+ */
76
+ placeholder?: string;
77
+ /**
78
+ * The number of decimal places allowed. Defaults to the decimal scale of either the initial value provided or the step, whichever is greater.
60
79
  */
61
- placeholder?: string | undefined;
80
+ decimalScale?: number;
62
81
  /**
63
- * A boolean. If `true`, the component is not editable by the user.
82
+ * A boolean property that controls the editability of the `NumberInput`.
83
+ * - When set to `true`, the `NumberInput` becomes read-only, preventing user edits.
84
+ * - When set to `false` or omitted, the `NumberInput` is editable by the user.
64
85
  */
65
86
  readOnly?: boolean;
66
87
  /**
67
- * Start adornment component
88
+ * Start adornment component.
68
89
  */
69
90
  startAdornment?: ReactNode;
70
91
  /**
71
- * The amount to increment or decrement the value by when using the number buttons or Up Arrow and Down Arrow keys. Default to 1.
92
+ * The amount to increment or decrement the value by when using the `NumberInput` buttons or Up Arrow and Down Arrow keys.
72
93
  * @default 1
73
94
  */
74
95
  step?: number;
75
96
  /**
76
- * The amount to change the value when the value is incremented or decremented by holding Shift and pressing Up arrow or Down arrow keys.
77
- * Defaults to 10.
78
- * @default 10
97
+ * Defines the factor by which the step value is multiplied to determine the maximum increment or decrement when the Shift key
98
+ * is held while pressing the Up Arrow or Down Arrow keys for faster adjustments of the value.
99
+ * @default 2
79
100
  */
80
- stepBlock?: number;
101
+ stepMultiplier?: number;
81
102
  /**
82
- * Alignment of text within container. Defaults to "left".
103
+ * Specifies the alignment of the text within the `NumberInput`.
104
+ *
83
105
  * @default "left"
84
106
  */
85
107
  textAlign?: "left" | "center" | "right";
@@ -88,13 +110,13 @@ export interface NumberInputProps extends Omit<ComponentPropsWithoutRef<"div">,
88
110
  */
89
111
  validationStatus?: Extract<ValidationStatus, "error" | "warning" | "success">;
90
112
  /**
91
- * Styling variant. Defaults to "primary".
113
+ * Styling variant.
92
114
  * @default "primary"
93
115
  */
94
116
  variant?: "primary" | "secondary";
95
117
  /**
96
- * The value of the number input. The component will be controlled if this prop is provided.
118
+ * Value of the `NumberInput`, to be used when in a controlled state.
97
119
  */
98
- value?: number | string | undefined;
120
+ value?: number | string;
99
121
  }
100
122
  export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,5 @@
1
+ import { type MutableRefObject } from "react";
2
+ declare const useCaret: ({ inputRef, }: {
3
+ inputRef: MutableRefObject<HTMLInputElement | null>;
4
+ }) => (() => void)[];
5
+ export default useCaret;
@@ -1,3 +1,3 @@
1
- declare type IntervalFunction = () => void;
1
+ type IntervalFunction = () => void;
2
2
  declare function useInterval(callback: IntervalFunction, delay: number | null): void;
3
3
  export { useInterval };
@@ -1,8 +1,8 @@
1
- export declare const ACCEPT_INPUT: RegExp;
2
- export declare const toFixedDecimalPlaces: (inputNumber: number, decimalPlaces: number) => string;
3
1
  export declare const isAllowedNonNumeric: (inputCharacter: number | string) => boolean | undefined;
4
2
  export declare const toFloat: (inputValue: number | string) => number;
5
- export declare const sanitizedInput: (numberString: string) => string;
6
- export declare const isAtMax: (value: number | string | undefined, max: number) => boolean;
7
- export declare const isAtMin: (value: number | string | undefined, min: number) => boolean;
3
+ export declare const isValidNumber: (num: string | number) => boolean;
4
+ export declare const sanitizeInput: (value: string | number) => string | number;
8
5
  export declare const isOutOfRange: (value: number | string | undefined, min: number, max: number) => boolean;
6
+ export declare const clampToRange: (min: number, max: number, value: number) => number;
7
+ export declare const getNumberPrecision: (number: string | number) => number;
8
+ export declare const isEmpty: (value: number | string) => value is "";
@@ -1,12 +1,17 @@
1
1
  import { type Dispatch, type MouseEvent, type MutableRefObject, type SetStateAction, type SyntheticEvent } from "react";
2
2
  import type { NumberInputProps } from "./NumberInput";
3
+ export interface UseNumberInputProps extends Pick<NumberInputProps, "decimalScale" | "disabled" | "format" | "inputRef" | "max" | "min" | "onChange" | "parse" | "readOnly" | "step" | "stepMultiplier"> {
4
+ clampAndFix: (value: number) => string | number;
5
+ inputRef: MutableRefObject<HTMLInputElement | null>;
6
+ isAdjustingRef: MutableRefObject<boolean>;
7
+ setIsEditing: Dispatch<SetStateAction<boolean>>;
8
+ setValue: Dispatch<SetStateAction<string | number>>;
9
+ value: string | number;
10
+ }
3
11
  /**
4
12
  * Manages increment / decrement logic
5
13
  */
6
- export declare const useNumberInput: ({ decimalPlaces, disabled, inputRef, max, min, onChange, readOnly, setValue, step, stepBlock, value, }: Pick<NumberInputProps, "value" | "max" | "min" | "onChange" | "disabled" | "readOnly" | "step" | "inputRef" | "decimalPlaces" | "stepBlock"> & {
7
- setValue: Dispatch<SetStateAction<string | number | undefined>>;
8
- inputRef: MutableRefObject<HTMLInputElement | null>;
9
- }) => {
14
+ export declare const useNumberInput: ({ clampAndFix, decimalScale, disabled, format, inputRef, isAdjustingRef, max, min, onChange, parse, readOnly, setIsEditing, setValue, step, stepMultiplier, value, }: UseNumberInputProps) => {
10
15
  incrementButtonProps: {
11
16
  "aria-label": string;
12
17
  disabled: boolean;
@@ -23,6 +28,6 @@ export declare const useNumberInput: ({ decimalPlaces, disabled, inputRef, max,
23
28
  tabIndex: number;
24
29
  onMouseUp: () => void | undefined;
25
30
  };
26
- incrementValue: (event?: SyntheticEvent<Element, Event> | undefined, block?: boolean | undefined) => void;
27
- decrementValue: (event?: SyntheticEvent<Element, Event> | undefined, block?: boolean | undefined) => void;
31
+ incrementValue: (event?: SyntheticEvent, block?: boolean) => void;
32
+ decrementValue: (event?: SyntheticEvent, block?: boolean) => void;
28
33
  };
@@ -2,7 +2,7 @@ import { type FocusEventHandler, type ForwardedRef, type Ref } from "react";
2
2
  import type { QueryInputProps } from "./QueryInput";
3
3
  import type { QueryInputBodyProps } from "./internal/QueryInputBody";
4
4
  import type { ValueSelectorProps } from "./internal/ValueSelector";
5
- export declare type BooleanOperator = "or" | "and";
5
+ export type BooleanOperator = "or" | "and";
6
6
  export interface UseQueryInputResult {
7
7
  queryInputProps: {
8
8
  onFocus: FocusEventHandler<HTMLDivElement>;
@@ -27,7 +27,7 @@ interface RemoveItemAction {
27
27
  }
28
28
  interface MultiItemAction {
29
29
  type: "update-items" | "update-items-remove-overflow-indicator";
30
- overflowItems: Partial<Omit<OverflowItem, "id">> & Pick<OverflowItem, "id">[];
30
+ overflowItems: (Partial<Omit<OverflowItem, "id">> & Pick<OverflowItem, "id">)[];
31
31
  }
32
32
  interface SingleItemAction {
33
33
  type: "add-overflow-indicator" | "replace-item" | "collapsing-item" | "uncollapse-dynamic-item" | "collapse-instant-item";
@@ -46,9 +46,9 @@ interface DynamicCollapseAction extends Omit<SingleItemAction, "type"> {
46
46
  collapsedSize: number;
47
47
  minSize: number;
48
48
  }
49
- export declare type OverflowAction = AddChildAction | CombinedItemAction | DynamicCollapseAction | EmptyPayloadAction | InitAction | MultiItemAction | RemoveItemAction | SingleItemAction | SourceAction;
50
- export declare type OverflowReducer = Reducer<OverflowItems, OverflowAction>;
51
- export declare type OverflowReducerInitialisationProps = {
49
+ export type OverflowAction = AddChildAction | CombinedItemAction | DynamicCollapseAction | EmptyPayloadAction | InitAction | MultiItemAction | RemoveItemAction | SingleItemAction | SourceAction;
50
+ export type OverflowReducer = Reducer<OverflowItems, OverflowAction>;
51
+ export type OverflowReducerInitialisationProps = {
52
52
  children?: ReactNode;
53
53
  source?: OverflowSource[];
54
54
  injectedItems?: any[];
@@ -1,22 +1,22 @@
1
1
  import type { ReactElement, ReactNode, RefObject } from "react";
2
2
  import type { OverflowAction as overflowAction2 } from "./OverflowReducer";
3
- declare type dimension = "width" | "height" | "scrollWidth" | "scrollHeight";
4
- declare type dimensions = {
3
+ type dimension = "width" | "height" | "scrollWidth" | "scrollHeight";
4
+ type dimensions = {
5
5
  size: dimension;
6
6
  depth: dimension;
7
7
  scrollDepth: dimension;
8
8
  };
9
- export declare type dimensionsType = {
9
+ export type dimensionsType = {
10
10
  horizontal: dimensions;
11
11
  vertical: dimensions;
12
12
  };
13
- export declare type orientationType = keyof dimensionsType;
14
- export declare type collapsibleType = "instant" | "dynamic";
13
+ export type orientationType = keyof dimensionsType;
14
+ export type collapsibleType = "instant" | "dynamic";
15
15
  interface NonNullableRefObject<T> {
16
16
  current: T;
17
17
  }
18
- export declare type FilterPredicate = (item: OverflowItem) => boolean;
19
- export declare type ElementRef = RefObject<HTMLDivElement>;
18
+ export type FilterPredicate = (item: OverflowItem) => boolean;
19
+ export type ElementRef = RefObject<HTMLDivElement>;
20
20
  export interface OverflowSource {
21
21
  id?: string;
22
22
  label: string;
@@ -25,15 +25,15 @@ export interface OverflowSource {
25
25
  position?: number;
26
26
  priority?: number;
27
27
  }
28
- export declare type InjectedSourceItem = {
28
+ export type InjectedSourceItem = {
29
29
  source: OverflowSource;
30
30
  };
31
- export declare type InjectedChildItem = {
31
+ export type InjectedChildItem = {
32
32
  element: JSX.Element;
33
33
  };
34
- export declare type InjectedItem = InjectedChildItem | InjectedSourceItem;
35
- export declare type overflowItemType = "source" | "child";
36
- export declare type OverflowItem<T extends overflowItemType = "child"> = {
34
+ export type InjectedItem = InjectedChildItem | InjectedSourceItem;
35
+ export type overflowItemType = "source" | "child";
36
+ export type OverflowItem<T extends overflowItemType = "child"> = {
37
37
  collapsed?: boolean;
38
38
  collapsible?: collapsibleType;
39
39
  collapsing?: boolean;
@@ -57,24 +57,24 @@ export declare type OverflowItem<T extends overflowItemType = "child"> = {
57
57
  editable?: boolean;
58
58
  closeable?: boolean;
59
59
  };
60
- export declare type OverflowItems = OverflowItem<"source" | "child">[];
61
- export declare type ManagedListRef = NonNullableRefObject<OverflowItem[]>;
62
- export declare type overflowState = {
60
+ export type OverflowItems = OverflowItem<"source" | "child">[];
61
+ export type ManagedListRef = NonNullableRefObject<OverflowItem[]>;
62
+ export type overflowState = {
63
63
  overflowIndicatorSize: number;
64
64
  visibleItems: OverflowItem[];
65
65
  };
66
- export declare type overflowAction = {
66
+ export type overflowAction = {
67
67
  type: string;
68
68
  managedItems?: OverflowItem[];
69
69
  managedItem?: OverflowItem;
70
70
  };
71
- export declare type overflowDispatch = (action: overflowAction2) => void;
72
- export declare type OverflowCollectionOptions = {
71
+ export type overflowDispatch = (action: overflowAction2) => void;
72
+ export type OverflowCollectionOptions = {
73
73
  closeable?: boolean;
74
74
  editable?: boolean;
75
75
  getPriority?: (item: any, index: number) => number | undefined;
76
76
  };
77
- export declare type OverflowCollectionHookProps = {
77
+ export type OverflowCollectionHookProps = {
78
78
  children?: ReactNode;
79
79
  defaultSource?: OverflowSource[];
80
80
  id: string;
@@ -84,7 +84,7 @@ export declare type OverflowCollectionHookProps = {
84
84
  orientation: orientationType;
85
85
  source?: OverflowSource[];
86
86
  };
87
- export declare type OverflowCollectionHookResult = {
87
+ export type OverflowCollectionHookResult = {
88
88
  data: OverflowItem[];
89
89
  dispatch: (action: overflowAction2 | {
90
90
  type: "reset";
@@ -1,7 +1,7 @@
1
1
  import type { ElementRef, OverflowItem, orientationType } from "./overflowTypes";
2
2
  export declare const DropdownPlaceholder: () => null;
3
3
  export declare const getDropdownPlaceholder: () => import("react/jsx-runtime").JSX.Element;
4
- export declare type heightOrWidth = "width" | "height";
4
+ export type heightOrWidth = "width" | "height";
5
5
  export declare const NO_DATA: {};
6
6
  export declare const allExceptOverflowIndicator: (sum: number, m: OverflowItem) => number;
7
7
  export declare const isCollapsed: (item: OverflowItem) => boolean;
@@ -28,11 +28,11 @@ export declare const measureContainerOverflow: (ref: ElementRef, orientation?: o
28
28
  **/
29
29
  export declare function measureElementSize(element: HTMLElement, dimension?: heightOrWidth, includeAutoMargin?: boolean): number;
30
30
  export declare const byDescendingPriority: (m1: OverflowItem, m2: OverflowItem) => number;
31
- export declare const getOverflowIndicator: (managedItems: OverflowItem[]) => OverflowItem<"child"> | undefined;
31
+ export declare const getOverflowIndicator: (managedItems: OverflowItem[]) => OverflowItem | undefined;
32
32
  export declare const popNextItemByPriority: (items: OverflowItem[]) => OverflowItem | null;
33
33
  export declare const measureOverflowItems: (items: OverflowItem[], dimension: heightOrWidth) => OverflowItem[];
34
34
  export declare const addAll: (sum: number, m: OverflowItem) => number;
35
35
  export declare const getElementForItem: (ref: ElementRef, item: OverflowItem) => HTMLElement;
36
- declare type dimension = "left" | "right" | "top" | "bottom";
36
+ type dimension = "left" | "right" | "top" | "bottom";
37
37
  export declare const getRuntimePadding: (el: HTMLElement, ...dimensions: dimension[]) => number[];
38
38
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { OverflowCollectionHookProps, OverflowCollectionHookResult } from "./overflowTypes";
2
- declare type OverflowCollectionHook = (props: OverflowCollectionHookProps) => OverflowCollectionHookResult;
2
+ type OverflowCollectionHook = (props: OverflowCollectionHookProps) => OverflowCollectionHookResult;
3
3
  export declare const useOverflowCollectionItems: OverflowCollectionHook;
4
4
  export {};
@@ -1,4 +1,4 @@
1
1
  import type { ElementRef, OverflowItem, OverflowLayoutHookProps } from "./overflowTypes";
2
- declare type overflowUpdate = (item1: OverflowItem, item2: OverflowItem) => void;
2
+ type overflowUpdate = (item1: OverflowItem, item2: OverflowItem) => void;
3
3
  export declare const useOverflowLayout: ({ collectionHook, id, orientation, label, disableOverflow, }: OverflowLayoutHookProps) => [ElementRef, overflowUpdate];
4
4
  export {};
@@ -2,11 +2,11 @@ import { type RefObject } from "react";
2
2
  export declare const WidthHeight: string[];
3
3
  export declare const HeightOnly: string[];
4
4
  export declare const WidthOnly: string[];
5
- export declare type measurements<T = string | number> = {
5
+ export type measurements<T = string | number> = {
6
6
  height?: T;
7
7
  scrollHeight?: T;
8
8
  scrollWidth?: T;
9
9
  width?: T;
10
10
  };
11
- export declare type ResizeHandler = (measurements: measurements<number>) => void;
11
+ export type ResizeHandler = (measurements: measurements<number>) => void;
12
12
  export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
@@ -1,7 +1,7 @@
1
- export declare type dataPadDirection = "data-pad-start" | "data-pad-end";
1
+ export type dataPadDirection = "data-pad-start" | "data-pad-end";
2
2
  export declare const isResponsiveAttribute: (propName: string) => boolean;
3
- declare type AnyProps = Record<string, unknown>;
4
- declare type ResponsivePropsTuple = [AnyProps, AnyProps];
3
+ type AnyProps = Record<string, unknown>;
4
+ type ResponsivePropsTuple = [AnyProps, AnyProps];
5
5
  /**
6
6
  * data- attributes can be used to manage item overflow behaviour. Users may
7
7
  * speficy these attributes directly on a Toolbar component, which ultimately
@@ -1,22 +1,23 @@
1
1
  import { type KeyboardEvent, type MouseEvent } from "react";
2
+ import { type EditableLabelProps } from "../editable-label";
2
3
  export declare const Tab: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLElement>, "onKeyUp" | "onClick"> & {
3
- ariaControls?: string | undefined;
4
- closeable?: boolean | undefined;
5
- draggable?: boolean | undefined;
6
- dragging?: boolean | undefined;
7
- editable?: boolean | undefined;
8
- editing?: boolean | undefined;
9
- focused?: boolean | undefined;
10
- focusVisible?: boolean | undefined;
11
- focusedChildIndex?: number | undefined;
12
- selected?: boolean | undefined;
13
- index?: number | undefined;
14
- label?: string | undefined;
15
- onClick?: ((e: MouseEvent<Element, globalThis.MouseEvent>, index: number) => void) | undefined;
16
- onClose?: ((index: number) => void) | undefined;
17
- onEnterEditMode?: (() => void) | undefined;
18
- onExitEditMode?: import("./TabsTypes").exitEditHandler | undefined;
19
- onKeyUp?: ((e: KeyboardEvent<Element>, index: number) => void) | undefined;
20
- orientation?: "horizontal" | "vertical" | undefined;
21
- tabChildIndex?: number | undefined;
4
+ ariaControls?: import("react").AriaAttributes["aria-controls"];
5
+ closeable?: boolean;
6
+ draggable?: boolean;
7
+ dragging?: boolean;
8
+ editable?: boolean;
9
+ editing?: EditableLabelProps["editing"];
10
+ focused?: boolean;
11
+ focusVisible?: boolean;
12
+ focusedChildIndex?: number;
13
+ selected?: boolean;
14
+ index?: number;
15
+ label?: EditableLabelProps["defaultValue"];
16
+ onClick?: (e: MouseEvent, index: number) => void;
17
+ onClose?: (index: number) => void;
18
+ onEnterEditMode?: () => void;
19
+ onExitEditMode?: import("./TabsTypes").exitEditHandler;
20
+ onKeyUp?: (e: KeyboardEvent, index: number) => void;
21
+ orientation?: "horizontal" | "vertical";
22
+ tabChildIndex?: number;
22
23
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,3 @@
1
1
  import type { FocusAPI, TabstripProps } from "./TabsTypes";
2
- export declare type TabsProps = Omit<TabstripProps, "defaultSource">;
2
+ export type TabsProps = Omit<TabstripProps, "defaultSource">;
3
3
  export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<FocusAPI>>;
@@ -8,10 +8,10 @@ export interface FocusAPI {
8
8
  export interface TabDescriptor extends OverflowSource {
9
9
  element?: JSX.Element;
10
10
  }
11
- export declare type TabsSource = string[] | TabDescriptor[];
12
- export declare type navigationProps = Pick<TabProps, "onFocus" | "onKeyDown">;
13
- export declare type composableTabProps = navigationProps & Pick<TabProps, "onClick" | "onEnterEditMode" | "onExitEditMode" | "onMouseDown">;
14
- export declare type TabstripVariant = "primary" | "tertiary";
11
+ export type TabsSource = string[] | TabDescriptor[];
12
+ export type navigationProps = Pick<TabProps, "onFocus" | "onKeyDown">;
13
+ export type composableTabProps = navigationProps & Pick<TabProps, "onClick" | "onEnterEditMode" | "onExitEditMode" | "onMouseDown">;
14
+ export type TabstripVariant = "primary" | "tertiary";
15
15
  export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
16
16
  /**
17
17
  * when true Tabs may be re-arranged by dragging individual Tabs to new position within Tabstrip.
@@ -64,13 +64,13 @@ export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
64
64
  */
65
65
  variant?: TabstripVariant;
66
66
  }
67
- export declare type exitEditHandler = (originalValue: string, editedValue: string, allowDeactivation: boolean, tabIndex: number) => void;
67
+ export type exitEditHandler = (originalValue: string, editedValue: string, allowDeactivation: boolean, tabIndex: number) => void;
68
68
  export interface responsiveDataAttributes {
69
69
  "data-index": number;
70
70
  "data-overflowed"?: boolean;
71
71
  "data-priority": number;
72
72
  }
73
- export declare type TabProps = Omit<HTMLAttributes<HTMLElement>, "onClick" | "onKeyUp"> & {
73
+ export type TabProps = Omit<HTMLAttributes<HTMLElement>, "onClick" | "onKeyUp"> & {
74
74
  ariaControls?: AriaAttributes["aria-controls"];
75
75
  closeable?: boolean;
76
76
  draggable?: boolean;
@@ -91,4 +91,4 @@ export declare type TabProps = Omit<HTMLAttributes<HTMLElement>, "onClick" | "on
91
91
  orientation?: "horizontal" | "vertical";
92
92
  tabChildIndex?: number;
93
93
  };
94
- export declare type TabElement = ReactElement<TabProps>;
94
+ export type TabElement = ReactElement<TabProps>;
@@ -4,6 +4,6 @@ export declare const Draggable: import("react").ForwardRefExoticComponent<{
4
4
  wrapperClassName: string;
5
5
  element: HTMLElement;
6
6
  rect: Rect;
7
- scale?: number | undefined;
7
+ scale?: number;
8
8
  } & import("react").RefAttributes<HTMLDivElement>>;
9
- export declare const createDragSpacer: (transitioning?: MutableRefObject<boolean> | undefined) => HTMLElement;
9
+ export declare const createDragSpacer: (transitioning?: MutableRefObject<boolean>) => HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import type { Rect } from "./dragDropTypes";
2
2
  export declare const DropIndicator: import("react").ForwardRefExoticComponent<{
3
- className?: string | undefined;
3
+ className?: string;
4
4
  rect: Rect;
5
5
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,6 @@
1
1
  import type { orientationType } from "../../responsive";
2
2
  import { type Direction } from "./dragDropTypes";
3
- export declare type MeasuredDropTarget = {
3
+ export type MeasuredDropTarget = {
4
4
  currentIndex: number;
5
5
  dataIndex?: number;
6
6
  element: HTMLElement;
@@ -12,37 +12,41 @@ export declare type MeasuredDropTarget = {
12
12
  mid: number;
13
13
  size: number;
14
14
  };
15
- export declare type targetType = {
15
+ export type targetType = {
16
16
  element: HTMLElement | null;
17
17
  index: number;
18
18
  isLast?: boolean;
19
19
  };
20
- declare type Dimension = keyof Pick<DOMRect, "width" | "height">;
20
+ type MousePosKey = keyof Pick<MouseEvent, "clientX" | "clientY">;
21
+ type DOMRectKey = keyof Omit<DOMRect, "toJSON">;
22
+ type DOMRectDimensionKey = keyof Pick<DOMRect, "width" | "height">;
23
+ type Dimension = keyof Pick<DOMRect, "width" | "height">;
24
+ type ElementDimension = keyof Pick<HTMLElement, "scrollHeight" | "scrollWidth" | "clientHeight" | "clientWidth" | "scrollTop" | "scrollLeft">;
21
25
  export declare const measureElementSizeAndPosition: (element: HTMLElement, dimension?: Dimension, includeAutoMargin?: boolean) => number[];
22
26
  export declare const dimensions: (orientation: orientationType) => {
23
- CLIENT_SIZE: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
24
- CONTRA: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
25
- CONTRA_POS: "clientX" | "clientY";
26
- DIMENSION: "height" | "width";
27
- END: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
28
- POS: "clientX" | "clientY";
29
- SCROLL_POS: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
30
- SCROLL_SIZE: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
31
- START: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
27
+ CLIENT_SIZE: ElementDimension;
28
+ CONTRA: DOMRectKey;
29
+ CONTRA_POS: MousePosKey;
30
+ DIMENSION: DOMRectDimensionKey;
31
+ END: DOMRectKey;
32
+ POS: MousePosKey;
33
+ SCROLL_POS: ElementDimension;
34
+ SCROLL_SIZE: ElementDimension;
35
+ START: DOMRectKey;
32
36
  } | {
33
- CLIENT_SIZE: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
34
- CONTRA: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
35
- CONTRA_POS: "clientX" | "clientY";
36
- DIMENSION: "height" | "width";
37
- END: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
38
- POS: "clientX" | "clientY";
39
- SCROLL_POS: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
40
- SCROLL_SIZE: "scrollHeight" | "clientHeight" | "scrollWidth" | "clientWidth" | "scrollTop" | "scrollLeft";
41
- START: "x" | "y" | "height" | "width" | "left" | "right" | "top" | "bottom";
37
+ CLIENT_SIZE: ElementDimension;
38
+ CONTRA: DOMRectKey;
39
+ CONTRA_POS: MousePosKey;
40
+ DIMENSION: DOMRectDimensionKey;
41
+ END: DOMRectKey;
42
+ POS: MousePosKey;
43
+ SCROLL_POS: ElementDimension;
44
+ SCROLL_SIZE: ElementDimension;
45
+ START: DOMRectKey;
42
46
  };
43
47
  export declare const getDraggedItem: (measuredItems: MeasuredDropTarget[]) => MeasuredDropTarget;
44
48
  export declare const moveDragItem: (measuredItems: MeasuredDropTarget[], dropTarget: MeasuredDropTarget) => MeasuredDropTarget[];
45
49
  export declare const isDraggedElement: (item: MeasuredDropTarget) => boolean;
46
- export declare const measureDropTargets: (container: HTMLElement, orientation: orientationType, draggedItem: HTMLElement, itemQuery?: string | undefined) => MeasuredDropTarget[];
50
+ export declare const measureDropTargets: (container: HTMLElement, orientation: orientationType, draggedItem: HTMLElement, itemQuery?: string) => MeasuredDropTarget[];
47
51
  export declare const getNextDropTarget: (dropTargets: MeasuredDropTarget[], pos: number, direction: Direction) => MeasuredDropTarget | null;
48
52
  export {};
@@ -1,16 +1,16 @@
1
1
  import type { MouseEventHandler, RefObject } from "react";
2
2
  import type { orientationType } from "../../responsive";
3
- export declare type dragStrategy = "drop-indicator" | "natural-movement";
4
- export declare type Direction = "fwd" | "bwd";
3
+ export type dragStrategy = "drop-indicator" | "natural-movement";
4
+ export type Direction = "fwd" | "bwd";
5
5
  export declare const FWD: Direction;
6
6
  export declare const BWD: Direction;
7
- export declare type Rect = {
7
+ export type Rect = {
8
8
  height: number;
9
9
  left: number;
10
10
  top: number;
11
11
  width: number;
12
12
  };
13
- export declare type DragHookResult = {
13
+ export type DragHookResult = {
14
14
  draggable: JSX.Element | null;
15
15
  dropIndicator: JSX.Element | null;
16
16
  draggedItemIndex?: number;
@@ -18,7 +18,7 @@ export declare type DragHookResult = {
18
18
  onMouseDown?: MouseEventHandler;
19
19
  revealOverflowedItems: boolean;
20
20
  };
21
- export declare type DragDropHook = (props: {
21
+ export type DragDropHook = (props: {
22
22
  allowDragDrop?: boolean | dragStrategy;
23
23
  extendedDropZone?: boolean;
24
24
  onDrop: (fromIndex: number, toIndex: number) => void;
@@ -1,7 +1,7 @@
1
1
  import type { MeasuredDropTarget } from "./drag-utils";
2
2
  import type { Direction } from "./dragDropTypes";
3
3
  export declare const useDragSpacers: () => {
4
- displaceItem: (item: MeasuredDropTarget | null, size: number, useTransition?: boolean, direction?: Direction | undefined) => void;
4
+ displaceItem: (item: MeasuredDropTarget | null, size: number, useTransition?: boolean, direction?: Direction) => void;
5
5
  displaceLastItem: (item: MeasuredDropTarget, size: number, useTransition?: boolean) => void;
6
6
  clearSpacers: () => void;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from "react";
2
2
  import { type orientationType } from "../responsive";
3
- declare type activationIndicatorStyles = {
3
+ type activationIndicatorStyles = {
4
4
  height?: number;
5
5
  left?: number;
6
6
  top?: number;