@vention/machine-ui 5.22.0 → 5.24.0
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.
- package/index.esm.js +3517 -2689
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/components/vention-menu/vention-menu-item/vention-menu-item.d.ts +2 -0
- package/src/lib/components/vention-menu/vention-menu-list.d.ts +2 -1
- package/src/lib/components/vention-select/vention-select.d.ts +10 -1
- package/src/lib/components/vention-suggestions-input/vention-suggestions-input.d.ts +27 -0
- package/src/lib/components/vention-suggestions-input/vention-suggestions-list.d.ts +19 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./lib/components/vention-spinner/vention-spinner";
|
|
|
15
15
|
export * from "./lib/components/vention-steps/vention-steps";
|
|
16
16
|
export * from "./lib/components/vention-status-dot/vention-status-dot";
|
|
17
17
|
export * from "./lib/components/vention-text-input/vention-text-input";
|
|
18
|
+
export * from "./lib/components/vention-suggestions-input/vention-suggestions-input";
|
|
18
19
|
export * from "./lib/components/vention-radio/vention-radio";
|
|
19
20
|
export * from "./lib/components/vention-radio/vention-radio-tile/vention-radio-tile";
|
|
20
21
|
export * from "./lib/components/vention-select/vention-select";
|
|
@@ -2,6 +2,8 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import { TestProps } from "../../shared/types/test-props";
|
|
3
3
|
interface BaseProps extends TestProps {
|
|
4
4
|
onClick?: (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
5
|
+
onMouseEnter?: (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
|
|
6
|
+
className?: string;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
leftElement?: ReactNode;
|
|
7
9
|
shortcutKey?: string;
|
|
@@ -13,5 +13,6 @@ export type VentionMenuListProps = PropsWithChildren<TestProps & {
|
|
|
13
13
|
*/
|
|
14
14
|
menuOptionsInfo?: VentionMenuItemProps[];
|
|
15
15
|
disableBoxShadow?: boolean;
|
|
16
|
+
className?: string;
|
|
16
17
|
}>;
|
|
17
|
-
export declare const VentionMenuList: ({ menuOptionsInfo, "data-testid": dataTestId, children, disableBoxShadow, }: VentionMenuListProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const VentionMenuList: ({ menuOptionsInfo, "data-testid": dataTestId, children, disableBoxShadow, className, }: VentionMenuListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,21 +2,30 @@ import { SelectChangeEvent, SelectProps } from "@mui/material";
|
|
|
2
2
|
import { Sizes, StrictExtract } from "../../theme/machine-ui-theme";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { InputStates } from "../shared/types/input-types";
|
|
5
|
+
import { DuotoneIconType, IconType } from "../vention-icon/vention-icon";
|
|
5
6
|
export type VentionSelectMenuItem<T> = {
|
|
7
|
+
type?: never;
|
|
6
8
|
value: T;
|
|
7
9
|
displayText?: string;
|
|
8
10
|
displayNode?: ReactNode;
|
|
11
|
+
icon?: IconType | DuotoneIconType;
|
|
12
|
+
helperText?: string;
|
|
9
13
|
};
|
|
14
|
+
export type VentionSelectDivider = {
|
|
15
|
+
type: "divider";
|
|
16
|
+
};
|
|
17
|
+
export type VentionSelectItem<T> = VentionSelectMenuItem<T> | VentionSelectDivider;
|
|
10
18
|
export interface VentionSelectProps extends Omit<SelectProps, "placeholder" | "size" | "defaultValue" | "label"> {
|
|
11
19
|
size: StrictExtract<Sizes, "small" | "medium" | "large" | "x-large" | "xx-large">;
|
|
12
20
|
variant: "outlined";
|
|
13
21
|
value: string | number | string[] | number[] | undefined;
|
|
14
22
|
onChange: (event: SelectChangeEvent<VentionSelectProps["value"]>, child: ReactNode) => void;
|
|
15
|
-
menuItems: ReadonlyArray<
|
|
23
|
+
menuItems: ReadonlyArray<VentionSelectItem<string | number | undefined>>;
|
|
16
24
|
labelText?: string;
|
|
17
25
|
isDisabled?: boolean;
|
|
18
26
|
placeholder?: string;
|
|
19
27
|
errorText?: string;
|
|
28
|
+
helperText?: string;
|
|
20
29
|
isMultiple?: boolean;
|
|
21
30
|
state?: StrictExtract<InputStates, "default" | "warning">;
|
|
22
31
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VentionTextInputProps } from "../vention-text-input/vention-text-input";
|
|
2
|
+
import { VentionSuggestionProps } from "./vention-suggestions-list";
|
|
3
|
+
export declare const DEFAULT_MIN_SUGGESTION_CHARACTERS = 1;
|
|
4
|
+
export declare const DEFAULT_MAX_VISIBLE_SUGGESTIONS = 50;
|
|
5
|
+
interface BaseSuggestionsInputProps extends Omit<VentionTextInputProps, "value" | "defaultValue" | "select" | "size" | "InputProps" | "inputProps"> {
|
|
6
|
+
suggestions: VentionSuggestionProps[];
|
|
7
|
+
size?: VentionTextInputProps["size"];
|
|
8
|
+
InputProps?: Omit<NonNullable<VentionTextInputProps["InputProps"]>, "ref">;
|
|
9
|
+
inputProps?: Omit<NonNullable<VentionTextInputProps["inputProps"]>, "autoComplete"> & {
|
|
10
|
+
autoComplete?: never;
|
|
11
|
+
};
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
onSuggestionSelect?: (suggestion: VentionSuggestionProps) => void;
|
|
14
|
+
getSelectedText?: (suggestion: VentionSuggestionProps) => string;
|
|
15
|
+
minSuggestionCharacters?: number;
|
|
16
|
+
maxVisibleSuggestions?: number;
|
|
17
|
+
suggestionsDataTestId?: string;
|
|
18
|
+
}
|
|
19
|
+
export type VentionSuggestionsInputProps = (BaseSuggestionsInputProps & {
|
|
20
|
+
value: string;
|
|
21
|
+
defaultValue?: never;
|
|
22
|
+
}) | (BaseSuggestionsInputProps & {
|
|
23
|
+
value?: never;
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
});
|
|
26
|
+
export declare const VentionSuggestionsInput: ({ suggestions, size, state, value, defaultValue, onValueChange, onSuggestionSelect, getSelectedText, minSuggestionCharacters, maxVisibleSuggestions, suggestionsDataTestId, onChange, onFocus, onBlur, onKeyDown, ...textInputProps }: VentionSuggestionsInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { TestProps } from "../shared/types/test-props";
|
|
3
|
+
import { VentionTextInputProps } from "../vention-text-input/vention-text-input";
|
|
4
|
+
type SuggestionsSize = NonNullable<VentionTextInputProps["size"]>;
|
|
5
|
+
export interface VentionSuggestionProps extends TestProps {
|
|
6
|
+
value: string;
|
|
7
|
+
searchText?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface VentionSuggestionsListProps extends TestProps {
|
|
12
|
+
suggestions: VentionSuggestionProps[];
|
|
13
|
+
size: SuggestionsSize;
|
|
14
|
+
highlightedIndex: number;
|
|
15
|
+
onSelect: (suggestion: VentionSuggestionProps) => void;
|
|
16
|
+
onHighlight: (index: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const VentionSuggestionsList: ({ suggestions, size, highlightedIndex, onSelect, onHighlight, "data-testid": dataTestId, }: VentionSuggestionsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|