@fluentui/react-northstar
Version:
A themable React component library.
51 lines (50 loc) • 2.82 kB
TypeScript
import { Accessibility, ButtonBehaviorProps } from '@fluentui/accessibility';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { UIComponentProps, ChildrenComponentProps, ContentComponentProps, SizeValue } from '../../utils';
import { ComponentEventHandler, FluentComponentStaticProps } from '../../types';
export interface SplitButtonToggleProps extends UIComponentProps, ContentComponentProps, ChildrenComponentProps {
/** Accessibility behavior if overridden by the user. */
accessibility?: Accessibility<ButtonBehaviorProps>;
/** A split button toggle can show that it cannot be interacted with. */
disabled?: boolean;
/**
* Called after a user clicks the button.
* @param event - React's original SyntheticEvent.
* @param data - All props.
*/
onClick?: ComponentEventHandler<SplitButtonToggleProps>;
/** A split button toggle can emphasize that it represents the primary action. */
primary?: boolean;
/** A split button toggle can emphasize that it represents an alternative action. */
secondary?: boolean;
/** A split button toggle can be sized */
size?: SizeValue;
/** A split button toggle can be elevated or flat. */
flat?: boolean;
}
export declare type SplitButtonToggleStylesProps = Pick<SplitButtonToggleProps, 'primary' | 'disabled' | 'size' | 'flat'>;
export declare const splitButtonToggleClassName = "ui-splitbutton__toggle";
/**
* A SplitToggleButton allows users to customize the toggle button inside the SplitButton.
*
* @accessibility
* Implements [ARIA Button](https://www.w3.org/TR/wai-aria-practices-1.1/#button) design pattern.
*/
export declare const SplitButtonToggle: (<TExtendedElementType extends React.ElementType<any> = "button">(props: React.RefAttributes<HTMLButtonElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof SplitButtonToggleProps> & {
as?: TExtendedElementType;
} & SplitButtonToggleProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<SplitButtonToggleProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<SplitButtonToggleProps & {
as: "button";
}>;
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLButtonElement> & Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & {
ref?: React.Ref<HTMLButtonElement>;
}, "as" | keyof SplitButtonToggleProps> & {
as?: "button";
} & SplitButtonToggleProps;
} & FluentComponentStaticProps<SplitButtonToggleProps>;