Skip to content

Commit

Permalink
docs(react-keytips): add sb themes addon
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Sep 24, 2024
1 parent 58aeb30 commit cb8e4f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/react-keytips/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const config: StorybookConfig = {
stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'],
addons: [
'@nx/react/plugins/storybook',
'@storybook/addon-themes',
{
name: '@storybook/addon-storysource',
options: {
Expand Down
28 changes: 20 additions & 8 deletions packages/react-keytips/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
import * as React from 'react';

import { Preview } from '@storybook/react';
import { withThemeFromJSXProvider } from '@storybook/addon-themes';

import { FluentProvider, webLightTheme } from '@fluentui/react-components';
import {
FluentProvider,
webLightTheme,
webDarkTheme,
teamsLightTheme,
teamsDarkTheme,
teamsHighContrastTheme,
} from '@fluentui/react-components';

const preview: Preview = {
decorators: [
(Story) => (
<FluentProvider theme={webLightTheme}>
<Story />
</FluentProvider>
),
withThemeFromJSXProvider({
themes: {
webLightTheme: webLightTheme,
webDarkTheme: webDarkTheme,
teamsLightTheme: teamsLightTheme,
teamsDarkTheme: teamsDarkTheme,
teamsHighContrastTheme: teamsHighContrastTheme,
},
defaultTheme: 'webLightTheme',
Provider: FluentProvider,
}),
],
};

Expand Down

0 comments on commit cb8e4f3

Please sign in to comment.