e.length)return;if(!(E instanceof l)){f.lastIndex=0;var v=f.exec(E),_=1;if(!v&&y&&C!=t.length-1){if(f.lastIndex=i,v=f.exec(e),!v)break;for(var T=v.index+(g?v[1].length:0),P=v.index+v[0].length,w=C,k=i,p=t.length;w=k&&(++C,i=k);if(t[C]instanceof l||t[w-1].greedy)continue;_=w-C,E=e.slice(i,k),v.index-=i}if(!v){if(s)break;continue}g&&(x=v[1].length);var T=v.index+x,v=v[0].slice(x),P=T+v.length,A=E.slice(0,T),N=E.slice(P),I=[C,_];A&&(++C,i+=A.length,I.push(A));var M=new l(c,h?a.tokenize(v,h):v,b,v,y);if(I.push(M),N&&I.push(N),Array.prototype.splice.apply(t,I),1!=_&&a.matchGrammar(e,t,n,C,i,!0,c),s)break}}}}},tokenize:function(e,t){var n=[e],r=t.rest;if(r){for(var o in r)t[o]=r[o];delete t.rest}return a.matchGrammar(e,n,t,0,0,!1),n},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var r=0,o;o=n[r++];)o(t)}}},r=a.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||'').length,this.greedy=!!r};if(r.stringify=function(e,t,n){if('string'==typeof e)return e;if('Array'===a.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join('');var i={type:e.type,content:r.stringify(e.content,t,n),tag:'span',classes:['token',e.type],attributes:{},language:t,parent:n};if(e.alias){var s='Array'===a.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,s)}a.hooks.run('wrap',i);var d=Object.keys(i.attributes).map(function(e){return e+'="'+(i.attributes[e]||'').replace(/"/g,'"')+'"'}).join(' ');return'<'+i.tag+' class="'+i.classes.join(' ')+'"'+(d?' '+d:'')+'>'+i.content+''+i.tag+'>'},!n.document)return n.addEventListener?(a.disableWorkerMessageHandler||n.addEventListener('message',function(e){var t=JSON.parse(e.data),r=t.language,o=t.code,i=t.immediateClose;n.postMessage(a.highlight(o,a.languages[r],r)),i&&n.close()},!1),n.Prism):n.Prism;var o=document.currentScript||[].slice.call(document.getElementsByTagName('script')).pop();return o&&(a.filename=o.src,!a.manual&&!o.hasAttribute('data-manual')&&('loading'===document.readyState?document.addEventListener('DOMContentLoaded',a.highlightAll):window.requestAnimationFrame?window.requestAnimationFrame(a.highlightAll):window.setTimeout(a.highlightAll,16))),n.Prism}();'undefined'!=typeof e&&e.exports&&(e.exports=a),'undefined'!=typeof t&&(t.Prism=a)}).call(t,n(47))},function(){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}},function(){Prism.languages.javascript=Prism.languages.extend('clike',{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|\d*\.?\d+(?:[Ee][+-]?\d+)?|NaN|Infinity)\b/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),Prism.languages.insertBefore('javascript','keyword',{regex:{pattern:/(^|[^/])\/(?!\/)(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:'function'}}),Prism.languages.insertBefore('javascript','string',{"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:'punctuation'},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore('markup','tag',{script:{pattern:/(
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
deleted file mode 100644
index 6b57136c..00000000
--- a/docs/index.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
Rebass
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/package.json b/docs/package.json
index 35dc12d2..f1070bcb 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -1,22 +1,33 @@
{
"scripts": {
- "start": "webpack-dev-server",
- "build": "NODE_ENV=production webpack -p",
+ "start": "x0 dev src/App.js -op 9000",
+ "build": "x0 build src/App.js --basename='/rebass' -d .",
+ "demo-build": "x0 build src/Kit.js -d demo",
+ "demo": "x0 dev src/Kit.js -p 9009",
"card": "repng src/Card.js -d 1 -w 1024 -h 512 -o . -f card",
"card-dev": "repng src/Card.js --dev -P 8081"
},
"devDependencies": {
- "babel-loader": "^7.1.2",
- "hidden-styled": "^1.0.0-0",
+ "@compositor/kit": "^1.0.0-1",
+ "@compositor/markdown": "0.0.25",
+ "@compositor/x0": "^3.2.1",
+ "ok-webfont": "^1.0.0-1",
"raw-loader": "^0.5.1",
- "react-live": "^1.7.1",
- "react-markdown": "^3.1.4",
- "react-x-ray": "^1.0.0-4",
- "refunk": "^1.0.0-2",
+ "react-loadable": "^5.3.1",
+ "react-markdown": "^3.2.0",
+ "react-measure": "^2.0.2",
+ "react-router": "^4.2.0",
+ "react-router-dom": "^4.2.2",
+ "refunk": "^2.2.4",
"reline": "^1.0.0-beta.3",
"repng": "^2.0.0-alpha.1",
- "rrx": "^1.0.0-3",
- "webpack": "^3.10.0",
- "webpack-dev-server": "^2.10.0"
+ "styled-components": "^3.1.6"
+ },
+ "x0": {
+ "cssLibrary": "styled-components",
+ "config": "webpack.config.js",
+ "routes": [
+ "/"
+ ]
}
}
diff --git a/docs/src/About.js b/docs/src/About.js
deleted file mode 100644
index 13fc5d7f..00000000
--- a/docs/src/About.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import React from 'react'
-import {
- Container,
- Lead,
-} from 'rebass'
-
-const About = props => (
-
-
- Rebass is a library of highly-composable, primitive UI components for React,
- built with styled-components to keep styles isolated and reduce the need to write custom CSS in your application.
- Based upon a configurable design system,
- Rebass‘s props API makes building consistent, responsive web apps simpler and faster.
-
-
-)
-
-export default About
diff --git a/docs/src/App.js b/docs/src/App.js
index 767efcce..2f77939d 100644
--- a/docs/src/App.js
+++ b/docs/src/App.js
@@ -1,7 +1,14 @@
import React from 'react'
import styled from 'styled-components'
-import { createProvider } from 'refunk'
-import { createRouter, Link } from 'rrx'
+import connect from 'refunk'
+import {
+ BrowserRouter,
+ StaticRouter,
+ Route
+} from 'react-router-dom'
+import Loadable from 'react-loadable'
+import pkg from '../../package.json'
+
import {
Provider,
Sticky,
@@ -9,86 +16,93 @@ import {
Flex,
Box,
Border,
+ theme,
} from 'rebass'
-import NavBar from './NavBar'
-import Home from './Home'
-import GettingStarted from './GettingStarted'
-import PropsView from './PropsView'
-import GridSystem from './GridSystem'
-import Theming from './Theming'
-import Extending from './Extending'
-import ServerSide from './ServerSide'
-import ComponentList from './ComponentList'
-import Component from './Component'
-import SideNav from './SideNav'
-const StickySide = styled(Box)`
- // display: none;
+import Head from './Head'
+import Menu from './Menu'
+import ScrollTop from './ScrollTop'
+import NavBar from './NavBar'
+import Scripts from './Scripts'
- @media screen and (min-width: 32em) {
- flex: none;
- order: 0;
- display: block;
- position: -webkit-sticky;
- position: sticky;
- top: 0;
- bottom: 0;
- height: 100vh;
- overflow: auto;
- }
-`
+const isServer = typeof document === undefined
+const Router = isServer ? StaticRouter : BrowserRouter
+const loading = () => false
-const App = props => {
- const { pathname } = props.location
+const Home = Loadable({ loading, loader: () => import('./Home') })
+const GettingStarted = Loadable({ loading, loader: () => import('./GettingStarted') })
+const PropsView = Loadable({ loading, loader: () => import('./PropsView') })
+const GridSystem = Loadable({ loading, loader: () => import('./GridSystem') })
+const Theming = Loadable({ loading, loader: () => import('./Theming') })
+const Extending = Loadable({ loading, loader: () => import('./Extending') })
+const ServerSide = Loadable({ loading, loader: () => import('./ServerSide') })
+const ComponentList = Loadable({ loading, loader: () => import('./ComponentList') })
+const Component = Loadable({ loading, loader: () => import('./Component') })
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {pathname !== '/' && (
-
-
-
-
-
- )}
-
-
- )
-}
+const App = connect(class extends React.Component {
+ render () {
+ const {
+ update,
+ basename,
+ pathname,
+ pkg,
+ theme,
+ menu,
+ } = this.props
-const theme = {
- maxWidth: 1280
-}
+ return (
+
+
+
+
+
+
+
+ update({ menu: false })}>
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ }
+})
-const state = {
+App.defaultProps = {
+ pkg,
+ menu: false,
xray: false,
- overlay: false,
+ modal: false,
drawer: false,
checked: false,
fixed: false,
+ theme: {
+ ...theme,
+ maxWidths: [
+ 1280
+ ]
+ },
}
-export default createProvider(state)(createRouter(App))
+export default App
diff --git a/docs/src/CTA.js b/docs/src/CTA.js
deleted file mode 100644
index 351a1943..00000000
--- a/docs/src/CTA.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react'
-import { Link } from 'rrx'
-import {
- Flex,
- Box,
- Text,
- Pre,
- Button,
-} from 'rebass'
-import Section from './Section'
-
-const CTA = props => (
-
-
- Read the docs to get started
-
-
-
- npm i rebass
-
-
-
-
-)
-
-export default CTA
diff --git a/docs/src/Card.js b/docs/src/Card.js
index da98b029..0a967c1e 100644
--- a/docs/src/Card.js
+++ b/docs/src/Card.js
@@ -1,24 +1,22 @@
import React from 'react'
-import { Provider, Banner } from '../src'
import Logo from './Logo'
const photo = 'https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=2048&q=20'
const Card = props => (
-
-
-
-
-
+
+
+
)
export default Card
diff --git a/docs/src/Colors.js b/docs/src/Colors.js
deleted file mode 100644
index 775bf018..00000000
--- a/docs/src/Colors.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import React from 'react'
-import {
- Flex,
- Box,
- Text,
- Link,
- Pre,
- colors
-} from 'rebass'
-import Section from './Section'
-
-const keys = Object.keys(colors)
- .filter(key => !/black|white|base|[0-9]$/.test(key))
-const ten = Array.from({ length: 10 }).map((n, i) => i)
-
-const Card = props => (
-
-
-
- {ten.map(n => (
-
- ))}
-
-
- {props.name} {props.value}
-
-
-)
-
-const Colors = props => (
-
-
- Rebass includes a default color palette generated by
- {' '}
-
- Palx
- ,
- which includes 12 hues, grays, and luminance-scaled variations of each hue for nuanced UI color design.
-
-
- {keys.map(key => (
-
- ))}
-
-
-)
-
-export default Colors
diff --git a/docs/src/Component.js b/docs/src/Component.js
index f358f8c1..968ea7c1 100644
--- a/docs/src/Component.js
+++ b/docs/src/Component.js
@@ -1,5 +1,4 @@
import React from 'react'
-import { createView } from 'rrx'
import {
Flex,
Box,
@@ -9,8 +8,10 @@ import Example from './Example'
import Pagination from './Pagination'
import { components } from './examples'
+console.log('Component')
+
const Component = props => {
- const { name } = props.params
+ const { name } = props.match.params
const index = components.indexOf(name)
const previousName = components[index - 1]
const nextName = components[index + 1]
@@ -31,7 +32,7 @@ const Component = props => {
{name}
@@ -47,4 +48,4 @@ const Component = props => {
)
}
-export default createView(Component)
+export default Component
diff --git a/docs/src/ComponentList.js b/docs/src/ComponentList.js
index 21b80c18..8f3a51e3 100644
--- a/docs/src/ComponentList.js
+++ b/docs/src/ComponentList.js
@@ -1,10 +1,12 @@
import React from 'react'
-import { createView, Link } from 'rrx'
+import { Link } from 'react-router-dom'
import {
Flex,
+ Box,
Heading,
BlockLink,
Card,
+ Border,
Divider,
Pre,
} from 'rebass'
@@ -13,7 +15,7 @@ import PageTitle from './PageTitle'
import Preview from './Preview'
const CompCard = props => (
-
+
(
overflow: 'hidden'
}}
/>
-
- {props.name}
-
+
+ {props.name}
+