Skip to content

Commit

Permalink
sort of fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Jun 5, 2018
1 parent d7c29db commit 1e52b49
Show file tree
Hide file tree
Showing 18 changed files with 4,198 additions and 3,580 deletions.
2 changes: 1 addition & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = api => ({
'@babel/preset-flow',
],
plugins: [
'@babel/plugin-proposal-decorators',
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-optional-chaining',
],
})
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"babel-eslint": "8.2.1",
"babel-preset-jason": "^4.1.0",
"common-tags": "^1.3.1",
"cpy-cli": "^1.0.0",
"cpy-cli": "^2.0.0",
"cross-env": "^5.1.4",
"css-literal-loader": "^0.3.0",
"css-literal-loader": "^0.4.7",
"eslint": "^4.19.1",
"eslint-config-jason": "^4.0.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-mocha": "^4.6.0",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-react": "^7.7.0",
"glob": "^7.1.2",
"lerna": "^2.9.1",
Expand All @@ -41,5 +41,7 @@
"webpack-atoms": "^5.0.0",
"webpack-merge": "^4.1.0"
},
"workspaces": ["packages/*"]
"workspaces": [
"packages/*"
]
}
2 changes: 1 addition & 1 deletion packages/material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"cpy-cli": "^1.0.1",
"cpy-cli": "^2.0.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-widgets": "^4.2.5"
Expand Down
30 changes: 14 additions & 16 deletions packages/react-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "react-widgets",
"version": "4.2.6",
"description":
"An à la carte set of polished, extensible, and accessible inputs built for React",
"description": "An à la carte set of polished, extensible, and accessible inputs built for React",
"main": "lib/index.js",
"author": {
"name": "Jason",
"email": "monastic.panic@gmail.com"
},
"files": ["lib", "dist"],
"files": [
"lib",
"dist"
],
"keywords": [
"react",
"widgets",
Expand All @@ -30,23 +32,19 @@
"scripts": {
"test": "npm run lint && npm run test-only && npm run test:styles",
"test-only": "jest",
"test:styles":
"npm run styles && node-sass lib/scss/react-widgets.scss -o test/output",
"test:styles": "npm run styles && node-sass lib/scss/react-widgets.scss -o test/output",
"tdd": "jest --watch",
"lint": "eslint src test",
"less":
"lessc -x --autoprefix=\"ie >= 8\" src/less/react-widgets.less dist/css/react-widgets.css",
"less": "lessc -x --autoprefix=\"ie >= 8\" src/less/react-widgets.less dist/css/react-widgets.css",
"styles": "cpy src/less/* lib/less/ && node ../../tools/lessToSass.js",
"assets:lib": "cpy src/img/* lib/img/ && cpy src/fonts/* lib/fonts/",
"assets:dist": "cpy src/img/* dist/img/ && cpy src/fonts/* dist/fonts/",
"clean:lib": "rimraf ./lib/*",
"clean:dist": "rimraf ./dist/*",
"compile:lib": "babel src --out-dir lib",
"compile:dist": "cross-env NODE_ENV=production webpack",
"build:lib":
"npm run clean:lib && npm run compile:lib && npm run styles && npm run assets:lib",
"build:dist":
"npm run clean:dist && npm run compile:dist && npm run less && npm run assets:dist",
"build:lib": "npm run clean:lib && npm run compile:lib && npm run styles && npm run assets:lib",
"build:dist": "npm run clean:dist && npm run compile:dist && npm run less && npm run assets:dist",
"build": "npm run build:lib && npm run build:dist",
"prepublishOnly": "npm run build"
},
Expand All @@ -67,32 +65,32 @@
"invariant": "^2.2.4",
"prop-types-extra": "^1.0.1",
"react-component-managers": "^3.1.0",
"react-transition-group": "^2.3.0",
"react-lifecycles-compat": "^3.0.4",
"react-transition-group": "^2.3.0",
"uncontrollable": "^5.0.0",
"warning": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"babel-core": "bridge",
"babel-jest": "^22.4.3",
"babel-jest": "^23.0.1",
"chai": "^4.1.2",
"cpy-cli": "^1.0.0",
"cpy-cli": "^2.0.0",
"cross-env": "^5.1.4",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.19.1",
"globalize": "^0.1.1",
"jest": "^22.4.3",
"jest": "^23.1.0",
"less": "^2.7.2",
"less-plugin-autoprefix": "^1.5.1",
"lodash": "^4.17.5",
"node-sass": "^4.8.3",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"rimraf": "^2.6.2",
"sinon": "^4.5.0",
"sinon": "^5.0.10",
"webpack": "^3.0.0",
"webpack-atoms": "^5.0.0"
}
Expand Down
12 changes: 8 additions & 4 deletions packages/react-widgets/src/Combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Combobox extends React.Component {

// has to be done early since `accept()` re-focuses the input
handleFocusWillChange = focused => {
if (!focused) this.inputRef?.accept()
if (!focused && this.inputRef) this.inputRef.accept()
if (focused) this.focus()
}

Expand All @@ -194,7 +194,7 @@ class Combobox extends React.Component {
this.close()
notify(this.props.onSelect, [data, { originalEvent }])
this.change(data, false, originalEvent)
this.inputRef?.accept(true)
this.inputRef && this.inputRef.accept(true)
this.focus()
}

Expand Down Expand Up @@ -278,8 +278,12 @@ class Combobox extends React.Component {
let valueItem = accessors.findOrSelf(data, value)

let completeType = suggest
? filter ? 'both' : 'inline'
: filter ? 'list' : ''
? filter
? 'both'
: 'inline'
: filter
? 'list'
: ''

return (
<ComboboxInput
Expand Down
2 changes: 1 addition & 1 deletion www/.babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'@babel/preset-flow',
],
plugins: [
'@babel/plugin-proposal-decorators',
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-optional-chaining',
],
}
5 changes: 4 additions & 1 deletion www/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const slug = require('slug')

const GraphQLJSON = require('graphql-type-json')

exports.onCreateWebpackConfig = ({ actions, rules }) => {
exports.onCreateWebpackConfig = ({ actions, rules, getConfig }) => {
const { setWebpackConfig } = actions

const noAmdRule = {
Expand Down Expand Up @@ -41,6 +41,9 @@ exports.onCreateWebpackConfig = ({ actions, rules }) => {
},
},
})

const current = getConfig()
current.module.rules = current.module.rules.filter(r => r.enforce !== 'pre')
}

exports.createPages = ({ graphql, actions }) => {
Expand Down
16 changes: 8 additions & 8 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
"common-tags": "^1.7.2",
"css-literal-loader": "^0.4.1",
"date-arithmetic": "^3.1.0",
"gatsby": "2.0.0-alpha.12",
"gatsby-link": "^1.6.39",
"gatsby": "2.0.0-alpha.49",
"gatsby-link": "^1.6.38-12",
"gatsby-plugin-catch-links": "^1.0.19",
"gatsby-plugin-less": "2.0.0-alpha.5",
"gatsby-plugin-less": "2.0.0-alpha.15",
"gatsby-plugin-react-helmet": "^1.0.3",
"gatsby-remark-prismjs": "^1.2.21",
"gatsby-source-filesystem": "2.0.0-alpha.4",
"gatsby-transformer-react-docgen": "2.0.1-2",
"gatsby-source-filesystem": "2.0.0-alpha.15",
"gatsby-transformer-react-docgen": "2.0.1-6",
"gatsby-transformer-remark": "^1.7.37",
"gh-pages": "^1.1.0",
"globalize": "^1.1.2",
"graphql": "^0.11.7",
"graphql": "^0.13.0",
"graphql-type-json": "^0.1.4",
"imports-loader": "^0.8.0",
"lodash": "^4.17.5",
Expand All @@ -51,7 +51,7 @@
"unist-util-visit": "^1.3.0"
},
"resolutions": {
"graphql": "0.11.7",
"graphql-type-json": "0.1.4"
"graphql-type-json": "0.1.4",
"react-docgen": "3.0.0-beta12"
}
}
7 changes: 4 additions & 3 deletions www/plugins/gatsby-plugin-jsxtreme-markdown/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ module.exports = function loader(source) {
return stripIndent`
var React = require('react')
var Helmet = require('react-helmet').default
var Layout = require('../layouts').default
var EditableExample = require('../components/EditableExample').default;
var TabbedCodeBlock = require('../components/TabbedCodeBlock').default;
const Tab = (props) => <div {...props} />
module.exports = function Page({ scope, style, className }) {
module.exports = function Page({ scope, location }) {
return (
<section className={className} style={style}>
<Layout location={location}>
<Helmet title="${name}" />
${body}
</section>
</Layout>
)
}
`
Expand Down
29 changes: 11 additions & 18 deletions www/src/components/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import Navbar from 'react-bootstrap/lib/Navbar';
import Nav from 'react-bootstrap/lib/Nav';
import NavItem from 'react-bootstrap/lib/NavItem';
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
import React from 'react'
import Navbar from 'react-bootstrap/lib/Navbar'
import Nav from 'react-bootstrap/lib/Nav'
import NavItem from 'react-bootstrap/lib/NavItem'
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'

import WidgetNav from './WidgetNav';
import SubNavbar from './SubNavbar';
import WidgetNav from './WidgetNav'
import SubNavbar from './SubNavbar'

const _ = less`
.app-navbar {
Expand All @@ -15,27 +15,21 @@ const _ = less`
.app-navbar--widget-nav.navbar-nav {
margin: 0 auto;
}
`;

`

function MobileNav() {
return (
<Nav
role="navigation"
className="visible-xs"
>
<Nav role="navigation" className="visible-xs">
<LinkContainer to="/" onlyActiveOnIndex>
<NavItem>Getting Started</NavItem>
</LinkContainer>
<LinkContainer to="/i18n">
<LinkContainer to="/localization">
<NavItem>Localization </NavItem>
</LinkContainer>
<LinkContainer to="/controllables">
<NavItem>Controlled components</NavItem>
</LinkContainer>
<NavItem href="https://github.com/jquense/react-widgets">
Github
</NavItem>
<NavItem href="https://github.com/jquense/react-widgets">Github</NavItem>
</Nav>
)
}
Expand All @@ -55,6 +49,5 @@ export default function ApiNavbar() {
<div style={{ marginTop: 50 }} />
<SubNavbar className="hidden-xs" />
</div>

)
}
33 changes: 20 additions & 13 deletions www/src/components/SubNavbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
import React from 'react'
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'

const _ = less`
.app-subnavbar {
Expand All @@ -23,26 +23,33 @@ const _ = less`
padding-left: 20px;
}
}
`;

`

export default function SubNavbar({ className = '', style }) {
return (
<div className={`${className} app-subnavbar`} style={style}>
<LinkContainer to="/react-widgets/" onlyActiveOnIndex>
<a><i className='fa fa-play'/> Getting Started</a>
<LinkContainer to="/" onlyActiveOnIndex>
<a>
<i className="fa fa-play" /> Getting Started
</a>
</LinkContainer>
<LinkContainer to="/react-widgets/localization/">
<a><i className='fa fa-globe'/> Localization</a>
<LinkContainer to="/localization/">
<a>
<i className="fa fa-globe" /> Localization
</a>
</LinkContainer>
<LinkContainer to="/react-widgets/theming/">
<a><i className='fa fa-css3'/> Theming</a>
<LinkContainer to="/theming/">
<a>
<i className="fa fa-css3" /> Theming
</a>
</LinkContainer>
<LinkContainer to="/react-widgets/controllables/">
<a><i className='fa fa-cogs'/> Controlled components</a>
<LinkContainer to="/controllables/">
<a>
<i className="fa fa-cogs" /> Controlled components
</a>
</LinkContainer>
<a href="https://github.com/jquense/react-widgets">
<i className='fa fa-github'/> Github
<i className="fa fa-github" /> Github
</a>
</div>
)
Expand Down
15 changes: 7 additions & 8 deletions www/src/components/WidgetNav.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Nav from 'react-bootstrap/lib/Nav';
import NavItem from 'react-bootstrap/lib/NavItem';
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
import React from 'react'
import Nav from 'react-bootstrap/lib/Nav'
import NavItem from 'react-bootstrap/lib/NavItem'
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer'

export const widgets = [
'Calendar',
Expand All @@ -11,14 +11,13 @@ export const widgets = [
'Multiselect',
'NumberPicker',
'SelectList',
];

]

export default function WidgetNav({ className }) {
return (
<Nav role='navigation' className={className}>
<Nav role="navigation" className={className}>
{widgets.map(name => (
<LinkContainer key={name} to={`/react-widgets/api/${name}/`}>
<LinkContainer key={name} to={`/api/${name}/`}>
<NavItem>{name}</NavItem>
</LinkContainer>
))}
Expand Down
Loading

0 comments on commit 1e52b49

Please sign in to comment.