-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,140 changed files
with
19,126 additions
and
53,170 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ assets/ | |
fixtures/ | ||
|
||
src/icons/ | ||
|
||
src/codemods/ |
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 @@ | ||
package-lock.json | ||
package-lock.json | ||
src/codemods/__testfixtures__/ |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,144 @@ | ||
import React from 'react'; | ||
import { Preview } from '@storybook/react'; | ||
import { themes } from '@storybook/theming'; | ||
import { DocsContainer } from '@storybook/addon-docs'; | ||
import { useDarkMode } from 'storybook-dark-mode'; | ||
|
||
import { GlobalStyle as ClassicColors } from '../src/essentials/Colors/Colors'; | ||
import { GlobalStyle as ModernColors } from '../src/essentials/Colors/ModernColors'; | ||
import { DarkScheme, LightScheme } from '../src/components/ColorScheme'; | ||
|
||
import { LightTheme, DarkTheme } from './FreenowTheme'; | ||
|
||
const THEMES = { | ||
classic: ClassicColors, | ||
modern: ModernColors | ||
} as const; | ||
|
||
export const withTheme = (Story, context) => { | ||
const Theme = THEMES[context.globals.theme]; | ||
return ( | ||
<> | ||
<Theme /> | ||
<Story {...context} /> | ||
</> | ||
); | ||
}; | ||
|
||
export const withColorScheme = (Story, context) => { | ||
const SchemeWrapper = useDarkMode() ? DarkScheme : LightScheme; | ||
|
||
return ( | ||
<SchemeWrapper> | ||
<Story {...context} /> | ||
</SchemeWrapper> | ||
); | ||
}; | ||
|
||
export const preview: Preview = { | ||
decorators: [withTheme, withColorScheme], | ||
parameters: { | ||
darkMode: { | ||
dark: { ...themes.dark, ...DarkTheme }, | ||
light: { | ||
...themes.normal, | ||
...LightTheme | ||
}, | ||
lightClass: ['wave', 'light-scheme'], | ||
darkClass: ['wave', 'dark-scheme'], | ||
stylePreview: true | ||
}, | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
viewMode: 'docs', | ||
controls: { | ||
expanded: true, | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/ | ||
} | ||
}, | ||
options: { | ||
storySort: { | ||
order: ['Welcome', 'Get Started', 'Essentials', 'Components', 'Form Elements'] | ||
} | ||
}, | ||
docs: { | ||
container: props => { | ||
const scheme = useDarkMode() ? DarkTheme : LightTheme; | ||
const globals = props.context.store.globals.get(); | ||
const WaveTheme = THEMES[globals.theme]; | ||
|
||
return ( | ||
<> | ||
<WaveTheme /> | ||
<DocsContainer {...props} theme={scheme} /> | ||
</> | ||
); | ||
}, | ||
toc: { | ||
headingSelector: 'h2, h3' | ||
} | ||
}, | ||
backgrounds: { | ||
disable: true | ||
}, | ||
viewport: { | ||
viewports: { | ||
mobile: { | ||
name: 'Mobile', | ||
styles: { | ||
height: '568px', | ||
width: '320px' | ||
}, | ||
type: 'mobile' | ||
}, | ||
mobile_landscape: { | ||
name: 'Mobile landscape', | ||
styles: { | ||
height: '320px', | ||
width: '568px' | ||
}, | ||
type: 'mobile' | ||
}, | ||
tablet: { | ||
name: 'Tablet', | ||
styles: { | ||
height: '1112px', | ||
width: '834px' | ||
}, | ||
type: 'tablet' | ||
}, | ||
tablet_landscape: { | ||
name: 'Tablet landscape', | ||
styles: { | ||
height: '834px', | ||
width: '1112px' | ||
}, | ||
type: 'tablet' | ||
}, | ||
desktop: { | ||
name: 'Desktop', | ||
styles: { | ||
height: '1080px', | ||
width: '1920px' | ||
}, | ||
type: 'desktop' | ||
} | ||
} | ||
} | ||
}, | ||
globalTypes: { | ||
theme: { | ||
description: 'Global theme for components', | ||
defaultValue: 'modern', | ||
toolbar: { | ||
title: 'Theme', | ||
icon: 'paintbrush', | ||
items: ['modern', 'classic'], | ||
dynamicTitle: true | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default preview; |
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,2 @@ | ||
node_modules/ | ||
src/codemods/__testfixtures__/ |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.