@vention/machine-ui 5.15.1 → 5.16.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/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ButtonProps, Theme } from "@mui/material";
|
|
2
2
|
import { Sizes, StrictExtract } from "../../theme/machine-ui-theme";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
+
import { DuotoneIconType, IconType } from "../vention-icon/vention-icon";
|
|
5
|
+
/**
|
|
6
|
+
* A button icon can either be an arbitrary React node (e.g. a custom SVG component) or a
|
|
7
|
+
* `VentionIcon` type name. When a type name is provided, the button renders a `VentionIcon`
|
|
8
|
+
* sized to match the button's size.
|
|
9
|
+
*/
|
|
10
|
+
export type VentionButtonIcon = ReactNode | IconType | DuotoneIconType;
|
|
4
11
|
interface StylingProperties {
|
|
5
12
|
backgroundColor: string;
|
|
6
13
|
backgroundColorOnHover: string;
|
|
@@ -17,8 +24,8 @@ export interface VentionButtonProps extends Omit<ButtonProps, "size" | "variant"
|
|
|
17
24
|
children?: ReactNode;
|
|
18
25
|
variant?: "filled-brand" | "filled" | "outline" | "text-only" | "shaded" | "destructive";
|
|
19
26
|
disabled?: boolean;
|
|
20
|
-
iconLeft?:
|
|
21
|
-
iconRight?:
|
|
27
|
+
iconLeft?: VentionButtonIcon;
|
|
28
|
+
iconRight?: VentionButtonIcon;
|
|
22
29
|
className?: string;
|
|
23
30
|
type?: "button" | "submit";
|
|
24
31
|
fullWidth?: boolean;
|
|
@@ -26,4 +33,5 @@ export interface VentionButtonProps extends Omit<ButtonProps, "size" | "variant"
|
|
|
26
33
|
}
|
|
27
34
|
export declare function getButtonStylingPropertiesGivenProps(variant: VentionButtonProps["variant"] | "simple", size: VentionButtonProps["size"], theme: Theme): StylingProperties;
|
|
28
35
|
export declare function getButtonHeight(size: VentionButtonProps["size"], theme: Theme): string;
|
|
36
|
+
export declare function getButtonIconSize(size: VentionButtonProps["size"]): number;
|
|
29
37
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Sizes, StrictExtract } from "../../theme/machine-ui-theme";
|
|
2
|
+
export type VentionComboboxSize = StrictExtract<Sizes, "small" | "medium" | "large">;
|
|
1
3
|
export interface VentionComboboxProps {
|
|
2
4
|
options: {
|
|
3
5
|
value: string;
|
|
@@ -9,6 +11,8 @@ export interface VentionComboboxProps {
|
|
|
9
11
|
value: string;
|
|
10
12
|
label: string;
|
|
11
13
|
}[] | undefined;
|
|
14
|
+
size: VentionComboboxSize;
|
|
15
|
+
labelText?: string | undefined;
|
|
12
16
|
placeholder?: string | undefined;
|
|
13
17
|
searchPlaceholder?: string | undefined;
|
|
14
18
|
value: string | null;
|
|
@@ -20,6 +24,7 @@ export interface VentionComboboxProps {
|
|
|
20
24
|
buttonDataTestId?: string | undefined;
|
|
21
25
|
inputDataTestId?: string | undefined;
|
|
22
26
|
clearButtonDataTestId?: string | undefined;
|
|
27
|
+
labelDataTestId?: string | undefined;
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* A custom combobox component with optional grouping, search, and clearable selection.
|
|
@@ -28,6 +33,8 @@ export interface VentionComboboxProps {
|
|
|
28
33
|
* @param {VentionComboboxProps} props - Props used to configure the component.
|
|
29
34
|
* @param {Array<{ value: string, label: string, group?: string, dataTestId?: string }>} props.options - List of selectable items. Items can optionally belong to a group.
|
|
30
35
|
* @param {Array<{ value: string, label: string }>} [props.groups] - Group data used for rendering labels above grouped options.
|
|
36
|
+
* @param {"small" | "medium" | "large"} props.size - Size of the trigger, search input, option typography, and icons.
|
|
37
|
+
* @param {string} [props.labelText] - Label rendered above the trigger. Its typography follows `size`.
|
|
31
38
|
* @param {string} [props.value] - Currently selected item value.
|
|
32
39
|
* @param {(value: string | null) => void} [props.onChange] - Callback fired when a user selects or clears an option.
|
|
33
40
|
* @param {boolean} [props.isClearable=false] - Whether the selected item can be cleared.
|
|
@@ -38,6 +45,7 @@ export interface VentionComboboxProps {
|
|
|
38
45
|
* @param {string} [props.buttonDataTestId] - Test ID applied to the button.
|
|
39
46
|
* @param {string} [props.inputDataTestId] - Test ID applied to the input field.
|
|
40
47
|
* @param {string} [props.clearButtonDataTestId] - Test ID applied to the clear icon inside the button.
|
|
48
|
+
* @param {string} [props.labelDataTestId] - Test ID applied to the label element.
|
|
41
49
|
* @param {boolean} [props.autoFocus=true] - Whether the search input should be focused when the menu opens.
|
|
42
50
|
*
|
|
43
51
|
* @returns {JSX.Element} The VentionCombobox component.
|