-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-components): working playground
- Loading branch information
1 parent
faf2134
commit 344ffbb
Showing
20 changed files
with
608 additions
and
58 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
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 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 @@ | ||
//@ts-ignore | ||
export { default as ChevronDown } from 'react-feather/dist/icons/chevron-down'; | ||
//@ts-ignore | ||
export { default as ChevronUp } from 'react-feather/dist/icons/chevron-up'; | ||
//@ts-ignore | ||
export { default as Clipboard } from 'react-feather/dist/icons/clipboard'; | ||
//@ts-ignore | ||
export { default as Code } from 'react-feather/dist/icons/code'; | ||
//@ts-ignore | ||
export { default as Edit } from 'react-feather/dist/icons/edit-2'; | ||
//@ts-ignore | ||
export { default as Github } from 'react-feather/dist/icons/github'; | ||
//@ts-ignore | ||
export { default as Menu } from 'react-feather/dist/icons/menu'; | ||
//@ts-ignore | ||
export { default as Search } from 'react-feather/dist/icons/search'; | ||
//@ts-ignore | ||
export { default as Sun } from 'react-feather/dist/icons/sun'; |
26 changes: 26 additions & 0 deletions
26
core/docz-components/src/components/Playground/LivePreviewWrapper.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** @jsx jsx */ | ||
import * as React from 'react'; | ||
import { jsx, SxProps } from 'theme-ui'; | ||
import get from 'lodash/get'; | ||
import { Theme } from '../../types'; | ||
|
||
const styles = { | ||
iframe: (showingCode: boolean, height = 'auto') => | ||
({ | ||
height, | ||
display: 'block', | ||
minHeight: '100%', | ||
width: 'calc(100% - 2px)', | ||
border: (t: Theme) => | ||
`1px solid ${get(t, 'colors.playground.border', 'none')}`, | ||
borderRadius: showingCode ? '4px 4px 0 0' : '4px', | ||
} as SxProps['sx']), | ||
}; | ||
type Props = { showingCode: boolean }; | ||
|
||
export const LivePreviewWrapper: React.FC<Props> = ({ | ||
children, | ||
showingCode, | ||
}) => { | ||
return <div sx={styles.iframe(showingCode)}>{children}</div>; | ||
}; |
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
34 changes: 19 additions & 15 deletions
34
.../docz-components/src/Playground/styles.js → ...nents/src/components/Playground/styles.ts
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,6 +1 @@ | ||
import * as React from 'react'; | ||
|
||
// Delete me | ||
export const Playground = () => { | ||
return <div>the snozzb erries taste like snozzberries</div>; | ||
}; | ||
export { Playground } from './components/Playground'; |
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,14 @@ | ||
const em = px => `${px / 16}em`; | ||
const mountMedia = val => `@media screen and (max-width: ${em(val)})`; | ||
|
||
export const breakpoints = { | ||
mobile: 630, | ||
tablet: 920, | ||
desktop: 1120, | ||
}; | ||
|
||
export const media = { | ||
mobile: mountMedia(breakpoints.mobile), | ||
tablet: mountMedia(breakpoints.tablet), | ||
desktop: mountMedia(breakpoints.desktop), | ||
}; |
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,12 @@ | ||
export const white = '#FFFFFF'; | ||
export const grayUltraLight = '#FCFBFA'; | ||
export const grayExtraLight = '#F5F6F7'; | ||
export const grayLight = '#CED4DE'; | ||
export const gray = '#7D899C'; | ||
export const grayDark = '#2D3747'; | ||
export const grayExtraDark = '#1D2330'; | ||
export const dark = '#13161F'; | ||
export const blueLight = '#e9f2fa'; | ||
export const blue = '#0B5FFF'; | ||
export const skyBlue = '#1FB6FF'; | ||
export const negative = '#EB4D4B'; |
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,12 @@ | ||
export default { | ||
body: { | ||
margin: 0, | ||
padding: 0, | ||
}, | ||
'.icon-link': { | ||
display: 'none', | ||
}, | ||
'.with-overlay': { | ||
overflow: 'hidden', | ||
}, | ||
}; |
Oops, something went wrong.