/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */ import * as React from 'react'; import Screener from 'screener-storybook/src/screener'; import { storiesOf } from '@storybook/react'; import { FabricDecorator, FabricDecoratorFullWidth } from '../utilities'; import { DocumentCard, DocumentCardPreview, DocumentCardTitle, DocumentCardActivity, DocumentCardType, ImageFit, DocumentCardDetails, Fabric, IDocumentCardPreviewProps, } from 'office-ui-fabric-react'; import { TestImages } from '@uifabric/example-data'; const previewProps: IDocumentCardPreviewProps = { previewImages: [ { name: 'Revenue stream proposal fiscal year 2016 version02.pptx', linkProps: { href: 'http://bing.com', }, previewImageSrc: TestImages.documentPreview, iconSrc: TestImages.iconPpt, imageFit: ImageFit.cover, width: 318, height: 196, }, ], }; const previewPropsCompact: IDocumentCardPreviewProps = { getOverflowDocumentCountText: (overflowCount: number) => `+${overflowCount} more`, previewImages: [ { name: 'Revenue stream proposal fiscal year 2016 version02.pptx', linkProps: { href: 'http://bing.com', }, previewImageSrc: TestImages.documentPreview, iconSrc: TestImages.iconPpt, width: 144, }, { name: 'New Contoso Collaboration for Conference Presentation Draft', linkProps: { href: 'http://bing.com', }, previewImageSrc: TestImages.documentPreviewTwo, iconSrc: TestImages.iconPpt, width: 144, }, { name: 'Spec Sheet for design', linkProps: { href: 'http://bing.com', }, previewImageSrc: TestImages.documentPreviewThree, iconSrc: TestImages.iconPpt, width: 144, }, { name: 'Contoso Marketing Presentation', linkProps: { href: 'http://bing.com', }, previewImageSrc: TestImages.documentPreview, iconSrc: TestImages.iconPpt, width: 144, }, ], }; const docActivity = ( ); storiesOf('DocumentCard', module) .addDecorator(FabricDecorator) .addDecorator(story => // prettier-ignore {story()} , ) // Commenting out this story as it has some racing issues with the truncation logic and causes the test to fail on unrelated PRs // .addStory('Root', () => ( // // // // // {docActivity} // // // )) .addStory('Not truncated', () => ( {docActivity} )) .addStory('With secondary title style', () => ( {docActivity} )); storiesOf('DocumentCard', module) .addDecorator(FabricDecoratorFullWidth) .addDecorator(story => // prettier-ignore {story()} , ) .addStory('Compact with preview list', () => ( {docActivity} )) .addStory('Compact with preview image', () => ( {docActivity} ));