@vectara/vectara-ui 9.2.2 → 9.2.3
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.
|
@@ -3,5 +3,6 @@ import { Props as OptionsListProps } from "../optionsList/OptionsList";
|
|
|
3
3
|
import { Props as PopoverProps } from "../popover/Popover";
|
|
4
4
|
export type Props = Pick<PopoverProps, "isOpen" | "setIsOpen" | "onClickButton"> & Pick<OptionsListProps<any>, "options" | "onSelectOption"> & Pick<ButtonPrimaryProps, "children" | "icon" | "color" | "size" | "className" | "fullWidth" | "onClick" | "href" | "track"> & {
|
|
5
5
|
type?: "primary" | "secondary";
|
|
6
|
+
"data-testid"?: string;
|
|
6
7
|
};
|
|
7
|
-
export declare const VuiOptionsButton: ({ type, isOpen, setIsOpen, onClickButton, children, icon, color, size, className, fullWidth, onSelectOption, options, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const VuiOptionsButton: ({ type, isOpen, setIsOpen, onClickButton, children, icon, color, size, className, fullWidth, onSelectOption, options, "data-testid": testId, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,7 +19,7 @@ import { VuiIcon } from "../icon/Icon";
|
|
|
19
19
|
import { VuiPopover } from "../popover/Popover";
|
|
20
20
|
import { VuiButtonSecondary } from "../button/ButtonSecondary";
|
|
21
21
|
export const VuiOptionsButton = (_a) => {
|
|
22
|
-
var { type = "primary", isOpen, setIsOpen, onClickButton, children, icon, color, size, className, fullWidth, onSelectOption, options } = _a, rest = __rest(_a, ["type", "isOpen", "setIsOpen", "onClickButton", "children", "icon", "color", "size", "className", "fullWidth", "onSelectOption", "options"]);
|
|
22
|
+
var { type = "primary", isOpen, setIsOpen, onClickButton, children, icon, color, size, className, fullWidth, onSelectOption, options, "data-testid": testId } = _a, rest = __rest(_a, ["type", "isOpen", "setIsOpen", "onClickButton", "children", "icon", "color", "size", "className", "fullWidth", "onSelectOption", "options", "data-testid"]);
|
|
23
23
|
const Button = type === "primary" ? VuiButtonPrimary : VuiButtonSecondary;
|
|
24
|
-
return (_jsxs(VuiFlexContainer, Object.assign({ spacing: "none", alignItems: "center", className: className }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(Button, Object.assign({ icon: icon, color: color, size: size, className: "vuiOptionsButtonLeft", fullWidth: fullWidth }, rest, { children: children })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiPopover, Object.assign({ isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), onClickButton: onClickButton, button: _jsx(Button, { color: color, size: size, className: `vuiOptionsButtonRight vuiOptionsButtonRight--${color}`, isSelected: isOpen, icon: _jsx(VuiIcon, { children: _jsx(BiCaretDown, {}) }) }) }, { children: _jsx(VuiOptionsList, { onSelectOption: onSelectOption, options: options }) })) }))] })));
|
|
24
|
+
return (_jsxs(VuiFlexContainer, Object.assign({ spacing: "none", alignItems: "center", className: className }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(Button, Object.assign({ icon: icon, color: color, size: size, className: "vuiOptionsButtonLeft", fullWidth: fullWidth, "data-testid": testId }, rest, { children: children })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiPopover, Object.assign({ isOpen: isOpen, setIsOpen: () => setIsOpen(!isOpen), onClickButton: onClickButton, button: _jsx(Button, { color: color, size: size, className: `vuiOptionsButtonRight vuiOptionsButtonRight--${color}`, "data-testid": `${testId}-options`, isSelected: isOpen, icon: _jsx(VuiIcon, { children: _jsx(BiCaretDown, {}) }) }) }, { children: _jsx(VuiOptionsList, { onSelectOption: onSelectOption, options: options }) })) }))] })));
|
|
25
25
|
};
|