@vuu-ui/vuu-ui-controls 0.13.2 → 0.13.4

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 (301) hide show
  1. package/cjs/column-picker/ColumnPicker.js +2 -2
  2. package/cjs/column-picker/ColumnPicker.js.map +1 -1
  3. package/cjs/column-picker/ColumnSearch.js +4 -24
  4. package/cjs/column-picker/ColumnSearch.js.map +1 -1
  5. package/cjs/context-panel-provider/ContextPanelProvider.js +55 -0
  6. package/cjs/context-panel-provider/ContextPanelProvider.js.map +1 -0
  7. package/cjs/index.js +6 -80
  8. package/cjs/index.js.map +1 -1
  9. package/cjs/sortable-list/SortableList.js +38 -0
  10. package/cjs/sortable-list/SortableList.js.map +1 -0
  11. package/cjs/toolbar/Toolbar.js.map +1 -1
  12. package/cjs/toolbar/useSelection.js +0 -1
  13. package/cjs/toolbar/useSelection.js.map +1 -1
  14. package/esm/column-picker/ColumnPicker.js +2 -2
  15. package/esm/column-picker/ColumnPicker.js.map +1 -1
  16. package/esm/column-picker/ColumnSearch.js +5 -25
  17. package/esm/column-picker/ColumnSearch.js.map +1 -1
  18. package/esm/context-panel-provider/ContextPanelProvider.js +51 -0
  19. package/esm/context-panel-provider/ContextPanelProvider.js.map +1 -0
  20. package/esm/index.js +2 -21
  21. package/esm/index.js.map +1 -1
  22. package/esm/sortable-list/SortableList.js +35 -0
  23. package/esm/sortable-list/SortableList.js.map +1 -0
  24. package/esm/toolbar/Toolbar.js.map +1 -1
  25. package/esm/toolbar/useSelection.js +0 -1
  26. package/esm/toolbar/useSelection.js.map +1 -1
  27. package/package.json +15 -17
  28. package/cjs/common-hooks/collectionProvider.js +0 -24
  29. package/cjs/common-hooks/collectionProvider.js.map +0 -1
  30. package/cjs/common-hooks/isPlainObject.js +0 -6
  31. package/cjs/common-hooks/isPlainObject.js.map +0 -1
  32. package/cjs/common-hooks/itemToString.js +0 -24
  33. package/cjs/common-hooks/itemToString.js.map +0 -1
  34. package/cjs/common-hooks/useCollectionItems.js +0 -309
  35. package/cjs/common-hooks/useCollectionItems.js.map +0 -1
  36. package/cjs/common-hooks/useSelection.js +0 -212
  37. package/cjs/common-hooks/useSelection.js.map +0 -1
  38. package/cjs/list/Highlighter.css.js +0 -6
  39. package/cjs/list/Highlighter.css.js.map +0 -1
  40. package/cjs/list/Highlighter.js +0 -36
  41. package/cjs/list/Highlighter.js.map +0 -1
  42. package/cjs/list/List.css.js +0 -6
  43. package/cjs/list/List.css.js.map +0 -1
  44. package/cjs/list/List.js +0 -317
  45. package/cjs/list/List.js.map +0 -1
  46. package/cjs/list/ListItem.css.js +0 -6
  47. package/cjs/list/ListItem.css.js.map +0 -1
  48. package/cjs/list/ListItem.js +0 -84
  49. package/cjs/list/ListItem.js.map +0 -1
  50. package/cjs/list/ListItemGroup.js +0 -6
  51. package/cjs/list/ListItemGroup.js.map +0 -1
  52. package/cjs/list/ListItemHeader.js +0 -6
  53. package/cjs/list/ListItemHeader.js.map +0 -1
  54. package/cjs/list/RadioIcon.css.js +0 -6
  55. package/cjs/list/RadioIcon.css.js.map +0 -1
  56. package/cjs/list/RadioIcon.js +0 -27
  57. package/cjs/list/RadioIcon.js.map +0 -1
  58. package/cjs/list/common-hooks/keyUtils.js +0 -78
  59. package/cjs/list/common-hooks/keyUtils.js.map +0 -1
  60. package/cjs/list/common-hooks/list-dom-utils.js +0 -25
  61. package/cjs/list/common-hooks/list-dom-utils.js.map +0 -1
  62. package/cjs/list/common-hooks/useCollapsibleGroups.js +0 -72
  63. package/cjs/list/common-hooks/useCollapsibleGroups.js.map +0 -1
  64. package/cjs/list/common-hooks/useImperativeScrollingAPI.js +0 -52
  65. package/cjs/list/common-hooks/useImperativeScrollingAPI.js.map +0 -1
  66. package/cjs/list/common-hooks/useKeyboardNavigation.js +0 -289
  67. package/cjs/list/common-hooks/useKeyboardNavigation.js.map +0 -1
  68. package/cjs/list/common-hooks/useTypeahead.js +0 -74
  69. package/cjs/list/common-hooks/useTypeahead.js.map +0 -1
  70. package/cjs/list/common-hooks/useViewportTracking.js +0 -133
  71. package/cjs/list/common-hooks/useViewportTracking.js.map +0 -1
  72. package/cjs/list/common-hooks/utils/collection-item-utils.js +0 -182
  73. package/cjs/list/common-hooks/utils/collection-item-utils.js.map +0 -1
  74. package/cjs/list/common-hooks/utils/filter-utils.js +0 -11
  75. package/cjs/list/common-hooks/utils/filter-utils.js.map +0 -1
  76. package/cjs/list/common-hooks/utils/isSelected.js +0 -9
  77. package/cjs/list/common-hooks/utils/isSelected.js.map +0 -1
  78. package/cjs/list/useList.js +0 -278
  79. package/cjs/list/useList.js.map +0 -1
  80. package/cjs/list/useListDrop.js +0 -92
  81. package/cjs/list/useListDrop.js.map +0 -1
  82. package/cjs/list/useListHeight.js +0 -77
  83. package/cjs/list/useListHeight.js.map +0 -1
  84. package/cjs/list/useScrollPosition.js +0 -74
  85. package/cjs/list/useScrollPosition.js.map +0 -1
  86. package/esm/common-hooks/collectionProvider.js +0 -20
  87. package/esm/common-hooks/collectionProvider.js.map +0 -1
  88. package/esm/common-hooks/isPlainObject.js +0 -4
  89. package/esm/common-hooks/isPlainObject.js.map +0 -1
  90. package/esm/common-hooks/itemToString.js +0 -22
  91. package/esm/common-hooks/itemToString.js.map +0 -1
  92. package/esm/common-hooks/useCollectionItems.js +0 -307
  93. package/esm/common-hooks/useCollectionItems.js.map +0 -1
  94. package/esm/common-hooks/useSelection.js +0 -205
  95. package/esm/common-hooks/useSelection.js.map +0 -1
  96. package/esm/list/Highlighter.css.js +0 -4
  97. package/esm/list/Highlighter.css.js.map +0 -1
  98. package/esm/list/Highlighter.js +0 -34
  99. package/esm/list/Highlighter.js.map +0 -1
  100. package/esm/list/List.css.js +0 -4
  101. package/esm/list/List.css.js.map +0 -1
  102. package/esm/list/List.js +0 -315
  103. package/esm/list/List.js.map +0 -1
  104. package/esm/list/ListItem.css.js +0 -4
  105. package/esm/list/ListItem.css.js.map +0 -1
  106. package/esm/list/ListItem.js +0 -81
  107. package/esm/list/ListItem.js.map +0 -1
  108. package/esm/list/ListItemGroup.js +0 -4
  109. package/esm/list/ListItemGroup.js.map +0 -1
  110. package/esm/list/ListItemHeader.js +0 -4
  111. package/esm/list/ListItemHeader.js.map +0 -1
  112. package/esm/list/RadioIcon.css.js +0 -4
  113. package/esm/list/RadioIcon.css.js.map +0 -1
  114. package/esm/list/RadioIcon.js +0 -25
  115. package/esm/list/RadioIcon.js.map +0 -1
  116. package/esm/list/common-hooks/keyUtils.js +0 -64
  117. package/esm/list/common-hooks/keyUtils.js.map +0 -1
  118. package/esm/list/common-hooks/list-dom-utils.js +0 -19
  119. package/esm/list/common-hooks/list-dom-utils.js.map +0 -1
  120. package/esm/list/common-hooks/useCollapsibleGroups.js +0 -70
  121. package/esm/list/common-hooks/useCollapsibleGroups.js.map +0 -1
  122. package/esm/list/common-hooks/useImperativeScrollingAPI.js +0 -50
  123. package/esm/list/common-hooks/useImperativeScrollingAPI.js.map +0 -1
  124. package/esm/list/common-hooks/useKeyboardNavigation.js +0 -286
  125. package/esm/list/common-hooks/useKeyboardNavigation.js.map +0 -1
  126. package/esm/list/common-hooks/useTypeahead.js +0 -72
  127. package/esm/list/common-hooks/useTypeahead.js.map +0 -1
  128. package/esm/list/common-hooks/useViewportTracking.js +0 -131
  129. package/esm/list/common-hooks/useViewportTracking.js.map +0 -1
  130. package/esm/list/common-hooks/utils/collection-item-utils.js +0 -168
  131. package/esm/list/common-hooks/utils/collection-item-utils.js.map +0 -1
  132. package/esm/list/common-hooks/utils/filter-utils.js +0 -8
  133. package/esm/list/common-hooks/utils/filter-utils.js.map +0 -1
  134. package/esm/list/common-hooks/utils/isSelected.js +0 -7
  135. package/esm/list/common-hooks/utils/isSelected.js.map +0 -1
  136. package/esm/list/useList.js +0 -276
  137. package/esm/list/useList.js.map +0 -1
  138. package/esm/list/useListDrop.js +0 -90
  139. package/esm/list/useListDrop.js.map +0 -1
  140. package/esm/list/useListHeight.js +0 -75
  141. package/esm/list/useListHeight.js.map +0 -1
  142. package/esm/list/useScrollPosition.js +0 -72
  143. package/esm/list/useScrollPosition.js.map +0 -1
  144. package/types/calendar/Calendar.d.ts +0 -13
  145. package/types/calendar/index.d.ts +0 -4
  146. package/types/calendar/internal/CalendarCarousel.d.ts +0 -3
  147. package/types/calendar/internal/CalendarContext.d.ts +0 -8
  148. package/types/calendar/internal/CalendarDay.d.ts +0 -14
  149. package/types/calendar/internal/CalendarMonth.d.ts +0 -10
  150. package/types/calendar/internal/CalendarNavigation.d.ts +0 -16
  151. package/types/calendar/internal/CalendarWeekHeader.d.ts +0 -3
  152. package/types/calendar/internal/useFocusManagement.d.ts +0 -9
  153. package/types/calendar/internal/utils.d.ts +0 -15
  154. package/types/calendar/useCalendar.d.ts +0 -54
  155. package/types/calendar/useCalendarDay.d.ts +0 -22
  156. package/types/calendar/useSelection.d.ts +0 -78
  157. package/types/column-picker/ColumnPicker.d.ts +0 -7
  158. package/types/column-picker/ColumnSearch.d.ts +0 -6
  159. package/types/column-picker/index.d.ts +0 -2
  160. package/types/column-picker/moving-window.d.ts +0 -14
  161. package/types/common-hooks/collectionProvider.d.ts +0 -13
  162. package/types/common-hooks/collectionTypes.d.ts +0 -58
  163. package/types/common-hooks/index.d.ts +0 -8
  164. package/types/common-hooks/isPlainObject.d.ts +0 -1
  165. package/types/common-hooks/itemToString.d.ts +0 -2
  166. package/types/common-hooks/navigationTypes.d.ts +0 -36
  167. package/types/common-hooks/selectionTypes.d.ts +0 -70
  168. package/types/common-hooks/use-resize-observer.d.ts +0 -16
  169. package/types/common-hooks/useCollectionItems.d.ts +0 -2
  170. package/types/common-hooks/useControlled.d.ts +0 -24
  171. package/types/common-hooks/useSelection.d.ts +0 -8
  172. package/types/cycle-state-button/CycleStateButton.d.ts +0 -11
  173. package/types/cycle-state-button/index.d.ts +0 -1
  174. package/types/date-input/DateInput.d.ts +0 -60
  175. package/types/date-input/index.d.ts +0 -1
  176. package/types/date-picker/DatePicker.d.ts +0 -66
  177. package/types/date-picker/DatePickerContext.d.ts +0 -19
  178. package/types/date-picker/DatePickerPanel.d.ts +0 -10
  179. package/types/date-picker/index.d.ts +0 -1
  180. package/types/drag-drop/DragDropProvider.d.ts +0 -38
  181. package/types/drag-drop/DragDropState.d.ts +0 -15
  182. package/types/drag-drop/Draggable.d.ts +0 -13
  183. package/types/drag-drop/DropIndicator.d.ts +0 -5
  184. package/types/drag-drop/dragDropTypes.d.ts +0 -100
  185. package/types/drag-drop/drop-target-utils.d.ts +0 -82
  186. package/types/drag-drop/index.d.ts +0 -6
  187. package/types/drag-drop/useAutoScroll.d.ts +0 -11
  188. package/types/drag-drop/useDragDisplacers.d.ts +0 -17
  189. package/types/drag-drop/useDragDrop.d.ts +0 -2
  190. package/types/drag-drop/useDragDropCopy.d.ts +0 -6
  191. package/types/drag-drop/useDragDropIndicator.d.ts +0 -2
  192. package/types/drag-drop/useDragDropNaturalMovement.d.ts +0 -2
  193. package/types/drag-drop/useDropIndicator.d.ts +0 -8
  194. package/types/drag-drop/useGlobalDragDrop.d.ts +0 -11
  195. package/types/drag-drop/useTransition.d.ts +0 -3
  196. package/types/editable/index.d.ts +0 -1
  197. package/types/editable/useEditableText.d.ts +0 -19
  198. package/types/editable-label/EditableLabel.d.ts +0 -19
  199. package/types/editable-label/index.d.ts +0 -1
  200. package/types/expando-input/ExpandoInput.d.ts +0 -6
  201. package/types/expando-input/index.d.ts +0 -1
  202. package/types/icon-button/Icon.d.ts +0 -6
  203. package/types/icon-button/IconButton.d.ts +0 -6
  204. package/types/icon-button/ToggleIconButton.d.ts +0 -5
  205. package/types/icon-button/index.d.ts +0 -3
  206. package/types/index.d.ts +0 -27
  207. package/types/instrument-picker/SearchCell.d.ts +0 -2
  208. package/types/instrument-picker/TablePicker.d.ts +0 -10
  209. package/types/instrument-picker/index.d.ts +0 -1
  210. package/types/instrument-picker/moving-window.d.ts +0 -14
  211. package/types/instrument-picker/useDataSource.d.ts +0 -6
  212. package/types/instrument-picker/useTablePicker.d.ts +0 -47
  213. package/types/list/ChevronIcon.d.ts +0 -7
  214. package/types/list/Highlighter.d.ts +0 -6
  215. package/types/list/List.d.ts +0 -6
  216. package/types/list/ListItem.d.ts +0 -6
  217. package/types/list/ListItemGroup.d.ts +0 -6
  218. package/types/list/ListItemHeader.d.ts +0 -5
  219. package/types/list/RadioIcon.d.ts +0 -4
  220. package/types/list/common-hooks/index.d.ts +0 -10
  221. package/types/list/common-hooks/keyUtils.d.ts +0 -14
  222. package/types/list/common-hooks/list-dom-utils.d.ts +0 -5
  223. package/types/list/common-hooks/useCollapsibleGroups.d.ts +0 -14
  224. package/types/list/common-hooks/useImperativeScrollingAPI.d.ts +0 -14
  225. package/types/list/common-hooks/useKeyboardNavigation.d.ts +0 -3
  226. package/types/list/common-hooks/useTypeahead.d.ts +0 -14
  227. package/types/list/common-hooks/useViewportTracking.d.ts +0 -14
  228. package/types/list/common-hooks/utils/collection-item-utils.d.ts +0 -21
  229. package/types/list/common-hooks/utils/filter-utils.d.ts +0 -4
  230. package/types/list/common-hooks/utils/index.d.ts +0 -4
  231. package/types/list/common-hooks/utils/isSelected.d.ts +0 -2
  232. package/types/list/index.d.ts +0 -9
  233. package/types/list/keyset.d.ts +0 -9
  234. package/types/list/listTypes.d.ts +0 -200
  235. package/types/list/useList.d.ts +0 -3
  236. package/types/list/useListDrop.d.ts +0 -15
  237. package/types/list/useListHeight.d.ts +0 -19
  238. package/types/list/useScrollPosition.d.ts +0 -19
  239. package/types/measured-container/MeasuredContainer.d.ts +0 -14
  240. package/types/measured-container/index.d.ts +0 -2
  241. package/types/measured-container/useMeasuredContainer.d.ts +0 -23
  242. package/types/measured-container/useResizeObserver.d.ts +0 -15
  243. package/types/overflow-container/OverflowContainer.d.ts +0 -15
  244. package/types/overflow-container/index.d.ts +0 -2
  245. package/types/overflow-container/overflow-utils.d.ts +0 -48
  246. package/types/overflow-container/useOverflowContainer.d.ts +0 -19
  247. package/types/price-ticker/PriceTicker.d.ts +0 -7
  248. package/types/price-ticker/index.d.ts +0 -1
  249. package/types/split-button/SplitButton.d.ts +0 -11
  250. package/types/split-button/SplitStateButton.d.ts +0 -5
  251. package/types/split-button/index.d.ts +0 -2
  252. package/types/split-button/useSplitButton.d.ts +0 -311
  253. package/types/table-search/SearchCell.d.ts +0 -2
  254. package/types/table-search/TableSearch.d.ts +0 -9
  255. package/types/table-search/index.d.ts +0 -1
  256. package/types/table-search/moving-window.d.ts +0 -14
  257. package/types/table-search/useTableSearch.d.ts +0 -15
  258. package/types/tabs-next/TabBar.d.ts +0 -12
  259. package/types/tabs-next/TabListNext.d.ts +0 -12
  260. package/types/tabs-next/TabNext.d.ts +0 -12
  261. package/types/tabs-next/TabNextAction.d.ts +0 -5
  262. package/types/tabs-next/TabNextContext.d.ts +0 -12
  263. package/types/tabs-next/TabNextPanel.d.ts +0 -8
  264. package/types/tabs-next/TabNextTrigger.d.ts +0 -5
  265. package/types/tabs-next/TabOverflowList.d.ts +0 -11
  266. package/types/tabs-next/TabsNext.d.ts +0 -17
  267. package/types/tabs-next/TabsNextContext.d.ts +0 -21
  268. package/types/tabs-next/hooks/useCollection.d.ts +0 -18
  269. package/types/tabs-next/hooks/useFocusOutside.d.ts +0 -2
  270. package/types/tabs-next/hooks/useOverflow.d.ts +0 -11
  271. package/types/tabs-next/index.d.ts +0 -7
  272. package/types/tabstrip/Tab.d.ts +0 -27
  273. package/types/tabstrip/TabMenu.d.ts +0 -23
  274. package/types/tabstrip/TabMenuOptions.d.ts +0 -10
  275. package/types/tabstrip/TabsTypes.d.ts +0 -127
  276. package/types/tabstrip/Tabstrip.d.ts +0 -2
  277. package/types/tabstrip/index.d.ts +0 -5
  278. package/types/tabstrip/tabstrip-dom-utils.d.ts +0 -2
  279. package/types/tabstrip/useAnimatedSelectionThumb.d.ts +0 -7
  280. package/types/tabstrip/useKeyboardNavigation.d.ts +0 -29
  281. package/types/tabstrip/useSelection.d.ts +0 -13
  282. package/types/tabstrip/useTabstrip.d.ts +0 -55
  283. package/types/toolbar/Toolbar.d.ts +0 -19
  284. package/types/toolbar/index.d.ts +0 -1
  285. package/types/toolbar/toolbar-dom-utils.d.ts +0 -3
  286. package/types/toolbar/useKeyboardNavigation.d.ts +0 -32
  287. package/types/toolbar/useSelection.d.ts +0 -22
  288. package/types/toolbar/useToolbar.d.ts +0 -28
  289. package/types/utils/deprecated-types.d.ts +0 -2
  290. package/types/utils/escapeRegExp.d.ts +0 -1
  291. package/types/utils/forwardCallbackProps.d.ts +0 -3
  292. package/types/utils/index.d.ts +0 -5
  293. package/types/utils/isOverflowElement.d.ts +0 -1
  294. package/types/utils/isPlainObject.d.ts +0 -1
  295. package/types/vuu-date-picker/VuuDatePicker.d.ts +0 -7
  296. package/types/vuu-date-picker/index.d.ts +0 -1
  297. package/types/vuu-input/VuuInput.d.ts +0 -17
  298. package/types/vuu-input/index.d.ts +0 -1
  299. package/types/vuu-typeahead-input/VuuTypeaheadInput.d.ts +0 -29
  300. package/types/vuu-typeahead-input/index.d.ts +0 -1
  301. package/types/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +0 -15
@@ -1,58 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface CollectionIndexer {
3
- value: number;
4
- }
5
- export interface CollectionItemBase<T> {
6
- id: string;
7
- description?: string;
8
- disabled?: boolean;
9
- focusable?: false | undefined;
10
- index?: number;
11
- label?: string;
12
- value: T | null;
13
- }
14
- export interface CollectionItem<T> extends CollectionItemBase<T> {
15
- childNodes?: CollectionItem<T>[];
16
- count?: number;
17
- expanded?: boolean;
18
- header?: boolean;
19
- level?: number;
20
- selectable?: boolean;
21
- }
22
- export interface SourceGroup<T> {
23
- childNodes: T[];
24
- }
25
- export type CollectionOptions<T> = {
26
- collapsibleHeaders?: boolean;
27
- defaultExpanded?: boolean;
28
- disableFilter?: boolean;
29
- filterPattern?: string;
30
- getFilterRegex?: (inputValue: string) => RegExp;
31
- getItemId?: (indexOfItem: number) => string;
32
- noChildrenLabel?: string;
33
- itemToString?: (item: T) => string;
34
- revealSelected?: boolean | T | T[];
35
- };
36
- export type CollectionHookProps<T> = {
37
- children?: ReactNode;
38
- id: string;
39
- label?: string;
40
- source?: ReadonlyArray<T>;
41
- options?: CollectionOptions<T>;
42
- };
43
- export type CollectionHookResult<T> = {
44
- /** set expanded to false for target */
45
- collapseGroupItem: (item: CollectionItem<T>) => void;
46
- /** data items from the collection to be rendered */
47
- data: CollectionItem<T>[];
48
- /** set expanded to true for target */
49
- expandGroupItem: (item: CollectionItem<T>) => void;
50
- setFilterPattern: (pattern: undefined | string) => void;
51
- indexOfItemById: (id: string) => number;
52
- itemById: (id: string) => T | never;
53
- itemToCollectionItem: (item: T) => CollectionItem<T> | CollectionItem<T>[] | null | undefined;
54
- itemToCollectionItemId: (item?: T | T[]) => string[] | undefined;
55
- stringToCollectionItem: (item: string | null | undefined) => CollectionItem<T> | null | CollectionItem<T>[] | undefined;
56
- toCollectionItem: (item: T) => CollectionItem<T>;
57
- itemToId: (item: T) => string;
58
- };
@@ -1,8 +0,0 @@
1
- export * from "./collectionProvider";
2
- export * from "./collectionTypes";
3
- export * from "./itemToString";
4
- export * from "./useCollectionItems";
5
- export * from "./useControlled";
6
- export * from "./use-resize-observer";
7
- export * from "./navigationTypes";
8
- export * from "./selectionTypes";
@@ -1 +0,0 @@
1
- export declare const isPlainObject: (obj: unknown) => boolean;
@@ -1,2 +0,0 @@
1
- export type ItemToStringFunction = (item: any) => string;
2
- export declare function itemToString(item: unknown): string;
@@ -1,36 +0,0 @@
1
- import { FocusEvent, KeyboardEvent, RefObject } from "react";
2
- export interface NavigationProps {
3
- cycleFocus?: boolean;
4
- defaultHighlightedIndex?: number;
5
- disableHighlightOnFocus?: boolean;
6
- focusOnHighlight?: boolean;
7
- focusVisible?: number;
8
- highlightedIndex?: number;
9
- itemCount: number;
10
- onHighlight?: (idx: number) => void;
11
- onKeyboardNavigation?: (evt: KeyboardEvent, idx: number) => void;
12
- restoreLastFocus?: boolean;
13
- viewportItemCount: number;
14
- }
15
- export interface NavigationHookProps extends NavigationProps {
16
- containerRef: RefObject<HTMLElement | null>;
17
- label?: string;
18
- selected?: string[];
19
- }
20
- export interface KeyboardHookContainerProps {
21
- onBlur: (evt: FocusEvent) => void;
22
- onFocus: (evt: FocusEvent) => void;
23
- onKeyDown: (evt: KeyboardEvent) => void;
24
- onMouseDownCapture: () => void;
25
- onMouseMove: () => void;
26
- onMouseLeave: () => void;
27
- }
28
- export interface NavigationHookResult {
29
- focusVisible: number;
30
- controlledHighlighting: boolean;
31
- highlightedIndex: number;
32
- setHighlightedIndex: (idx: number) => void;
33
- keyboardNavigation: RefObject<boolean>;
34
- containerProps: KeyboardHookContainerProps;
35
- setIgnoreFocus: (ignoreFocus: boolean) => void;
36
- }
@@ -1,70 +0,0 @@
1
- import { MouseEventHandler, RefObject, SyntheticEvent } from "react";
2
- export type SelectionDisallowed = "none";
3
- export type SingleSelectionStrategy = "default" | "deselectable";
4
- export type MultiSelectionStrategy = "multiple" | "extended" | "extended-multi-range";
5
- /**
6
- * SpecialKeyMultiple works as deselectable unless a special key
7
- * (default SHIFT) is also pressed, then it allows multiple selection.
8
- * Useful for column sorting, filters etc
9
- */
10
- export type SpecialKeyMultipleSelection = "multiple-special-key";
11
- export type SelectionStrategy = SelectionDisallowed | SingleSelectionStrategy | MultiSelectionStrategy;
12
- export declare const isSingleSelection: (s?: SelectionStrategy) => s is SingleSelectionStrategy;
13
- export declare const isMultiSelection: (s?: SelectionStrategy) => s is MultiSelectionStrategy;
14
- export type SelectHandler<Item = string> = (event: SyntheticEvent, selectedItem: Item) => void;
15
- export declare const selectionIsDisallowed: (selection?: SelectionStrategy | SpecialKeyMultipleSelection) => selection is SelectionDisallowed;
16
- export declare const allowMultipleSelection: (selectionStrategy: SelectionStrategy | SpecialKeyMultipleSelection, specialKey?: boolean) => boolean;
17
- export declare const deselectionIsAllowed: (selection?: SelectionStrategy | SpecialKeyMultipleSelection) => selection is "deselectable" | MultiSelectionStrategy;
18
- export declare const hasSelection: <Item = unknown>(selected?: Item[]) => boolean;
19
- export declare const getFirstSelectedItem: <Item = unknown>(selected: Item[]) => Item;
20
- interface SelectionProps {
21
- defaultSelected?: string[];
22
- onSelect?: SelectHandler;
23
- onSelectionChange?: MultiSelectionHandler;
24
- selected?: string[];
25
- selectionStrategy?: SelectionStrategy;
26
- }
27
- export interface ListHandlers {
28
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
29
- onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;
30
- onKeyboardNavigation?: (event: React.KeyboardEvent, currentIndex: number) => void;
31
- onMouseMove?: (event: React.MouseEvent) => void;
32
- }
33
- export interface SelectionHookProps extends SelectionProps {
34
- containerRef: RefObject<HTMLElement | null>;
35
- disableSelection?: boolean;
36
- highlightedIndex: number;
37
- itemQuery: string;
38
- label?: string;
39
- onClick?: MouseEventHandler;
40
- selectionKeys?: string[];
41
- tabToSelect?: boolean;
42
- }
43
- export interface SelectionHookResult {
44
- listHandlers: ListHandlers;
45
- selected: string[];
46
- setSelected: (selected: string[]) => void;
47
- }
48
- /**
49
- * evt is only null in the special case of a selection fired from a multi-select
50
- * host on tab or selection based on freeform text in combobox
51
- */
52
- export type MultiSelectionHandler<Item = string> = (event: SyntheticEvent | null, selected: Item[]) => void;
53
- /**
54
- * evt is only null in the special case of freeform text in combobox
55
- */
56
- export type SingleSelectionHandler<Item = string> = (event: SyntheticEvent | null, selected: Item) => void;
57
- export type SelectionType<I, S extends SelectionStrategy> = S extends MultiSelectionStrategy ? I[] : I | null;
58
- export interface ComponentSelectionProps<Item = string, S extends SelectionStrategy = "default"> {
59
- defaultSelected?: S extends MultiSelectionStrategy ? Item[] : Item;
60
- onSelect?: SelectHandler<Item>;
61
- onSelectionChange?: S extends MultiSelectionStrategy ? MultiSelectionHandler<Item> : SingleSelectionHandler<Item>;
62
- selected?: SelectionType<Item, S>;
63
- selectionStrategy?: S;
64
- /**
65
- * The keyboard keys used to effect selection, defaults to SPACE and ENTER
66
- * TODO maybe this belongs on the SelectionProps interface ?
67
- */
68
- selectionKeys?: string[];
69
- }
70
- export {};
@@ -1,16 +0,0 @@
1
- import { RefObject } from "react";
2
- export declare const WidthHeight: string[];
3
- export declare const WidthOnly: string[];
4
- export declare const HeightOnly: string[];
5
- export type measurements<T = string | number> = {
6
- height?: T;
7
- clientHeight?: number;
8
- clientWidth?: number;
9
- contentHeight?: number;
10
- contentWidth?: number;
11
- scrollHeight?: number;
12
- scrollWidth?: number;
13
- width?: T;
14
- };
15
- export type ResizeHandler = (measurements: measurements<number>) => void;
16
- export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
@@ -1,2 +0,0 @@
1
- import { CollectionHookProps, CollectionHookResult } from "./collectionTypes";
2
- export declare const useCollectionItems: <Item>({ children, id: idRoot, options, source, }: CollectionHookProps<Item>) => CollectionHookResult<Item>;
@@ -1,24 +0,0 @@
1
- import { Dispatch, SetStateAction } from "react";
2
- export interface UseControlledProps<T> {
3
- /**
4
- * Holds the component value when it's controlled.
5
- */
6
- controlled?: T;
7
- /**
8
- * The default value when uncontrolled.
9
- */
10
- default: T;
11
- /**
12
- * The component name displayed in warnings.
13
- */
14
- name: string;
15
- /**
16
- * The name of the state variable displayed in warnings.
17
- */
18
- state?: string;
19
- }
20
- /**
21
- * Copied from MUI (v5) useControlled hook with one additional returned value
22
- * @see https://github.com/mui-org/material-ui/blob/0979e6a54ba47c278d1f535953c0520a86349811/packages/material-ui-utils/src/useControlled.js
23
- */
24
- export declare function useControlled<S>({ controlled, default: defaultProp, name, state, }: UseControlledProps<S>): [S, Dispatch<SetStateAction<S>>, boolean];
@@ -1,8 +0,0 @@
1
- import { SelectionHookProps, SelectionHookResult } from "./selectionTypes";
2
- export declare const CHECKBOX = "checkbox";
3
- export declare const GROUP_SELECTION_NONE = "none";
4
- export declare const GROUP_SELECTION_SINGLE = "single";
5
- export declare const GROUP_SELECTION_CASCADE = "cascade";
6
- export type GroupSelectionMode = "none" | "single" | "cascade";
7
- export declare const groupSelectionEnabled: (groupSelection: GroupSelectionMode) => boolean;
8
- export declare const useSelection: ({ containerRef, defaultSelected, disableSelection, highlightedIndex, itemQuery, onClick, onSelect, onSelectionChange, selected: selectedProp, selectionStrategy, selectionKeys, tabToSelect, }: SelectionHookProps) => SelectionHookResult;
@@ -1,11 +0,0 @@
1
- import { ButtonProps } from "@salt-ds/core";
2
- import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
3
- import type { CommitHandler } from "@vuu-ui/vuu-utils";
4
- export type CycleStateButtonChangeHandler = (value: VuuRowDataItemType) => void;
5
- export interface CycleStateButtonProps extends Omit<ButtonProps, "onChange"> {
6
- onChange?: CycleStateButtonChangeHandler;
7
- onCommit?: CommitHandler<HTMLButtonElement>;
8
- values: string[];
9
- value: string;
10
- }
11
- export declare const CycleStateButton: import("react").ForwardRefExoticComponent<CycleStateButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1 +0,0 @@
1
- export * from "./CycleStateButton";
@@ -1,60 +0,0 @@
1
- import { type ChangeEvent, type ComponentPropsWithoutRef, type InputHTMLAttributes, type ReactNode, type RefObject, type SyntheticEvent } from "react";
2
- import { type DateValue } from "@internationalized/date";
3
- import { type RangeSelectionValueType, type SingleSelectionValueType } from "../calendar";
4
- export interface DateInputProps<SelectionVariantType> extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange">, Pick<ComponentPropsWithoutRef<"input">, "disabled" | "placeholder"> {
5
- ariaLabel?: string;
6
- /**
7
- * The marker to use in an empty read only DateInput.
8
- * Use `''` to disable this feature. Defaults to '—'.
9
- */
10
- emptyReadOnlyMarker?: string;
11
- /**
12
- * End adornment component
13
- */
14
- endAdornment?: ReactNode;
15
- /**
16
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dateInput#Attributes) applied to the `input` elements.
17
- */
18
- inputProps?: InputHTMLAttributes<HTMLInputElement>;
19
- /**
20
- * If `true`, the component is read only.
21
- */
22
- readOnly?: boolean;
23
- /**
24
- * Validation status.
25
- */
26
- validationStatus?: "error" | "warning" | "success";
27
- /**
28
- * Styling variant. Defaults to "primary".
29
- */
30
- variant?: "primary" | "secondary";
31
- /**
32
- * Styling variant with full border. Defaults to false
33
- */
34
- bordered?: boolean;
35
- /**
36
- * Function to format the input value.
37
- */
38
- dateFormatter?: (input: DateValue | undefined) => string;
39
- /**
40
- * Reference for the startInput;
41
- */
42
- startInputRef?: RefObject<HTMLInputElement | null>;
43
- /**
44
- * Reference for the endInput;
45
- */
46
- endInputRef?: RefObject<HTMLInputElement | null>;
47
- /**
48
- * Selection variant. Defaults to single select.
49
- */
50
- selectionVariant?: "default" | "range";
51
- /**
52
- * Callback fired when the selected date change.
53
- */
54
- onSelectionChange?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
55
- /**
56
- * Callback fired when the input value change.
57
- */
58
- onChange?: SelectionVariantType extends SingleSelectionValueType ? (event: ChangeEvent<HTMLInputElement>, selectedDateInputValue?: string) => void : (event: ChangeEvent<HTMLInputElement>, startDateInputValue?: string, endDateInputValue?: string) => void;
59
- }
60
- export declare const DateInput: import("react").ForwardRefExoticComponent<DateInputProps<DateValue | RangeSelectionValueType> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export * from "./DateInput";
@@ -1,66 +0,0 @@
1
- import { type ChangeEvent, type SyntheticEvent } from "react";
2
- import { type DateValue } from "@internationalized/date";
3
- import { type CalendarProps, type RangeSelectionValueType, type SingleSelectionValueType } from "../calendar";
4
- import { type DateInputProps } from "../date-input";
5
- export interface DatePickerProps<SelectionVariantType> extends DateInputProps<SelectionVariantType> {
6
- /**
7
- * Selection variant. Defaults to single select.
8
- */
9
- selectionVariant?: "default" | "range";
10
- /**
11
- * If `true`, the component will be disabled.
12
- */
13
- disabled?: boolean;
14
- /**
15
- * The selected date value. Use when the component is controlled.
16
- * Can be a single date or an object with start and end dates for range selection.
17
- */
18
- selectedDate?: SelectionVariantType;
19
- /**
20
- * The default date value. Use when the component is not controlled.
21
- * Can be a single date or an object with start and end dates for range selection.
22
- */
23
- defaultSelectedDate?: SelectionVariantType;
24
- /**
25
- * Props to be passed to the Calendar component.
26
- */
27
- CalendarProps?: Partial<Omit<CalendarProps, "selectionVariant" | "selectedDate" | "defaultSelectedDate" | "onSelectedDateChange">>;
28
- /**
29
- * Function to format the input value.
30
- */
31
- dateFormatter?: (input: DateValue | undefined) => string;
32
- /**
33
- * Callback function triggered when open state changes.
34
- */
35
- onOpenChange?: (newOpen: boolean) => void;
36
- /**
37
- * Display or hide the component.
38
- */
39
- open?: boolean;
40
- /**
41
- * The default open value. Use when the component is not controlled.
42
- */
43
- defaultOpen?: boolean;
44
- /**
45
- * Helper text to display in the panel
46
- */
47
- helperText?: string;
48
- /**
49
- * Validation status.
50
- */
51
- validationStatus?: "error" | "warning" | "success";
52
- /**
53
- * Callback fired when the selected date change.
54
- */
55
- onSelectionChange?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
56
- /**
57
- * Callback fired when the input value change.
58
- */
59
- onChange?: SelectionVariantType extends SingleSelectionValueType ? (event: ChangeEvent<HTMLInputElement>, selectedDateInputValue?: string) => void : (event: ChangeEvent<HTMLInputElement>, startDateInputValue?: string, endDateInputValue?: string) => void;
60
- /**
61
- * Number of Calendars to be shown if selectionVariant is range.
62
- * 2 is the default value.
63
- */
64
- visibleMonths?: 1 | 2;
65
- }
66
- export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps<DateValue | RangeSelectionValueType> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,19 +0,0 @@
1
- import type { DateValue } from "@internationalized/date";
2
- import { type UseFloatingUIReturn } from "@salt-ds/core";
3
- import type { RangeSelectionValueType } from "../calendar";
4
- export interface DatePickerContextValue<SelectionVariantType> extends Partial<Pick<UseFloatingUIReturn, "context">> {
5
- openState: boolean;
6
- setOpen: (newOpen: boolean) => void;
7
- disabled: boolean;
8
- selectedDate: SelectionVariantType | undefined;
9
- defaultSelectedDate: SelectionVariantType | undefined;
10
- setSelectedDate: (newStartDate: SelectionVariantType | undefined) => void;
11
- startVisibleMonth: DateValue | undefined;
12
- setStartVisibleMonth: (newStartDate: DateValue | undefined) => void;
13
- endVisibleMonth: DateValue | undefined;
14
- setEndVisibleMonth: (newStartDate: DateValue | undefined) => void;
15
- selectionVariant: "default" | "range";
16
- getPanelPosition: () => Record<string, unknown>;
17
- }
18
- export declare const DatePickerContext: import("react").Context<DatePickerContextValue<DateValue | RangeSelectionValueType>>;
19
- export declare function useDatePickerContext(): DatePickerContextValue<DateValue | RangeSelectionValueType>;
@@ -1,10 +0,0 @@
1
- import { type DateValue } from "@internationalized/date";
2
- import { type ComponentPropsWithoutRef, type SyntheticEvent } from "react";
3
- import { type CalendarProps, type RangeSelectionValueType } from "../calendar";
4
- export interface DatePickerPanelProps<SelectionVariantType> extends ComponentPropsWithoutRef<"div"> {
5
- onSelect?: (event: SyntheticEvent, selectedDate?: SelectionVariantType) => void;
6
- helperText?: string;
7
- visibleMonths?: 1 | 2;
8
- CalendarProps?: Partial<Omit<CalendarProps, "selectionVariant" | "selectedDate" | "defaultSelectedDate" | "onSelectedDateChange">>;
9
- }
10
- export declare const DatePickerPanel: import("react").ForwardRefExoticComponent<DatePickerPanelProps<DateValue | RangeSelectionValueType> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export * from "./DatePicker";
@@ -1,38 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { DragDropState } from "./DragDropState";
3
- import { GlobalDropHandler, ResumeDragHandler } from "./useGlobalDragDrop";
4
- export type DragOutHandler = (id: string, dragDropState: DragDropState) => boolean;
5
- export type DragDropRegistrationFn = (id: string, resumeDrag: ResumeDragHandler | false, onDrop?: GlobalDropHandler) => void;
6
- export type EndOfDragOperationHandler = (id: string) => void;
7
- export interface DragDropContextProps {
8
- dragSources?: Map<string, string[]>;
9
- dropTargets?: Map<string, string[]>;
10
- onDragOut?: DragOutHandler;
11
- onEndOfDragOperation?: EndOfDragOperationHandler;
12
- registerDragDropParty: DragDropRegistrationFn;
13
- }
14
- export type DragSources = {
15
- [key: string]: {
16
- dropTargets: string | string[];
17
- payloadType?: string;
18
- };
19
- };
20
- export interface DragDropProviderProps {
21
- children: ReactNode;
22
- dragSources: DragSources;
23
- }
24
- export type MeasuredTarget = {
25
- bottom: number;
26
- left: number;
27
- right: number;
28
- top: number;
29
- };
30
- export declare const DragDropProvider: ({ children, dragSources: dragSourcesProp, }: DragDropProviderProps) => import("react/jsx-runtime").JSX.Element;
31
- export interface DragDropProviderResult {
32
- isDragSource?: boolean;
33
- isDropTarget?: boolean;
34
- onDragOut?: DragOutHandler;
35
- onEndOfDragOperation?: (id: string) => void;
36
- register: DragDropRegistrationFn;
37
- }
38
- export declare const useDragDropProvider: (id?: string) => DragDropProviderResult;
@@ -1,15 +0,0 @@
1
- import { MouseOffset, MousePosition } from "./dragDropTypes";
2
- export declare class DragDropState {
3
- /** Distance between start (top | left) of dragged element and point where user pressed to drag */
4
- readonly mouseOffset: MouseOffset;
5
- /** Element where the initial mousedown triggered the drag operation */
6
- readonly initialDragElement: HTMLElement;
7
- /** Element being dragged, (initial element cloned and rendered in portal). */
8
- draggableElement: HTMLElement | null;
9
- payload: unknown;
10
- constructor(mousePosition: MousePosition, dragElement: HTMLElement);
11
- /** Used to capture a ref to the Draggable ReactElement */
12
- setDraggable: (el: HTMLElement | null) => void;
13
- setPayload(payload: unknown): void;
14
- private getMouseOffset;
15
- }
@@ -1,13 +0,0 @@
1
- import { CSSProperties, HTMLAttributes, MutableRefObject, TransitionEventHandler } from "react";
2
- export interface DraggableProps extends HTMLAttributes<HTMLDivElement> {
3
- wrapperClassName: string;
4
- element: HTMLElement;
5
- onDropped?: () => void;
6
- onTransitionEnd?: TransitionEventHandler;
7
- scale?: number;
8
- style: CSSProperties;
9
- }
10
- export declare const Draggable: import("react").ForwardRefExoticComponent<DraggableProps & import("react").RefAttributes<HTMLDivElement>>;
11
- export declare const createDragSpacer: (transitioning?: MutableRefObject<boolean>) => HTMLElement;
12
- export declare const createDropIndicatorPosition: () => HTMLElement;
13
- export declare const createDropIndicator: (transitioning?: MutableRefObject<boolean>) => HTMLElement;
@@ -1,5 +0,0 @@
1
- import { Rect } from "./dragDropTypes";
2
- export declare const DropIndicator: import("react").ForwardRefExoticComponent<{
3
- className?: string;
4
- rect: Rect;
5
- } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,100 +0,0 @@
1
- import { MouseEventHandler, ReactElement, RefObject } from "react";
2
- import type { orientationType } from "@vuu-ui/vuu-utils";
3
- import { DragDropState } from "./DragDropState";
4
- export type ViewportRange = {
5
- atEnd: boolean;
6
- atStart: boolean;
7
- from: number;
8
- to: number;
9
- };
10
- type dimension = "width" | "height" | "scrollWidth" | "scrollHeight";
11
- type dimensions = {
12
- size: dimension;
13
- depth: dimension;
14
- scrollDepth: dimension;
15
- };
16
- export type dimensionsType = {
17
- horizontal: dimensions;
18
- vertical: dimensions;
19
- };
20
- export type dragStrategy = "drop-indicator" | "natural-movement" | "drag-copy" | "drop-only";
21
- export type Direction = "fwd" | "bwd";
22
- export declare const FWD: Direction;
23
- export declare const BWD: Direction;
24
- export interface MousePosition {
25
- clientX: number;
26
- clientY: number;
27
- }
28
- export interface MouseOffset {
29
- x: number;
30
- y: number;
31
- }
32
- export type Rect = {
33
- height: number;
34
- left: number;
35
- top: number;
36
- width: number;
37
- };
38
- export interface DragHookResult {
39
- draggable?: ReactElement;
40
- dropIndicator?: ReactElement;
41
- draggedItemIndex?: number;
42
- isDragging: boolean;
43
- isScrolling: RefObject<boolean>;
44
- onMouseDown?: MouseEventHandler;
45
- revealOverflowedItems?: boolean;
46
- }
47
- export interface InternalDragHookResult extends Omit<DragHookResult, "isDragging" | "isScrolling"> {
48
- beginDrag: (dragElement: HTMLElement) => void;
49
- drag: (dragPos: number, mouseMoveDirection: "fwd" | "bwd") => void;
50
- drop: () => DropOptions;
51
- handleScrollStart?: (scrollDirection: "fwd" | "bwd") => void;
52
- handleScrollStop?: (scrollDirection: "fwd" | "bwd", _scrollPos: number, atEnd: boolean) => void;
53
- /**
54
- * Draggable item has been dragged out of container. Remove any local drop
55
- * indicators. Dragged element itself should not yet be removed from DOM.
56
- */
57
- releaseDrag?: () => void;
58
- }
59
- export interface DropOptions {
60
- fromIndex: number;
61
- toIndex: number;
62
- isExternal?: boolean;
63
- payload?: unknown;
64
- }
65
- export type DragStartHandler = (dragDropState: DragDropState) => void;
66
- export type DropHandler = (options: DropOptions) => void;
67
- export interface DragDropProps {
68
- allowDragDrop?: boolean | dragStrategy;
69
- containerRef: RefObject<HTMLElement | null>;
70
- /** this is the className that will be assigned during drag to the dragged element */
71
- draggableClassName: string;
72
- extendedDropZone?: boolean;
73
- getDragPayload?: (dragElement: HTMLElement) => unknown;
74
- id?: string;
75
- isDragSource?: boolean;
76
- isDropTarget?: boolean;
77
- itemQuery?: string;
78
- onDragStart?: DragStartHandler;
79
- onDrop: DropHandler;
80
- onDropSettle?: (toIndex: number) => void;
81
- orientation: orientationType;
82
- /**
83
- * The scrolling container does not necessarily have to be a
84
- * descendant of the container, it may be an ancestor element;
85
- */
86
- scrollingContainerRef?: RefObject<HTMLElement | null>;
87
- viewportRange?: ViewportRange;
88
- }
89
- export type DragDropHook = (props: DragDropProps) => DragHookResult;
90
- export interface InternalDragDropProps extends Omit<DragDropProps, "draggableClassName" | "id" | "onDrop"> {
91
- isDragSource?: boolean;
92
- isDropTarget?: boolean;
93
- selected?: unknown;
94
- }
95
- export type DragDropContext = {
96
- dragElement: HTMLElement;
97
- dragPayload: unknown;
98
- mouseOffset: MouseOffset;
99
- };
100
- export {};