lucid-ui
Version:
A UI component library from Xandr.
161 lines • 6.5 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import { StandardProps } from '../../util/component-types';
import { IButtonProps } from '../Button/Button';
import { IDropMenuState, IDropMenuProps } from '../DropMenu/DropMenu';
import * as reducers from './SplitButton.reducers';
/** SplitButton Button Child Component */
export interface ISplitButtonButtonChildProps extends StandardProps {
/** Disables selection of the \`Button\`. */
isDisabled?: boolean;
}
/** SplitButton */
export interface ISplitButtonProps extends StandardProps {
/** Sets the direction the flyout menu will render relative to the SplitButton. */
direction: 'up' | 'down';
/** Style variations of the SplitButton. */
kind?: 'primary' | 'danger';
/** Size variations of the SplitButton. */
size?: 'short' | 'small' | 'large';
/** Form element type variations of SplitButton. Passed through to DOM Button. */
type?: string;
/** *Child Element* - props pass through to the underlying DropMenu component */
DropMenu: IDropMenuProps;
}
declare class SplitButton extends React.Component<ISplitButtonProps> {
static displayName: string;
static Button: {
(_props: ISplitButtonButtonChildProps): null;
displayName: string;
peek: {
description: string;
};
propTypes: {
/**
The children to render within the \`Button\`.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
Disables selection of the \`Button\`.
*/
isDisabled: PropTypes.Requireable<boolean>;
/**
Called when the user clicks the \`Button\`. Signature:
\`({ props, event }) => {}\`
*/
onClick: PropTypes.Requireable<(...args: any[]) => any>;
};
};
static peek: {
description: string;
categories: string[];
madeFrom: string[];
};
static reducers: typeof reducers;
static propTypes: {
/**
Object of DropMenu props which are passed through to the underlying
DropMenu component.
*/
DropMenu: PropTypes.Requireable<PropTypes.InferProps<{
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
className: PropTypes.Requireable<string>;
style: PropTypes.Requireable<object>;
isDisabled: PropTypes.Requireable<boolean>;
isExpanded: PropTypes.Requireable<boolean>;
direction: PropTypes.Requireable<string>;
alignment: PropTypes.Requireable<string>;
selectedIndices: PropTypes.Requireable<(number | null | undefined)[]>;
focusedIndex: PropTypes.Requireable<number>;
portalId: PropTypes.Requireable<string>;
flyOutStyle: PropTypes.Requireable<object>;
optionContainerStyle: PropTypes.Requireable<object>;
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
onCollapse: PropTypes.Requireable<(...args: any[]) => any>;
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
onFocusNext: PropTypes.Requireable<(...args: any[]) => any>;
onFocusPrev: PropTypes.Requireable<(...args: any[]) => any>;
onFocusOption: PropTypes.Requireable<(...args: any[]) => any>;
Control: PropTypes.Requireable<any>;
Option: PropTypes.Requireable<any>;
OptionGroup: PropTypes.Requireable<any>;
NullOption: PropTypes.Requireable<any>;
Header: PropTypes.Requireable<any>;
ContextMenu: PropTypes.Requireable<any>;
FixedOption: PropTypes.Requireable<any>;
}>>;
/**
All children should be \`ButtonGroup.Button\`s and they support the same
props as \`Button\`s.
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
Appended to the component-specific class names set on the root element.
Value is run through the \`classnames\` library.
*/
className: PropTypes.Requireable<string>;
/**
Sets the direction the flyout menu will render relative to the
SplitButton.
*/
direction: PropTypes.Requireable<string>;
/**
Style variations of the SplitButton.
*/
kind: PropTypes.Requireable<string>;
/**
Size variations of the SplitButton.
*/
size: PropTypes.Requireable<string>;
/**
Form element type variations of SplitButton. Passed through to DOM
Button.
*/
type: PropTypes.Requireable<string>;
};
static defaultProps: {
direction: "down";
type: "button";
DropMenu: {
isDisabled: boolean;
isExpanded: boolean;
direction: "down";
alignment: "start";
selectedIndices: never[];
focusedIndex: null;
flyOutStyle: {
maxHeight: string;
};
onExpand: (...args: any[]) => void;
onCollapse: (...args: any[]) => void;
onSelect: (...args: any[]) => void;
onFocusNext: (...args: any[]) => void;
onFocusPrev: (...args: any[]) => void;
onFocusOption: (...args: any[]) => void;
portalId: string;
optionContainerStyle: {};
ContextMenu: {
direction: string;
directonOffset: number;
minWidthOffset: number;
alignment: string;
getAlignmentOffset: () => number;
isExpanded: boolean;
onClickOut: null;
portalId: null;
};
};
};
handleSelect: (optionIndex: number | null, { event, }: {
event: React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent>;
}) => void;
handleClick: ({ event, }: {
event: React.MouseEvent<HTMLButtonElement>;
}) => void;
handleButtonClick: (buttonProps: IButtonProps, event: any) => void;
render(): JSX.Element;
}
declare const _default: typeof SplitButton & import("../../util/state-management").IHybridComponent<ISplitButtonProps, IDropMenuState>;
export default _default;
export { SplitButton as SplitButtonDumb };
//# sourceMappingURL=SplitButton.d.ts.map