-
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.
docs(website): improve docs and demo experience
- Loading branch information
1 parent
f09409f
commit 92dfaf4
Showing
43 changed files
with
1,205 additions
and
554 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,33 +1,15 @@ | ||
import React from 'react'; | ||
import { DARK_THEME, styled } from '../src/stitches.config'; | ||
import { BrowserWindow } from '../src/components/browserWindow'; | ||
import { styled } from '../src/stitches.config'; | ||
|
||
const ThemeWrapper = styled('div', { | ||
backgroundColor: '$bg_primary', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'flex-start', | ||
alignItems: 'center', | ||
px: '$4', | ||
py: '$5', | ||
width: '45.5%', | ||
const Wrapper = styled('div', { | ||
height: '100vh', | ||
mb: '$4', | ||
}); | ||
|
||
const ThemeDecorator = (storyFn: any) => ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
}} | ||
> | ||
<ThemeWrapper className="light"> | ||
{storyFn({ id: id => 'light-' + id })} | ||
</ThemeWrapper> | ||
<ThemeWrapper className={DARK_THEME}> | ||
{storyFn({ id: id => 'dark-' + id })} | ||
</ThemeWrapper> | ||
</div> | ||
<Wrapper> | ||
<BrowserWindow>{storyFn()}</BrowserWindow> | ||
</Wrapper> | ||
); | ||
|
||
export default ThemeDecorator; |
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
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,149 @@ | ||
import React from 'react'; | ||
import { styled } from '../../stitches.config'; | ||
import { | ||
ChevronLeft, | ||
ChevronRight, | ||
Layout, | ||
Padlock, | ||
Plus, | ||
Refresh, | ||
Share, | ||
Shield, | ||
Tabs, | ||
TrafficLight, | ||
} from './icons'; | ||
|
||
const Container = styled('div', { | ||
display: 'flex', | ||
padding: '$2', | ||
flex: 1, | ||
borderTopLeftRadius: '$3', | ||
borderTopRightRadius: '$3', | ||
}); | ||
|
||
const AddressBar = styled('div', { | ||
py: '2px', | ||
px: '$2', | ||
display: 'flex', | ||
flex: 1, | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
borderRadius: '$2', | ||
'& small': { | ||
ml: '$1', | ||
}, | ||
'& .url': { | ||
display: 'flex', | ||
alignItems: 'center', | ||
}, | ||
'& .lock > *': { | ||
width: '10px', | ||
height: '10px', | ||
}, | ||
'& .refresh > *': { | ||
width: '12px', | ||
height: '12px', | ||
}, | ||
}); | ||
|
||
const LeftSide = styled('div', { | ||
flex: 1, | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
'& .left': { | ||
display: 'flex', | ||
}, | ||
'& .traffic_light > *': { | ||
mx: '$2', | ||
width: '36px', | ||
height: '14px', | ||
}, | ||
'& .chevrons > *': { | ||
mx: '$2', | ||
width: '8px', | ||
height: '12px', | ||
}, | ||
'& .layout > *': { | ||
mx: '$3', | ||
width: '16px', | ||
height: '12px', | ||
}, | ||
'& .shield > *': { | ||
mx: '$3', | ||
width: '14px', | ||
height: '14px', | ||
}, | ||
}); | ||
const RightSide = styled('div', { | ||
flex: 1, | ||
display: 'flex', | ||
justifyContent: 'flex-end', | ||
alignItems: 'center', | ||
'& > *': { | ||
mx: '$2', | ||
width: '12px', | ||
height: '12px', | ||
}, | ||
}); | ||
|
||
interface IChrome { | ||
theme?: 'light' | 'dark'; | ||
} | ||
|
||
export const BrowserChrome = ({ theme }: IChrome) => { | ||
return ( | ||
<Container | ||
css={{ | ||
backgroundColor: | ||
theme === 'dark' | ||
? 'rgba(38, 43, 47, 0.53)' | ||
: 'rgba(255, 255, 255, 0.78)', | ||
}} | ||
> | ||
<LeftSide> | ||
<div className="left"> | ||
<span className="traffic_light"> | ||
<TrafficLight /> | ||
</span> | ||
<span className="layout"> | ||
<Layout theme={theme} /> | ||
</span> | ||
<span className="chevrons"> | ||
<ChevronLeft theme={theme} /> | ||
<ChevronRight theme={theme} /> | ||
</span> | ||
</div> | ||
<span className="shield"> | ||
<Shield theme={theme} /> | ||
</span> | ||
</LeftSide> | ||
|
||
<AddressBar | ||
css={{ | ||
backgroundColor: | ||
theme === 'dark' ? 'rgba(66, 75, 82, 0.18)' : 'rgba(0, 0, 0, 0.05)', | ||
}} | ||
> | ||
<span></span> | ||
<div className="url"> | ||
<span className="lock"> | ||
<Padlock theme={theme} /> | ||
</span> | ||
<small style={{ color: theme === 'dark' ? '#ccc' : '#000' }}> | ||
camara.space | ||
</small> | ||
</div> | ||
<span className="refresh"> | ||
<Refresh theme={theme} /> | ||
</span> | ||
</AddressBar> | ||
|
||
<RightSide> | ||
<Share theme={theme} /> | ||
<Plus theme={theme} /> | ||
<Tabs theme={theme} /> | ||
</RightSide> | ||
</Container> | ||
); | ||
}; |
Oops, something went wrong.