Skip to content

Commit

Permalink
Convert to 4 space indents
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Apr 13, 2021
1 parent 037ae75 commit fbb0866
Showing 1 changed file with 50 additions and 47 deletions.
97 changes: 50 additions & 47 deletions storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,68 @@ import webqueueTheme from "../src/theme";
* @see: https://storybook.js.org/docs/react/essentials/toolbars-and-globals#global-types-and-the-toolbar-annotation
*/
export const globalTypes = {
theme: {
name: 'Toggle Dark Mode',
description: 'Toggle between light and dark variants.',
defaultValue: false,
toolbar: {
icon: 'mirror',
items: [
{ value: true, title: "Dark Mode On" },
{ value: false, title: "Dark Mode Off" }
],
theme: {
name: 'Toggle Dark Mode',
description: 'Toggle between light and dark variants.',
defaultValue: false,
toolbar: {
icon: 'mirror',
items: [
{ value: true, title: "Dark Mode On" },
{ value: false, title: "Dark Mode Off" }
],
},
},
},
};

/**
* Array
* Array of functions to wrap all stories.
* @type {Array}
* @see https://storybook.js.org/docs/react/writing-stories/decorators
*/
export const decorators = [
// Provide custom webqueue2 Theme
(Story, context) => {
const theme = webqueueTheme(context.globals.theme);
return (
<ThemeProvider theme={theme} >
<Story {...context.args} />
</ThemeProvider>
);
},
// Provide Item context
(Story) => (
<ItemProvider>
<Story />
</ItemProvider>
),
// Provide custom webqueue2 Theme
(Story, context) => {
const theme = webqueueTheme(context.globals.theme);
return (
<ThemeProvider theme={theme} >
<Story {...context.args} />
</ThemeProvider>
);
},

// Provide Item context
(Story) => (
<ItemProvider>
<Story />
</ItemProvider>
),
];

/**Set of static metadata for a story. Is also used to define the sort order of the stories and backgrounds for every story.
/** Naming and Sorting Options
* @type {Object}
* @see https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy
*/
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
options: {
storySort: {
method: 'alphabetical',
order: ['Introduction', 'Components']

actions: { argTypesRegex: "^on[A-Z].*" },
options: {
storySort: {
method: 'alphabetical',
order: ['Introduction', 'Components']
},
},
backgrounds: {
default: 'light',
values: [
{
name: 'light',
value: '#f5f5f5',
},
{
name: 'dark',
value: '#333333'
},
],
},
},
backgrounds: {
default: 'light',
values: [
{
name: 'light',
value: '#f5f5f5',
},
{
name: 'dark',
value: '#333333'
},
],
},
}

0 comments on commit fbb0866

Please sign in to comment.