-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-card): add
orientation
prop (#23037)
- Loading branch information
1 parent
7954271
commit 06030b7
Showing
10 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-card-13cff888-f801-42d1-baab-65ef228df98e.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "feat: add `orientation` prop", | ||
"packageName": "@fluentui/react-card", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
packages/react-components/react-card/src/stories/CardOrientation.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as React from 'react'; | ||
import { makeStyles, shorthands } from '@griffel/react'; | ||
import { Card, CardHeader, CardPreview } from '../index'; | ||
import { SampleCard, Title } from './SampleCard.stories'; | ||
import { Avatar, Body1, Button, Caption1 } from '@fluentui/react-components'; | ||
import Logo from '../../assets/logo.svg'; | ||
import { MoreHorizontal24Regular } from '@fluentui/react-icons'; | ||
|
||
export const ASSET_URL = | ||
'https://raw.githubusercontent.com/microsoft/fluentui/master/packages/react-components/react-card'; | ||
|
||
const avatarElviaURL = ASSET_URL + '/assets/avatar_elvia.svg'; | ||
|
||
const useStyles = makeStyles({ | ||
root: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
...shorthands.gap('30px'), | ||
|
||
['> *']: { | ||
width: 'fit-content', | ||
}, | ||
}, | ||
horizontalPreview: { | ||
height: '60px', | ||
}, | ||
}); | ||
|
||
export const Orientation = () => { | ||
const styles = useStyles(); | ||
|
||
return ( | ||
<div className={styles.root}> | ||
<div> | ||
<Title title="'horizontal'" /> | ||
<Card size="small" orientation="horizontal"> | ||
<CardPreview className={styles.horizontalPreview}> | ||
<img src={Logo} alt="company logo template" /> | ||
</CardPreview> | ||
<CardHeader | ||
image={<Avatar badge={{ status: 'available' }} image={{ src: avatarElviaURL }} />} | ||
header={ | ||
<Body1> | ||
<b>Strategy 2021</b> | ||
</Body1> | ||
} | ||
description={<Caption1>https://aka.ms/fluentui</Caption1>} | ||
action={<Button appearance="transparent" icon={<MoreHorizontal24Regular />} />} | ||
/> | ||
</Card> | ||
</div> | ||
<div> | ||
<Title title="'vertical' (Default)" /> | ||
<SampleCard /> | ||
</div> | ||
</div> | ||
); | ||
}; |