From e9e3cf3374a564e24efa2e866a594b4f570d1b9c Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Wed, 1 Feb 2023 16:15:57 +0100 Subject: [PATCH 1/9] docs: improve grid examples --- .../stories/Card/CardTemplates.stories.tsx | 83 +++++++++++-------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/packages/react-components/react-card/stories/Card/CardTemplates.stories.tsx b/packages/react-components/react-card/stories/Card/CardTemplates.stories.tsx index a7428f30fc726d..032c46b43b5148 100644 --- a/packages/react-components/react-card/stories/Card/CardTemplates.stories.tsx +++ b/packages/react-components/react-card/stories/Card/CardTemplates.stories.tsx @@ -22,12 +22,9 @@ import { import { Card, CardHeader, CardPreview } from '@fluentui/react-card'; const useStyles = makeStyles({ - mainContainer: { + container: { ...shorthands.gap('16px'), - width: 'fit-content', - height: '256px', display: 'flex', - flexDirection: 'column', flexWrap: 'wrap', }, @@ -59,6 +56,12 @@ const useStyles = makeStyles({ display: 'flex', alignItems: 'flex-start', }, + + grid: { + ...shorthands.gap('16px'), + display: 'flex', + flexDirection: 'column', + }, }); const resolveAsset = (asset: string) => { @@ -76,13 +79,7 @@ export const Templates = () => { const styles = useStyles(); return ( -
- - - Intelligence - Design to Amplify - - - +
@@ -146,32 +143,48 @@ export const Templates = () => { - - Team Offsite 2020} - description={OneDrive > Presentations} - action={
); }; + +Templates.parameters = { + docs: { + description: { + story: 'Cards can be composed with other components to build rich elements for a page.', + }, + }, +}; From d9c84885c33f8b973227031a2c4ab3416642accf Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Wed, 1 Feb 2023 16:16:15 +0100 Subject: [PATCH 2/9] docs: add better a11y props --- .../react-card/stories/Card/CardDefault.stories.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-components/react-card/stories/Card/CardDefault.stories.tsx b/packages/react-components/react-card/stories/Card/CardDefault.stories.tsx index e404af921e9727..e35569aaa8d944 100644 --- a/packages/react-components/react-card/stories/Card/CardDefault.stories.tsx +++ b/packages/react-components/react-card/stories/Card/CardDefault.stories.tsx @@ -25,7 +25,7 @@ export const Default = () => { return ( } + image={Elvia Atkins avatar picture} header={ Elvia Atkins mentioned you @@ -34,8 +34,8 @@ export const Default = () => { description={5h ago ยท About us - Overview} /> - }> - Preview of a Word document + }> + Preview of a Word document: About Us - Overview From 94530c9d6a29bb4948237a3c8ae3587322d564c3 Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Wed, 1 Feb 2023 16:21:17 +0100 Subject: [PATCH 3/9] docs: improve card main description --- .../react-card/stories/Card/CardDescription.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-components/react-card/stories/Card/CardDescription.md b/packages/react-components/react-card/stories/Card/CardDescription.md index 4f7a02021958cb..53ce4d835ff331 100644 --- a/packages/react-components/react-card/stories/Card/CardDescription.md +++ b/packages/react-components/react-card/stories/Card/CardDescription.md @@ -1 +1,3 @@ -The Card component is a framework for organizing content within the confines of a container. It's main function is to provide the scaffolding for hosting actions and content for a single topic within a card. +A card is a container that holds information and actions related to a single concept or object, like a document or a contact. + +Cards can give information prominence and create predictable patterns. While they're very flexible, it's important to use them consistently for particular use cases across experiences. From f171cddde768661b697f4c340592c481cbfe0250 Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Wed, 1 Feb 2023 17:03:26 +0100 Subject: [PATCH 4/9] docs: change orientation examples to be easier to compare --- .../stories/Card/CardOrientation.stories.tsx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/react-components/react-card/stories/Card/CardOrientation.stories.tsx b/packages/react-components/react-card/stories/Card/CardOrientation.stories.tsx index c693a6da19f0bc..76184c1dc3b9af 100644 --- a/packages/react-components/react-card/stories/Card/CardOrientation.stories.tsx +++ b/packages/react-components/react-card/stories/Card/CardOrientation.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { makeStyles, shorthands, Avatar, Button, Caption1, Text, tokens, Subtitle1 } from '@fluentui/react-components'; +import { makeStyles, shorthands, Button, Caption1, Text, tokens, Subtitle1 } from '@fluentui/react-components'; import { MoreHorizontal20Filled } from '@fluentui/react-icons'; import { Card, CardHeader, CardPreview } from '@fluentui/react-card'; @@ -18,6 +18,12 @@ const useStyles = makeStyles({ flexWrap: 'wrap', }, + card: { + width: '360px', + maxWidth: '100%', + height: 'fit-content', + }, + section: { width: 'fit-content', }, @@ -27,14 +33,8 @@ const useStyles = makeStyles({ }, horizontalCardImage: { - width: '60px', - height: '60px', - }, - - verticalCard: { - width: '360px', - maxWidth: '100%', - height: 'fit-content', + width: '64px', + height: '64px', }, headerImage: { @@ -69,9 +69,11 @@ export const Orientation = () => {
'vertical' (Default) - +

With image as part of header

+ + } + image={App Name Document} header={App Name} description={Developer} action={