-
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: Add shape prop to MessageBar (#29426)
* feat: Add shape prop to MessageBar Adds the shape prop to MessageBar to support both `square` and `rounded` shapes. Addresses 22579 * changefile
- Loading branch information
Showing
8 changed files
with
89 additions
and
6 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-message-bar-preview-35f1856a-8956-4a81-a775-34c2100a6de2.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": "minor", | ||
"comment": "feat: Add shape prop to MessageBar", | ||
"packageName": "@fluentui/react-message-bar-preview", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
47 changes: 47 additions & 0 deletions
47
packages/react-components/react-message-bar-preview/stories/MessageBar/Shapes.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,47 @@ | ||
import * as React from 'react'; | ||
import { Button, Field, Link, Radio, RadioGroup } from '@fluentui/react-components'; | ||
import { DismissRegular } from '@fluentui/react-icons'; | ||
import { | ||
MessageBar, | ||
MessageBarActions, | ||
MessageBarTitle, | ||
MessageBarBody, | ||
MessageBarProps, | ||
} from '@fluentui/react-message-bar-preview'; | ||
|
||
export const Shapes = () => { | ||
const [shape, setShape] = React.useState<MessageBarProps['shape']>('rounded'); | ||
|
||
return ( | ||
<> | ||
<Field label="Select shape"> | ||
<RadioGroup value={shape} onChange={(e, { value }) => setShape(value as MessageBarProps['shape'])}> | ||
<Radio value="rounded" label="Rounded" /> | ||
<Radio value="square" label="Square" /> | ||
</RadioGroup> | ||
</Field> | ||
<MessageBar shape={shape}> | ||
<MessageBarBody> | ||
<MessageBarTitle>Descriptive title</MessageBarTitle> | ||
Message providing information to the user with actionable insights. <Link>Link</Link> | ||
</MessageBarBody> | ||
<MessageBarActions containerAction={<Button appearance="transparent" icon={<DismissRegular />} />}> | ||
<Button>Action</Button> | ||
<Button>Action</Button> | ||
</MessageBarActions> | ||
</MessageBar> | ||
</> | ||
); | ||
}; | ||
|
||
Shapes.parameters = { | ||
docs: { | ||
description: { | ||
story: [ | ||
'MessageBar can have either rounded or square corners, please follow the usage guidance for these shapes:', | ||
'- **_rounded_** used for component level message bars', | ||
'- **_square_** used for page/app level message bars', | ||
].join('\n'), | ||
}, | ||
}, | ||
}; |
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