forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert(react-storybook-addon): Remove addon and reintroduce `withFlue…
…ntProvider` (microsoft#20475) * revert(react-storybook-addon): Remove addon and reintroduce `withFluentProvider` no build DX for storybook microsoft#18357. This PR reverts the register of that addon and only applying this addon to react-components breaks theming for all other packages * Change files * update md
- Loading branch information
Showing
8 changed files
with
36 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-components-d47a7a2f-27ca-4961-944d-5b0e8c775c9a.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": "none", | ||
"comment": "revert(react-storybook-addon): Remove addon and reintroduce `withFluentProvider`", | ||
"packageName": "@fluentui/react-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './withFluentProvider'; | ||
export * from './withStrictMode'; |
20 changes: 20 additions & 0 deletions
20
packages/react-storybook/src/decorators/withFluentProvider.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,20 @@ | ||
import { makeDecorator } from '@storybook/addons'; | ||
import { FluentProvider } from '@fluentui/react-provider'; | ||
import * as React from 'react'; | ||
|
||
import { useFluentTheme } from '../knobs/useFluentTheme'; | ||
|
||
const ProviderWrapper: React.FunctionComponent = props => { | ||
const { theme } = useFluentTheme(); | ||
|
||
return <FluentProvider theme={theme}>{props.children}</FluentProvider>; | ||
}; | ||
|
||
export const withFluentProvider = makeDecorator({ | ||
name: 'withFluentProvider', | ||
parameterName: 'theme', | ||
skipIfNoParametersOrOptions: false, | ||
wrapper: (storyFn, context) => { | ||
return <ProviderWrapper>{storyFn(context)}</ProviderWrapper>; | ||
}, | ||
}); |
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