@fluentui/react-northstar
Version:
A themable React component library.
68 lines (67 loc) • 3.45 kB
TypeScript
import { Accessibility, AttachmentBehaviorProps } from '@fluentui/accessibility';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { ComponentEventHandler, ShorthandValue } from '../../types';
import { UIComponentProps, ChildrenComponentProps, ShorthandFactory } from '../../utils';
import { AttachmentAction, AttachmentActionProps } from './AttachmentAction';
import { AttachmentBody, AttachmentBodyProps } from './AttachmentBody';
import { AttachmentDescription, AttachmentDescriptionProps } from './AttachmentDescription';
import { AttachmentHeader, AttachmentHeaderProps } from './AttachmentHeader';
import { AttachmentIcon, AttachmentIconProps } from './AttachmentIcon';
export interface AttachmentProps extends UIComponentProps, ChildrenComponentProps {
/** Accessibility behavior if overridden by the user. */
accessibility?: Accessibility<AttachmentBehaviorProps>;
/** Button shorthand for the action slot. */
action?: ShorthandValue<AttachmentActionProps>;
/** An Attachment can be styled to indicate possible user interaction. */
actionable?: boolean;
/** Contains a header and a description for an Attachment. */
body?: ShorthandValue<AttachmentBodyProps>;
/** A string describing the attachment. */
description?: ShorthandValue<AttachmentDescriptionProps>;
/** An attachment can show that it cannot be interacted with. */
disabled?: boolean;
/** The name of the attachment. */
header?: ShorthandValue<AttachmentHeaderProps>;
/** Shorthand for the icon. */
icon?: ShorthandValue<AttachmentIconProps>;
/** Value indicating percent complete. */
progress?: string | number;
/**
* Called after user's click.
* @param event - React's original SyntheticEvent.
* @param data - All props.
*/
onClick?: ComponentEventHandler<AttachmentProps>;
}
export declare type AttachmentStylesProps = Required<Pick<AttachmentProps, 'actionable' | 'disabled'>>;
export declare const attachmentClassName = "ui-attachment";
export declare const attachmentProgressContainerClassName: string;
export declare const attachmentProgressBarClassName: string;
/**
* An Attachment represents a file or media attachment, which may contain some metadata or actions.
*/
export declare const Attachment: (<TExtendedElementType extends React.ElementType<any> = "div">(props: Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof AttachmentProps> & {
as?: TExtendedElementType;
} & AttachmentProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<AttachmentProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<AttachmentProps & {
as: "div";
}>;
displayName?: string;
readonly __PRIVATE_PROPS?: Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
ref?: React.Ref<HTMLDivElement>;
}, "as" | keyof AttachmentProps> & {
as?: "div";
} & AttachmentProps;
} & {
create: ShorthandFactory<AttachmentProps>;
Action: typeof AttachmentAction;
Body: typeof AttachmentBody;
Description: typeof AttachmentDescription;
Header: typeof AttachmentHeader;
Icon: typeof AttachmentIcon;
};