-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore(vr-tests-react-components): Convert stories to CSF #31939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dmytrokirpa
merged 11 commits into
microsoft:master
from
dmytrokirpa:convert-vr-tests-stories-to-csf
Jul 18, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d61f64f
Convert stories to CSF
dmytrokirpa 3832523
udpate stories
dmytrokirpa 9128b77
update stories
dmytrokirpa 6f18705
update stories
dmytrokirpa 1fdad14
fix type issues
dmytrokirpa cd68100
Merge branch 'master' into convert-vr-tests-stories-to-csf
dmytrokirpa de513b7
Merge branch 'master' into convert-vr-tests-stories-to-csf
dmytrokirpa 0d65a2e
tests
dmytrokirpa a7c5b14
Merge branch 'master' into convert-vr-tests-stories-to-csf
dmytrokirpa bfa68fb
review comments
dmytrokirpa 50f1fbd
Merge branch 'master' into convert-vr-tests-stories-to-csf
dmytrokirpa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,72 +1,4 @@ | ||
| // @ts-check | ||
|
|
||
| import * as React from 'react'; | ||
| import { setAddon } from '@storybook/react'; | ||
| import { webLightTheme, teamsHighContrastTheme, webDarkTheme } from '@fluentui/react-theme'; | ||
| import { FluentProvider } from '@fluentui/react-provider'; | ||
|
|
||
| /** | ||
| * @deprecated https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-setaddon | ||
| * | ||
| * TODO: rework this to be conformant with Component Story Format | ||
| * | ||
| * Via this addon, we INVENT a new API that automatically adds several | ||
| * stories for you when you call addStory() that adds variants (like RTL) | ||
| * | ||
| * addStory() is not an official Storybook API | ||
| * | ||
| * Adds a story with different configuration options. | ||
| * By default, only adds a story in LTR. | ||
| * The config parameter can be used to add the story RTL in addition to LTR. | ||
| * In future, this can add a story with additional configurations such as theming. | ||
| */ | ||
| setAddon({ | ||
| /** | ||
| * @type {import('../src/utilities/types').ExtendedStoryApi['addStory']} | ||
| * @this {import('../src/utilities/types').ExtendedStoryApi} | ||
| */ | ||
| addStory(storyName, storyFn, config = {}) { | ||
| this.add(storyName, (/** @type {import('../src/utilities/types').StoryContext} */ context) => { | ||
| return ( | ||
| <FluentProvider applyStylesToPortals={false} theme={webLightTheme}> | ||
| {storyFn(context)} | ||
| </FluentProvider> | ||
| ); | ||
| }); | ||
| if (config.includeRtl) { | ||
| this.add(storyName + ' - RTL', (/** @type {import('../src/utilities/types').StoryContext} */ context) => { | ||
| return ( | ||
| <FluentProvider applyStylesToPortals={false} theme={webLightTheme} dir="rtl"> | ||
| {storyFn(context)} | ||
| </FluentProvider> | ||
| ); | ||
| }); | ||
| } | ||
| if (config.includeDarkMode) { | ||
| this.add(storyName + ' - Dark Mode', (/** @type {import('../src/utilities/types').StoryContext} */ context) => { | ||
| return ( | ||
| <FluentProvider applyStylesToPortals={false} theme={webDarkTheme}> | ||
| {storyFn(context)} | ||
| </FluentProvider> | ||
| ); | ||
| }); | ||
| } | ||
| if (config.includeHighContrast) { | ||
| this.add( | ||
| storyName + ' - High Contrast', | ||
| (/** @type {import('../src/utilities/types').StoryContext} */ context) => { | ||
| return ( | ||
| <FluentProvider applyStylesToPortals={false} theme={teamsHighContrastTheme}> | ||
| {storyFn(context)} | ||
| </FluentProvider> | ||
| ); | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| return this; | ||
| }, | ||
| }); | ||
|
|
||
| /** @type {import("@fluentui/react-storybook-addon").FluentParameters} */ | ||
| export const parameters = { layout: 'none', mode: 'vr-test' }; | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
17 changes: 9 additions & 8 deletions
17
...rGroup/AvatarGroupInteractive.stories.tsx → ...atarGroup/AvatarGroupOverflow.stories.tsx
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
apps/vr-tests-react-components/src/stories/Breadcrumb/Breadcrumb.stories.tsx
This file contains hidden or 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
6 changes: 3 additions & 3 deletions
6
apps/vr-tests-react-components/src/stories/Button/Button.stories.tsx
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.