Skip to content

Commit

Permalink
Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnblk committed Sep 5, 2018
1 parent 654e730 commit 0a888d5
Show file tree
Hide file tree
Showing 5 changed files with 367 additions and 57 deletions.
58 changes: 33 additions & 25 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
{
"presets": [
"env",
"stage-0",
"react"
presets: [
'stage-0',
'react'
],
"env": {
"emotion": {
"plugins": [
[
"transform-rename-import",
{
"replacements": [
{
"original": "^system-components$",
"replacement": "system-components/emotion"
},
{
"original": "^styled-components$",
"replacement": "emotion-theming"
},
{
"original": "^grid-styled$",
"replacement": "grid-styled/emotion"
}
]
env: {
cjs: {
presets: [
[ 'env', {
targets: {
node: true
}
]
} ]
]
},
es: {
presets: [
[ 'env', {
loose: true,
modules: false
} ]
]
},
'styled-components': {
presets: [
[ 'env', {} ]
],
plugins: [
[ 'transform-rename-import', {
replacements: [
{
original: '^react-emotion$',
replacement: 'styled-components'
}
]
} ]
]
}
}
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

117 changes: 117 additions & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { StyleProvider, ScrollTop } from 'mdx-go'
import {
Box,
Flex,
Text,
Heading,
Link,
Button,
Image,
Card
} from '../src'

export const Root = props =>
<StyleProvider>
<Box
mx='auto'
px={4}
py={4}
css={{
maxWidth: '768px'
}}>
{props.children}
</Box>
<ScrollTop />
</StyleProvider>


# Rebass v3

8 primitive UI components built with styled-system.

- [Box](#box)
- [Flex](#flex)
- [Text](#text)
- [Heading](#heading)
- [Link](#link)
- [Button](#button)
- [Image](#image)
- [Card](#card)

## Box

<Box
p={3}
color='white'
bg='magenta'>
Box
</Box>

## Flex

<Flex>
<Box
p={3}
width={1/2}
color='magenta'
bg='cyan'>
Flex
</Box>
<Box
p={3}
width={1/2}
color='white'
bg='magenta'>
Box
</Box>
</Flex>

## Text

<Text>Text</Text>
<Text fontSize={[ 3, 4, 5 ]}>Large Text</Text>
<Text fontSize={0}>Small Text</Text>
<Text fontWeight='bold'>Bold Text</Text>

## Heading

<Heading>Hello</Heading>

<Text is='h1'>Text is h1</Text>
<Heading is='h1'>Heading is h1</Heading>

<Box bg='tomato'>
<Heading.h1>Hello h1</Heading.h1>
<Heading.h2>Hello h2</Heading.h2>
<Heading.h3>Hello h3</Heading.h3>
<Heading.h4>Hello h4</Heading.h4>
</Box>

## Link

<Link href='https://rebassjs.org'>Link</Link>

## Button

<Button>Button</Button>

## Image

<Image
src='https://source.unsplash.com/random/1280x720'
borderRadius={8}
/>

## Card

<Card
fontSize={6}
fontWeight='bold'
p={5}
my={5}
bg='#f6f6ff'
borderRadius={8}
boxShadow='0 2px 16px rgba(0, 0, 0, 0.25)'
>
Card
</Card>
49 changes: 18 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
"version": "2.1.0",
"description": "Flexible & functional React design system, built with styled-system",
"main": "dist/index.js",
"module": "dist/index.es.js",
"sideEffects": false,
"scripts": {
"prepare": "babel src -d dist && npm run emotion && ./docs/_build.js",
"emotion": "NODE_ENV=emotion babel src -d dist/emotion",
"docs": "./docs/_build.js",
"cover": "jest --coverage --coverageReporters html lcov && codecov",
"prepare": "npm run emotion && npm run emotion-es && npm run styled-components",
"emotion": "NOE_ENV=cjs babel src -d dist",
"emotion-es": "NODE_ENV=es babel src/index.js -o dist/index.es.js",
"styled-components": "NODE_ENV=styled-components babel src -d dist/styled-components",
"start": "mdx-go docs",
"cover": "jest --coverage && codecov",
"test": "jest",
"size": "bundlesize",
"start": "x0 docs -p 9999",
"build": "x0 build docs -d site",
"svg": "scrs docs/Logo.js --svg > docs/logo.svg",
"card": "repng docs/Card.js -w 1024 -h 512 -d docs -f card.png"
"size": "bundlesize"
},
"keywords": [
"components",
Expand All @@ -31,16 +30,12 @@
"author": "Brent Jackson",
"license": "MIT",
"dependencies": {
"chroma-js": "^1.3.6",
"grid-styled": "^5.0.2",
"@rebass/grid": "^6.0.0-0",
"clean-tag": "^2.0.0",
"prop-types": "^15.6.0",
"styled-system": "^3.0.2",
"system-components": "^3.0.0"
"styled-system": "^3.0.2"
},
"devDependencies": {
"@compositor/kit": "^1.0.43",
"@compositor/kit-snapshot": "^1.0.24",
"@compositor/x0": "^6.0.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-transform-rename-import": "^2.2.0",
Expand All @@ -52,19 +47,12 @@
"emotion": "^9.2.3",
"jest": "^23.1.0",
"jest-styled-components": "^6.1.1",
"lodash.sortby": "^4.7.0",
"mdx-go": "^1.1.5",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-emotion": "^9.2.3",
"react-test-renderer": "^16.2.0",
"refunk": "^3.0.1",
"repng": "^3.0.0",
"scrs": "^1.1.0",
"styled-components": "^3.3.2",
"system-docs": "^1.0.0-1"
},
"peerDependencies": {
"styled-components": ">=2.0 || >= 3.0"
"styled-components": "^3.3.2"
},
"repository": {
"type": "git",
Expand All @@ -80,17 +68,16 @@
],
"testMatch": [
"**/test/**/*.js"
],
"coverageReporters": [
"html",
"lcov"
]
},
"bundlesize": [
{
"path": "./dist/*.js",
"maxSize": "2 kB"
}
],
"x0": {
"title": "Rebass",
"template": "./docs/_template.js",
"basename": "/rebass"
}
]
}
Loading

0 comments on commit 0a888d5

Please sign in to comment.