@vuu-ui/vuu-ui-controls 3.3.9 → 3.3.10

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 (139) hide show
  1. package/package.json +10 -10
  2. package/types/src/calendar/Calendar.d.ts +13 -0
  3. package/types/src/calendar/index.d.ts +4 -0
  4. package/types/src/calendar/internal/CalendarCarousel.d.ts +3 -0
  5. package/types/src/calendar/internal/CalendarContext.d.ts +8 -0
  6. package/types/src/calendar/internal/CalendarDay.d.ts +14 -0
  7. package/types/src/calendar/internal/CalendarMonth.d.ts +10 -0
  8. package/types/src/calendar/internal/CalendarNavigation.d.ts +16 -0
  9. package/types/src/calendar/internal/CalendarWeekHeader.d.ts +3 -0
  10. package/types/src/calendar/internal/useFocusManagement.d.ts +9 -0
  11. package/types/src/calendar/internal/utils.d.ts +15 -0
  12. package/types/src/calendar/useCalendar.d.ts +54 -0
  13. package/types/src/calendar/useCalendarDay.d.ts +22 -0
  14. package/types/src/calendar/useSelection.d.ts +78 -0
  15. package/types/src/column-picker/ColumnPicker.d.ts +7 -0
  16. package/types/src/column-picker/ColumnSearch.d.ts +12 -0
  17. package/types/src/column-picker/index.d.ts +2 -0
  18. package/types/src/column-picker/moving-window.d.ts +14 -0
  19. package/types/src/common-hooks/index.d.ts +3 -0
  20. package/types/src/common-hooks/selectionTypes.d.ts +70 -0
  21. package/types/src/common-hooks/use-resize-observer.d.ts +16 -0
  22. package/types/src/common-hooks/useControlled.d.ts +24 -0
  23. package/types/src/context-panel-provider/ContextPanelProvider.d.ts +17 -0
  24. package/types/src/cycle-state-button/CycleStateButton.d.ts +11 -0
  25. package/types/src/cycle-state-button/index.d.ts +1 -0
  26. package/types/src/date-input/DateInput.d.ts +60 -0
  27. package/types/src/date-input/index.d.ts +1 -0
  28. package/types/src/date-picker/DatePicker.d.ts +66 -0
  29. package/types/src/date-picker/DatePickerContext.d.ts +19 -0
  30. package/types/src/date-picker/DatePickerPanel.d.ts +10 -0
  31. package/types/src/date-picker/index.d.ts +1 -0
  32. package/types/src/drag-drop/DragDropProvider.d.ts +38 -0
  33. package/types/src/drag-drop/DragDropState.d.ts +15 -0
  34. package/types/src/drag-drop/Draggable.d.ts +13 -0
  35. package/types/src/drag-drop/DropIndicator.d.ts +5 -0
  36. package/types/src/drag-drop/dragDropTypes.d.ts +100 -0
  37. package/types/src/drag-drop/drop-target-utils.d.ts +82 -0
  38. package/types/src/drag-drop/index.d.ts +6 -0
  39. package/types/src/drag-drop/useAutoScroll.d.ts +11 -0
  40. package/types/src/drag-drop/useDragDisplacers.d.ts +17 -0
  41. package/types/src/drag-drop/useDragDrop.d.ts +2 -0
  42. package/types/src/drag-drop/useDragDropCopy.d.ts +6 -0
  43. package/types/src/drag-drop/useDragDropIndicator.d.ts +2 -0
  44. package/types/src/drag-drop/useDragDropNaturalMovement.d.ts +2 -0
  45. package/types/src/drag-drop/useDropIndicator.d.ts +8 -0
  46. package/types/src/drag-drop/useGlobalDragDrop.d.ts +11 -0
  47. package/types/src/drag-drop/useTransition.d.ts +3 -0
  48. package/types/src/editable/index.d.ts +1 -0
  49. package/types/src/editable/useEditableText.d.ts +21 -0
  50. package/types/src/editable-label/EditableLabel.d.ts +19 -0
  51. package/types/src/editable-label/index.d.ts +1 -0
  52. package/types/src/expando-input/ExpandoInput.d.ts +6 -0
  53. package/types/src/expando-input/index.d.ts +1 -0
  54. package/types/src/highlighter/Highlighter.d.ts +6 -0
  55. package/types/src/highlighter/index.d.ts +1 -0
  56. package/types/src/hover-overlay/HoverOverlay.d.ts +8 -0
  57. package/types/src/icon-button/Icon.d.ts +6 -0
  58. package/types/src/icon-button/IconButton.d.ts +6 -0
  59. package/types/src/icon-button/ToggleIconButton.d.ts +5 -0
  60. package/types/src/icon-button/index.d.ts +3 -0
  61. package/types/src/index.d.ts +33 -0
  62. package/types/src/instrument-picker/SearchCell.d.ts +2 -0
  63. package/types/src/instrument-picker/TablePicker.d.ts +11 -0
  64. package/types/src/instrument-picker/index.d.ts +1 -0
  65. package/types/src/instrument-picker/moving-window.d.ts +14 -0
  66. package/types/src/instrument-picker/useDataSource.d.ts +6 -0
  67. package/types/src/instrument-picker/useTablePicker.d.ts +47 -0
  68. package/types/src/item-picker/ItemPicker.d.ts +14 -0
  69. package/types/src/item-picker/useItemPicker.d.ts +35 -0
  70. package/types/src/measured-container/MeasuredContainer.d.ts +16 -0
  71. package/types/src/measured-container/index.d.ts +2 -0
  72. package/types/src/measured-container/useMeasuredContainer.d.ts +23 -0
  73. package/types/src/modal-provider/ModalProvider.d.ts +13 -0
  74. package/types/src/overflow-container/OverflowContainer.d.ts +15 -0
  75. package/types/src/overflow-container/index.d.ts +2 -0
  76. package/types/src/overflow-container/overflow-utils.d.ts +48 -0
  77. package/types/src/overflow-container/useOverflowContainer.d.ts +19 -0
  78. package/types/src/price-ticker/PriceTicker.d.ts +7 -0
  79. package/types/src/price-ticker/index.d.ts +1 -0
  80. package/types/src/prompt/Prompt.d.ts +53 -0
  81. package/types/src/sortable-list/SortableList.d.ts +8 -0
  82. package/types/src/split-button/SplitButton.d.ts +11 -0
  83. package/types/src/split-button/SplitStateButton.d.ts +5 -0
  84. package/types/src/split-button/index.d.ts +2 -0
  85. package/types/src/split-button/useSplitButton.d.ts +311 -0
  86. package/types/src/table-search/SearchCell.d.ts +2 -0
  87. package/types/src/table-search/TableSearch.d.ts +9 -0
  88. package/types/src/table-search/index.d.ts +1 -0
  89. package/types/src/table-search/moving-window.d.ts +14 -0
  90. package/types/src/table-search/useTableSearch.d.ts +15 -0
  91. package/types/src/tabs-next/TabBar.d.ts +12 -0
  92. package/types/src/tabs-next/TabListNext.d.ts +12 -0
  93. package/types/src/tabs-next/TabNext.d.ts +12 -0
  94. package/types/src/tabs-next/TabNextAction.d.ts +5 -0
  95. package/types/src/tabs-next/TabNextContext.d.ts +12 -0
  96. package/types/src/tabs-next/TabNextPanel.d.ts +8 -0
  97. package/types/src/tabs-next/TabNextTrigger.d.ts +5 -0
  98. package/types/src/tabs-next/TabOverflowList.d.ts +11 -0
  99. package/types/src/tabs-next/TabsNext.d.ts +17 -0
  100. package/types/src/tabs-next/TabsNextContext.d.ts +21 -0
  101. package/types/src/tabs-next/hooks/useCollection.d.ts +18 -0
  102. package/types/src/tabs-next/hooks/useFocusOutside.d.ts +2 -0
  103. package/types/src/tabs-next/hooks/useOverflow.d.ts +11 -0
  104. package/types/src/tabs-next/index.d.ts +7 -0
  105. package/types/src/tabstrip/Tab.d.ts +27 -0
  106. package/types/src/tabstrip/TabMenu.d.ts +23 -0
  107. package/types/src/tabstrip/TabMenuOptions.d.ts +10 -0
  108. package/types/src/tabstrip/TabsTypes.d.ts +127 -0
  109. package/types/src/tabstrip/Tabstrip.d.ts +3 -0
  110. package/types/src/tabstrip/index.d.ts +5 -0
  111. package/types/src/tabstrip/tabstrip-dom-utils.d.ts +2 -0
  112. package/types/src/tabstrip/useAnimatedSelectionThumb.d.ts +7 -0
  113. package/types/src/tabstrip/useKeyboardNavigation.d.ts +29 -0
  114. package/types/src/tabstrip/useSelection.d.ts +13 -0
  115. package/types/src/tabstrip/useTabstrip.d.ts +55 -0
  116. package/types/src/time-input/MaskedInput.d.ts +49 -0
  117. package/types/src/time-input/TimeInput.d.ts +5 -0
  118. package/types/src/time-input/useTimeInput.d.ts +21 -0
  119. package/types/src/toolbar/Toolbar.d.ts +20 -0
  120. package/types/src/toolbar/index.d.ts +1 -0
  121. package/types/src/toolbar/toolbar-dom-utils.d.ts +3 -0
  122. package/types/src/toolbar/useKeyboardNavigation.d.ts +32 -0
  123. package/types/src/toolbar/useSelection.d.ts +22 -0
  124. package/types/src/toolbar/useToolbar.d.ts +28 -0
  125. package/types/src/utils/deprecated-types.d.ts +2 -0
  126. package/types/src/utils/escapeRegExp.d.ts +1 -0
  127. package/types/src/utils/forwardCallbackProps.d.ts +3 -0
  128. package/types/src/utils/index.d.ts +5 -0
  129. package/types/src/utils/isOverflowElement.d.ts +1 -0
  130. package/types/src/utils/isPlainObject.d.ts +1 -0
  131. package/types/src/vuu-date-picker/VuuDatePicker.d.ts +7 -0
  132. package/types/src/vuu-date-picker/index.d.ts +1 -0
  133. package/types/src/vuu-input/VuuInput.d.ts +18 -0
  134. package/types/src/vuu-input/index.d.ts +1 -0
  135. package/types/src/vuu-time-picker/TimeRangePicker.d.ts +0 -0
  136. package/types/src/vuu-time-picker/VuuTimePicker.d.ts +7 -0
  137. package/types/src/vuu-typeahead-input/VuuTypeaheadInput.d.ts +6 -0
  138. package/types/src/vuu-typeahead-input/index.d.ts +1 -0
  139. package/types/src/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +49 -0
@@ -0,0 +1,32 @@
1
+ import { orientationType } from "@vuu-ui/vuu-utils";
2
+ import { FocusEvent, FocusEventHandler, KeyboardEvent, MouseEvent as ReactMouseEvent, MouseEventHandler, RefObject } from "react";
3
+ import { NavigationOutOfBoundsHandler } from "./Toolbar";
4
+ import { MenuCloseHandler } from "@vuu-ui/vuu-popups";
5
+ export interface ContainerNavigationProps {
6
+ onBlur: FocusEventHandler;
7
+ onFocus: FocusEventHandler;
8
+ onMouseDownCapture: MouseEventHandler;
9
+ onMouseLeave: MouseEventHandler;
10
+ }
11
+ interface ToolbarNavigationHookProps {
12
+ containerRef: RefObject<HTMLElement | null>;
13
+ defaultHighlightedIdx?: number;
14
+ highlightedIdx?: number;
15
+ onNavigateOutOfBounds?: NavigationOutOfBoundsHandler;
16
+ orientation: orientationType;
17
+ }
18
+ interface ToolbarNavigationHookResult {
19
+ containerProps: ContainerNavigationProps;
20
+ focusableIdx: number;
21
+ highlightedIdx: number;
22
+ focusItem: (itemIndex: number, immediateFocus?: boolean, withKeyboard?: boolean, delay?: number) => void;
23
+ focusVisible: number;
24
+ focusIsWithinComponent: boolean;
25
+ onClick: (evt: ReactMouseEvent, tabIndex: number) => void;
26
+ onFocus: (evt: FocusEvent<HTMLElement>) => void;
27
+ onKeyDown: (evt: KeyboardEvent) => void;
28
+ onOverflowMenuClose?: MenuCloseHandler;
29
+ setHighlightedIdx: (highlightedIndex: number) => void;
30
+ }
31
+ export declare const useKeyboardNavigation: ({ containerRef, defaultHighlightedIdx, highlightedIdx: highlightedIdxProp, onNavigateOutOfBounds, orientation, }: ToolbarNavigationHookProps) => ToolbarNavigationHookResult;
32
+ export {};
@@ -0,0 +1,22 @@
1
+ import { MouseEvent, RefObject } from "react";
2
+ import { SelectionStrategy, SpecialKeyMultipleSelection } from "../common-hooks";
3
+ export interface SelectionHookProps {
4
+ containerRef: RefObject<HTMLElement | null>;
5
+ defaultSelected?: number[];
6
+ highlightedIdx: number;
7
+ itemQuery: string;
8
+ onSelectionChange?: (selectedIndices: number[]) => void;
9
+ selected?: number[];
10
+ selectionStrategy: SelectionStrategy | SpecialKeyMultipleSelection;
11
+ }
12
+ export interface ItemHandlers {
13
+ onClick?: (e: MouseEvent, itemIndex: number) => void;
14
+ onKeyDown?: (event: React.KeyboardEvent) => void;
15
+ }
16
+ export interface SelectionHookResult {
17
+ activateItem: (tabIndex: number) => void;
18
+ itemHandlers: ItemHandlers;
19
+ isControlled: boolean;
20
+ selected: number[];
21
+ }
22
+ export declare const useSelection: ({ defaultSelected, highlightedIdx, onSelectionChange, selected: selectedProp, selectionStrategy, }: SelectionHookProps) => SelectionHookResult;
@@ -0,0 +1,28 @@
1
+ import { KeyboardEvent, MouseEvent as ReactMouseEvent, RefObject } from "react";
2
+ import { OverflowItem } from "../overflow-container";
3
+ import { ToolbarProps } from "./Toolbar";
4
+ export interface ToolbarHookProps extends Pick<ToolbarProps, "activeItemIndex" | "defaultActiveItemIndex" | "onActiveChange" | "onNavigateOutOfBounds">, Required<Pick<ToolbarProps, "orientation" | "selectionStrategy">> {
5
+ containerRef: RefObject<HTMLElement | null>;
6
+ itemQuery?: string;
7
+ }
8
+ export declare const useToolbar: ({ activeItemIndex: activeItemIndexProp, defaultActiveItemIndex, containerRef, itemQuery, onActiveChange, onNavigateOutOfBounds, orientation, selectionStrategy, }: ToolbarHookProps) => {
9
+ activeItemIndex: number[];
10
+ focusableIdx: number;
11
+ focusVisible: number;
12
+ containerProps: {
13
+ onBlur: import("react").FocusEventHandler;
14
+ onFocus: import("react").FocusEventHandler;
15
+ onMouseDownCapture: import("react").MouseEventHandler;
16
+ onMouseLeave: import("react").MouseEventHandler;
17
+ PopupMenuProps: {
18
+ onKeyDown: (evt: KeyboardEvent) => void;
19
+ onMenuClose: import("@vuu-ui/vuu-popups").MenuCloseHandler | undefined;
20
+ };
21
+ onSwitchWrappedItemIntoView: (item: OverflowItem) => void;
22
+ };
23
+ itemProps: {
24
+ onClick: (evt: ReactMouseEvent<HTMLElement>) => void;
25
+ onFocus: (evt: import("react").FocusEvent<HTMLElement>) => void;
26
+ onKeyDown: (evt: KeyboardEvent) => void;
27
+ };
28
+ };
@@ -0,0 +1,2 @@
1
+ export type CloseReason = "blur" | "Escape" | "click-away" | "select" | "script" | "Tab" | "toggle";
2
+ export type OpenChangeHandler = <T extends boolean>(open: T, closeReason?: T extends false ? CloseReason : never) => void;
@@ -0,0 +1 @@
1
+ export declare function escapeRegExp(string: string): string;
@@ -0,0 +1,3 @@
1
+ type Props = Record<string, unknown>;
2
+ export declare const forwardCallbackProps: <P1 extends Props, P2 extends Props>(ownProps: P1, overrideProps: P2) => P1 & P2;
3
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./escapeRegExp";
2
+ export * from "./isOverflowElement";
3
+ export * from "./isPlainObject";
4
+ export * from "./forwardCallbackProps";
5
+ export * from "./deprecated-types";
@@ -0,0 +1 @@
1
+ export declare const isOverflowElement: (element: HTMLElement | null) => boolean;
@@ -0,0 +1 @@
1
+ export declare const isPlainObject: (obj: Record<never, never>) => boolean;
@@ -0,0 +1,7 @@
1
+ import { CommitHandler } from "@vuu-ui/vuu-utils";
2
+ import { SingleSelectionValueType } from "../calendar";
3
+ import { DatePickerProps } from "../date-picker";
4
+ export declare const VuuDatePicker: ({ className, onSelectionChange, selectedDate: selectedDateProp, onCommit, preserveFocusOnSelect, ...props }: Omit<DatePickerProps<SingleSelectionValueType>, "defaultSelectedDate"> & {
5
+ onCommit?: CommitHandler<HTMLElement, number>;
6
+ preserveFocusOnSelect?: boolean;
7
+ }) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./VuuDatePicker";
@@ -0,0 +1,18 @@
1
+ import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
+ import { CommitHandler } from "@vuu-ui/vuu-utils";
3
+ import { InputProps } from "@salt-ds/core";
4
+ import { ForwardedRef, ReactElement, ReactNode } from "react";
5
+ export interface VuuInputProps<T extends VuuRowDataItemType = string> extends Omit<InputProps, "validationStatus"> {
6
+ commitOnBlur?: boolean;
7
+ commitWhenCleared?: boolean;
8
+ errorMessage?: ReactNode;
9
+ onCommit: CommitHandler;
10
+ type?: T;
11
+ }
12
+ /**
13
+ * A variant of Salt Input that provides a commit callback prop,
14
+ * TODO along with cancel behaviour ?
15
+ */
16
+ export declare const VuuInput: <T extends VuuRowDataItemType = string>(props: VuuInputProps<T> & {
17
+ ref?: ForwardedRef<HTMLDivElement>;
18
+ }) => ReactElement<VuuInputProps<T>>;
@@ -0,0 +1 @@
1
+ export * from "./VuuInput";
File without changes
@@ -0,0 +1,7 @@
1
+ import { CommitHandler, TimeString } from "@vuu-ui/vuu-utils";
2
+ import { HTMLAttributes } from "react";
3
+ import { TimeInputProps } from "../time-input/TimeInput";
4
+ export interface VuuTimePickerProps extends Pick<TimeInputProps, "defaultValue" | "onChange" | "value">, Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "value"> {
5
+ onCommit: CommitHandler<HTMLInputElement, TimeString>;
6
+ }
7
+ export declare const VuuTimePicker: ({ className, defaultValue, onChange, onCommit, value, ...htmlAttributes }: VuuTimePickerProps) => import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ComboBoxProps } from "@salt-ds/core";
2
+ import { VuuTypeaheadInputHookProps } from "./useVuuTypeaheadInput";
3
+ export interface VuuTypeaheadInputProps extends VuuTypeaheadInputHookProps, Pick<ComboBoxProps, "selectOnTab"> {
4
+ className?: string;
5
+ }
6
+ export declare const VuuTypeaheadInput: ({ allowFreeInput, className, column, freeTextWarning, highlightFirstSuggestion, inputProps: inputPropsProp, minCharacterCountToTriggerSuggestions, onCommit, selectOnTab, table, }: VuuTypeaheadInputProps) => import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./VuuTypeaheadInput";
@@ -0,0 +1,49 @@
1
+ import { PillInputProps } from "@salt-ds/core/dist-types/pill-input";
2
+ import { TableSchemaTable } from "@vuu-ui/vuu-data-types";
3
+ import { type CommitHandler } from "@vuu-ui/vuu-utils";
4
+ import { KeyboardEventHandler, type ChangeEventHandler, type RefCallback, type SyntheticEvent } from "react";
5
+ export interface VuuTypeaheadInputHookProps {
6
+ /**
7
+ * Allows a text string to be submitted that does not match any suggestion
8
+ * Defaults to true
9
+ */
10
+ allowFreeInput?: boolean;
11
+ column: string;
12
+ /**
13
+ * A warning to display to the user if allowFreeText is false and they attempt
14
+ * to commit text which does not match any suggestions. A default message will
15
+ * be shown if not provided
16
+ */
17
+ freeTextWarning?: string;
18
+ /**
19
+ * When suggestions are displayed, should first option be highlighted ?
20
+ * Highlighted option will be selected if Enter pressed. If this option
21
+ * is not applied and no suggestion is highlighted, Enter will commit
22
+ * current text. This will be desirable if filter operator will be
23
+ * 'contains', not if filter operator will be '='.
24
+ */
25
+ highlightFirstSuggestion?: boolean;
26
+ inputProps?: PillInputProps["inputProps"];
27
+ /**
28
+ * If zero, suggestions will be shown even without any text input.
29
+ * Suggestions will be displayed on click, or, if focused via keynoard,
30
+ * on ArrowDown.
31
+ * If n, where n > 0, then n characters must be typed before suggestion
32
+ * list will be fetched.
33
+ */
34
+ minCharacterCountToTriggerSuggestions?: 0 | 1 | 2 | 3;
35
+ onCommit: CommitHandler<HTMLInputElement>;
36
+ table: TableSchemaTable;
37
+ }
38
+ export declare const useVuuTypeaheadInput: ({ allowFreeInput, column, freeTextWarning, highlightFirstSuggestion, inputProps: inputPropsProp, minCharacterCountToTriggerSuggestions, onCommit, table, }: VuuTypeaheadInputHookProps) => {
39
+ inputProps: Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">;
40
+ noFreeText: string;
41
+ onChange: ChangeEventHandler<HTMLInputElement>;
42
+ onKeyDown: KeyboardEventHandler<HTMLInputElement>;
43
+ onOpenChange: (newOpen: boolean) => void;
44
+ onSelectionChange: (evt: SyntheticEvent, [newSelected]: string[]) => void;
45
+ open: boolean;
46
+ ref: RefCallback<HTMLDivElement>;
47
+ typeaheadValues: string[];
48
+ value: string;
49
+ };