@fluentui/react-northstar
Version:
A themable React component library.
54 lines (53 loc) • 2.65 kB
TypeScript
import { Accessibility } from '@fluentui/accessibility';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { FluentComponentStaticProps, ShorthandValue } from '../../types';
import { ChildrenComponentProps, UIComponentProps } from '../../utils';
import { BoxProps } from '../Box/Box';
import { ChatDensity } from './chatDensity';
import type { ChatMessageLayout } from './ChatMessage';
export interface ChatItemSlotClassNames {
message: string;
gutter: string;
}
export declare const chatItemClassName = "ui-chat__item";
export declare const chatItemSlotClassNames: ChatItemSlotClassNames;
export interface ChatItemProps extends UIComponentProps, ChildrenComponentProps {
/** Accessibility behavior if overridden by the user. */
accessibility?: Accessibility<never>;
/** Controls item's relation to other chat items. */
attached?: boolean | 'top' | 'bottom';
/** Indicates whether the content is positioned at the start or the end. */
contentPosition?: 'start' | 'end';
/** Chat density. Is automatically set by the Chat. */
density?: ChatDensity;
/** Chat items can have a gutter. */
gutter?: ShorthandValue<BoxProps>;
/** Chat items can have a message. */
message?: ShorthandValue<BoxProps>;
/** Chat items can render with different layouts. */
unstable_layout?: ChatMessageLayout;
}
export declare type ChatItemStylesProps = Pick<ChatItemProps, 'attached' | 'contentPosition' | 'density'> & {
layout: ChatMessageLayout;
};
/**
* A ChatItem is container for single entity in Chat (e.g. message, notification, etc).
*/
export declare const ChatItem: (<TExtendedElementType extends React.ElementType<any> = "li">(props: React.RefAttributes<HTMLLIElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof ChatItemProps> & {
as?: TExtendedElementType;
} & ChatItemProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<ChatItemProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<ChatItemProps & {
as: "li";
}>;
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLLIElement> & Omit<Pick<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof React.LiHTMLAttributes<HTMLLIElement>> & {
ref?: React.Ref<HTMLLIElement>;
}, "as" | keyof ChatItemProps> & {
as?: "li";
} & ChatItemProps;
} & FluentComponentStaticProps<ChatItemProps>;