From 62211ee723d18a67fce5b4dd713e4d1b407d1024 Mon Sep 17 00:00:00 2001 From: Simon Franzen Date: Thu, 31 Jan 2019 23:54:30 +0100 Subject: [PATCH] adding more docs --- .gitignore | 1 - README.md | 24 ++------- docs/components.md | 0 docs/examples.md | 1 + docs/extending.md | 36 +++++++++++++ docs/getting-started.md | 16 ++++++ docs/grid.md | 49 +++++++++++++++++ docs/properties.md | 115 ++++++++++++++++++++++++++++++++++++++++ docs/theming.md | 96 +++++++++++++++++++++++++++++++++ styleguide.config.js | 44 ++++++++++++++- 10 files changed, 360 insertions(+), 22 deletions(-) create mode 100644 docs/components.md create mode 100644 docs/examples.md create mode 100644 docs/extending.md create mode 100644 docs/getting-started.md create mode 100644 docs/grid.md create mode 100644 docs/properties.md create mode 100644 docs/theming.md diff --git a/.gitignore b/.gitignore index 6cd909f..2028e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ # production /build /dist -/docs # misc .DS_Store diff --git a/README.md b/README.md index af54e35..df8c729 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ Our goal is to animate more and more developers and companies to create higher o `npm i @magicsoup-io/stock` -## Quick start +## Documentation + +### Quick start `import { Text } from 'magicsoup-io/stock'` ``` @@ -53,25 +55,7 @@ Our goal is to animate more and more developers and companies to create higher o ``` - -## Documentation - -- Quick start -- Property API -- Extending components -- Theming -- Components - - Box - - Flex - - Text - - Heading - - Button - - Link - - Image - - Card -- Advanced -- Examples - +Read the [docs](https://docs.magicsoup.io/) ! ## TBD - Docs (Finish docs for base components) diff --git a/docs/components.md b/docs/components.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/examples.md b/docs/examples.md new file mode 100644 index 0000000..fd9e641 --- /dev/null +++ b/docs/examples.md @@ -0,0 +1 @@ +tbd \ No newline at end of file diff --git a/docs/extending.md b/docs/extending.md new file mode 100644 index 0000000..fc3251a --- /dev/null +++ b/docs/extending.md @@ -0,0 +1,36 @@ +MagicSoup components are great to use as base components that can be extended for various purposes in your design system. + +There are two primary ways to extend MagicSoup components: + +```js static +// React-based extension +import React from 'react' +import { Box } from '@magicsoup.io/stock' + +const Jumbotron = props => + +``` + +Using the css prop requires the use of `babel-plugin-styled-components`: + +```js static +// styled-components based extension +import styled from 'styled-components' +import { Box } from '@magicsoup.io/stock' + +const Jumbotron = styled(Box)({ + maxWidth: '1024px' +}) + +Jumbotron.defaultProps = { + mx: 'auto' +} +``` + +See more [Examples](Examples.md). diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..ddcb1c3 --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,16 @@ + +### Installation +`npm i @magicsoup-io/stock` + +### Usage + +`import { Text } from 'magicsoup-io/stock'` + +```js static + + This is a basic text element + +``` \ No newline at end of file diff --git a/docs/grid.md b/docs/grid.md new file mode 100644 index 0000000..8220415 --- /dev/null +++ b/docs/grid.md @@ -0,0 +1,49 @@ +```jsx + + + + 1/2 + + + + + 1/2 + + + + + 1/3 + + + + + 1/3 + + + + + 1/3 + + + + + 1/4 + + + + + 1/4 + + + + + 1/4 + + + + + 1/4 + + + +``` \ No newline at end of file diff --git a/docs/properties.md b/docs/properties.md new file mode 100644 index 0000000..9eda72d --- /dev/null +++ b/docs/properties.md @@ -0,0 +1,115 @@ +MagicSoup components use styled-system for responsive, theme-based style props. Each MagicSoup component extends the base Box component, which includes several general-purpose style props. + +Read more about [styled-component property API](https://github.com/jxnblk/styled-system/blob/master/docs/api.md) + +### Colors +All MagicSoup components use styled-system's color function to add the `color` and `bg` props. The `color` and `bg` props make using colors from the color palette simple to help promote design consistency. + +The color values can be defined in the theme.colors object. + +```js static + + Background and text color! + +``` + +```js static +// Keys reference values in the color palette object + + +// Background color can be set with the `bg` prop + + +// Values that do not map to a key in `theme.colors` can be used +