-
Notifications
You must be signed in to change notification settings - Fork 12
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
8 changed files
with
154 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const config = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: true | ||
}, | ||
staticDirs: ['./public'], | ||
}; | ||
|
||
export default config; |
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,6 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import { themes } from '@storybook/theming'; | ||
|
||
addons.setConfig({ | ||
theme: themes.light, | ||
}); |
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,21 @@ | ||
<!-- This is the `head` of the preview iframe --> | ||
<!-- Pull in static files served from your Static directory or the internet --> | ||
|
||
<meta name="color-scheme" content="only light" /> | ||
<style> | ||
@font-face { | ||
font-family: Lato; | ||
font-style: normal; | ||
font-weight: normal; | ||
src: url("/Lato-Regular.immutable.woff2") format("woff2"); | ||
font-display: fallback; | ||
} | ||
|
||
@font-face { | ||
font-family: Lato; | ||
font-style: normal; | ||
font-weight: bold; | ||
src: url("/Lato-Bold.immutable.woff2") format("woff2"); | ||
font-display: fallback; | ||
} | ||
</style> |
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,64 @@ | ||
import React from "react"; | ||
|
||
import 'cozy-ui/dist/cozy-ui.min.css' | ||
import 'cozy-ui/dist/cozy-ui.utils.min.css' | ||
import 'cozy-ui/transpiled/react/stylesheet.css' | ||
|
||
import I18n from 'cozy-ui/transpiled/react/providers/I18n' | ||
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints' | ||
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme' | ||
import { CozyProvider, createFakeClient } from 'cozy-client' | ||
|
||
import enLocale from '../locales/en.json' | ||
|
||
const preview = { | ||
decorators: [ | ||
(Story) => { | ||
const fakeClient = createFakeClient({ | ||
queries: { | ||
'io.cozy.settings/instance': { | ||
doctype: 'io.cozy.settings', | ||
definition: { | ||
doctype: 'io.cozy.settings', | ||
id: 'io.cozy.settings/io.cozy.settings.instance' | ||
}, | ||
data: [ | ||
{ | ||
id: 'io.cozy.settings/io.cozy.settings.instance', | ||
attributes: { | ||
public_name: 'Alice' | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
clientOptions: { | ||
uri: 'http://alice.cozy.localhost:8080' | ||
} | ||
}) | ||
return ( | ||
<CozyProvider client={fakeClient}> | ||
<CozyTheme> | ||
<BreakpointsProvider> | ||
<I18n lang="en" dictRequire={() => enLocale}> | ||
<div style={{position: "relative"}}> | ||
<Story /> | ||
</div> | ||
</I18n> | ||
</BreakpointsProvider> | ||
</CozyTheme> | ||
</CozyProvider> | ||
)}, | ||
], | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
Binary file not shown.
Binary file not shown.
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