UNPKG

3.4 kBSource Map (JSON)View Raw
1{"version":3,"file":"DocumentCard.types.js","sourceRoot":"../src/","sources":["components/DocumentCard/DocumentCard.types.ts"],"names":[],"mappings":"AAoFA;;GAEG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,2DAAU,CAAA;IACV;;OAEG;IACH,6DAAW,CAAA;AACb,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B","sourcesContent":["import * as React from 'react';\nimport { IStyle, ITheme } from '../../Styling';\nimport { IBaseProps, IRefObject, IStyleFunctionOrObject } from '../../Utilities';\n\n/**\n * {@docCategory DocumentCard}\n */\nexport interface IDocumentCard {\n /**\n * Sets focus to the DocumentCard.\n */\n focus: () => void;\n}\n\n/**\n * {@docCategory DocumentCard}\n */\nexport interface IDocumentCardProps extends IBaseProps<IDocumentCard>, React.HTMLAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the IDocumentCard interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IDocumentCard>;\n\n /**\n * The type of DocumentCard to display.\n * @defaultvalue DocumentCardType.normal\n */\n type?: DocumentCardType;\n\n /**\n * Function to call when the card is clicked or keyboard Enter/Space is pushed.\n */\n onClick?: (ev?: React.SyntheticEvent<HTMLElement>) => void;\n\n /**\n * A URL to navigate to when the card is clicked. If a function has also been provided,\n * it will be used instead of the URL.\n */\n onClickHref?: string;\n\n /**\n * A target browser context for opening the link. If not specified, will open in the same tab/window.\n */\n onClickTarget?: string;\n\n /**\n * Aria role assigned to the documentCard (Eg. button, link).\n * Use this to override the default assignment.\n * @defaultvalue When `onClick` is provided, default role will be 'button'.\n * When `onClickHref` is provided, default role will be 'link'.\n */\n role?: string;\n\n /**\n * Hex color value of the line below the card, which should correspond to the document type.\n * This should only be supplied when using the 'compact' card layout.\n *\n * Deprecated at v4.17.1, to be removed at \\>= v5.0.0.\n * @deprecated To be removed at v5.0.0.\n */\n accentColor?: string;\n\n /**\n * Child components to render within the card.\n */\n children?: React.ReactNode;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject<IDocumentCardStyleProps, IDocumentCardStyles>;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Optional override class name\n */\n className?: string;\n}\n\n/**\n * {@docCategory DocumentCard}\n */\nexport enum DocumentCardType {\n /**\n * Standard DocumentCard.\n */\n normal = 0,\n /**\n * Compact layout. Displays the preview beside the details, rather than above.\n */\n compact = 1,\n}\n\n/**\n * {@docCategory DocumentCard}\n */\nexport interface IDocumentCardStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Optional override class name\n */\n className?: string;\n\n /**\n * True when the card has a click action.\n */\n actionable?: boolean;\n\n /**\n * Compact variant of the card.\n */\n compact?: boolean;\n}\n\n/**\n * {@docCategory DocumentCard}\n */\nexport interface IDocumentCardStyles {\n root: IStyle;\n}\n"]}
\No newline at end of file