-
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.
- Loading branch information
Showing
183 changed files
with
27,418 additions
and
27,417 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 |
---|---|---|
@@ -1,60 +1,60 @@ | ||
import React from "react"; | ||
import { ThemeProvider } from "styled-components"; | ||
import { Decorator } from "@storybook/react"; | ||
import React from 'react'; | ||
import { ThemeProvider } from 'styled-components'; | ||
import { Decorator } from '@storybook/react'; | ||
|
||
import GlobalStyles from "../../src/providers/GlobalStyles"; | ||
import { lightTheme, darkTheme } from "../../src/styles/theme"; | ||
import GlobalStyles from '../../src/providers/GlobalStyles'; | ||
import { lightTheme, darkTheme } from '../../src/styles/theme'; | ||
|
||
import styled, { css } from "styled-components"; | ||
import styled, { css } from 'styled-components'; | ||
|
||
const ThemeBlock = styled.div<{ left?: boolean; fill?: boolean }>( | ||
({ left, fill, theme }) => css` | ||
position: absolute; | ||
top: 0; | ||
left: ${left || fill ? 0 : "50vw"}; | ||
border-right: ${left ? "1px solid #202020" : "none"}; | ||
right: ${left ? "50vw" : 0}; | ||
width: ${fill ? "100vw" : "50vw"}; | ||
bottom: 0; | ||
overflow: auto; | ||
padding: 1rem; | ||
background: ${theme.colorScheme === "dark" ? "#1f1d1d" : "#fff"}; | ||
` | ||
({ left, fill, theme }) => css` | ||
position: absolute; | ||
top: 0; | ||
left: ${left || fill ? 0 : '50vw'}; | ||
border-right: ${left ? '1px solid #202020' : 'none'}; | ||
right: ${left ? '50vw' : 0}; | ||
width: ${fill ? '100vw' : '50vw'}; | ||
bottom: 0; | ||
overflow: auto; | ||
padding: 1rem; | ||
background: ${theme.colorScheme === 'dark' ? '#1f1d1d' : '#fff'}; | ||
`, | ||
); | ||
|
||
const withTheme: Decorator = (StoryFn, context) => { | ||
const { theme } = context.globals; | ||
const themeToUse = theme === "light" ? lightTheme : darkTheme; | ||
const { theme } = context.globals; | ||
const themeToUse = theme === 'light' ? lightTheme : darkTheme; | ||
|
||
switch (theme) { | ||
case "side-by-side": { | ||
return ( | ||
<> | ||
<ThemeProvider theme={lightTheme}> | ||
<GlobalStyles /> | ||
<ThemeBlock left> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
<ThemeProvider theme={darkTheme}> | ||
<GlobalStyles /> | ||
<ThemeBlock> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
</> | ||
); | ||
} | ||
default: { | ||
return ( | ||
<ThemeProvider theme={themeToUse}> | ||
<GlobalStyles /> | ||
<ThemeBlock fill theme={themeToUse}> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
); | ||
} | ||
} | ||
switch (theme) { | ||
case 'side-by-side': { | ||
return ( | ||
<> | ||
<ThemeProvider theme={lightTheme}> | ||
<GlobalStyles /> | ||
<ThemeBlock left> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
<ThemeProvider theme={darkTheme}> | ||
<GlobalStyles /> | ||
<ThemeBlock> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
</> | ||
); | ||
} | ||
default: { | ||
return ( | ||
<ThemeProvider theme={themeToUse}> | ||
<GlobalStyles /> | ||
<ThemeBlock fill theme={themeToUse}> | ||
<StoryFn /> | ||
</ThemeBlock> | ||
</ThemeProvider> | ||
); | ||
} | ||
} | ||
}; | ||
export default withTheme; |
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,38 +1,38 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
import type { StorybookConfig } from '@storybook/react-webpack5'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
"@storybook/addon-controls", | ||
"@storybook/addon-a11y", | ||
"@storybook/addon-designs", | ||
], | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'@storybook/addon-controls', | ||
'@storybook/addon-a11y', | ||
'@storybook/addon-designs', | ||
], | ||
|
||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: { | ||
builder: { | ||
useSWC: true, | ||
}, | ||
}, | ||
}, | ||
docs: { | ||
autodocs: true, | ||
}, | ||
core: { | ||
disableTelemetry: true, | ||
}, | ||
swc: () => ({ | ||
jsc: { | ||
transform: { | ||
react: { | ||
runtime: "automatic", | ||
}, | ||
}, | ||
}, | ||
}), | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: { | ||
builder: { | ||
useSWC: true, | ||
}, | ||
}, | ||
}, | ||
docs: { | ||
autodocs: true, | ||
}, | ||
core: { | ||
disableTelemetry: true, | ||
}, | ||
swc: () => ({ | ||
jsc: { | ||
transform: { | ||
react: { | ||
runtime: 'automatic', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}; | ||
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
<link rel="shortcut icon" href="/favicon.ico"> | ||
<link rel="icon" type="image/png" href="/logo.svg" sizes="192x192"> | ||
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="icon" type="image/png" href="/logo.svg" sizes="192x192" /> |
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,10 +1,10 @@ | ||
import { addons } from "@storybook/manager-api"; | ||
import { addons } from '@storybook/manager-api'; | ||
|
||
import LagoonTheme from "./theme"; | ||
import LagoonTheme from './theme'; | ||
|
||
addons.setConfig({ | ||
theme: LagoonTheme, | ||
sidebar: { | ||
showRoots: false, | ||
}, | ||
theme: LagoonTheme, | ||
sidebar: { | ||
showRoots: false, | ||
}, | ||
}); |
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 |
---|---|---|
|
@@ -22,11 +22,8 @@ const preview: Preview = { | |
date: /Date$/i, | ||
}, | ||
}, | ||
|
||
|
||
docs: { | ||
|
||
|
||
source: { | ||
language: '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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { create } from "@storybook/theming"; | ||
import { create } from '@storybook/theming'; | ||
|
||
import logo from "./public/logo.svg"; | ||
import logo from './public/logo.svg'; | ||
|
||
export default create({ | ||
base: "dark", | ||
brandTitle: "Lagoon", | ||
brandUrl: "http://lagoon.sh/", | ||
brandImage: logo, | ||
brandTarget: "_blank", | ||
base: 'dark', | ||
brandTitle: 'Lagoon', | ||
brandUrl: 'http://lagoon.sh/', | ||
brandImage: logo, | ||
brandTarget: '_blank', | ||
}); |
Oops, something went wrong.