@fluentui/react-northstar
Version:
A themable React component library.
75 lines (74 loc) • 3.55 kB
TypeScript
import { Accessibility, AccordionTitleBehaviorProps } from '@fluentui/accessibility';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { UIComponentProps, ContentComponentProps, ChildrenComponentProps } from '../../utils';
import { ComponentEventHandler, ShorthandValue, FluentComponentStaticProps } from '../../types';
import { BoxProps } from '../Box/Box';
export interface AccordionTitleSlotClassNames {
contentWrapper: string;
}
export interface AccordionTitleProps extends UIComponentProps, ContentComponentProps<ShorthandValue<BoxProps>>, ChildrenComponentProps {
/**
* Accessibility behavior if overridden by the user.
*/
accessibility?: Accessibility<AccordionTitleBehaviorProps>;
/** Id of the content it owns. */
accordionContentId?: string;
/** Whether or not the title is in the open state. */
active?: boolean;
/** If at least one panel needs to stay active and this title does not correspond to the last active one. */
canBeCollapsed?: boolean;
/** Shorthand for the content wrapper element. */
contentWrapper?: ShorthandValue<BoxProps>;
/** An accordion title can show it is currently unable to be interacted with. */
disabled?: boolean;
/** AccordionTitle index inside Accordion. */
index?: number;
/** Ref to the clickable element that contains the title. */
contentRef?: React.Ref<HTMLElement>;
/**
* Called on click.
*
* @param event - React's original SyntheticEvent.
* @param data - All props.
*/
onClick?: ComponentEventHandler<AccordionTitleProps>;
/**
* Called after user's focus.
* @param event - React's original SyntheticEvent.
* @param data - All props.
*/
onFocus?: ComponentEventHandler<AccordionTitleProps>;
/** Shorthand for the active indicator. */
indicator?: ShorthandValue<BoxProps>;
}
export declare const accordionTitleClassName = "ui-accordion__title";
export declare const accordionTitleSlotClassNames: AccordionTitleSlotClassNames;
export declare type AccordionTitleStylesProps = Required<Pick<AccordionTitleProps, 'disabled' | 'active'>> & {
content: boolean;
};
/**
* An AccordionTitle represents the title of Accordion's item that can be interacted with to expand or collapse the item's content.
*/
export declare const AccordionTitle: (<TExtendedElementType extends React.ElementType<any> = "div">(props: React.RefAttributes<HTMLDListElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof AccordionTitleProps> & {
as?: TExtendedElementType;
} & AccordionTitleProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<AccordionTitleProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<AccordionTitleProps & {
as: "div";
}>;
/**
* Called after user's focus.
* @param event - React's original SyntheticEvent.
* @param data - All props.
*/
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLDListElement> & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
ref?: React.Ref<HTMLDivElement>;
}, "as" | keyof AccordionTitleProps> & {
as?: "div";
} & AccordionTitleProps;
} & FluentComponentStaticProps<AccordionTitleProps>;