Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"es2015",
"react"
]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/webpack.*
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "airbnb",
"env": {
"browser": true,
"node": true
},
"rules": {
"react/prefer-es6-class": 0,
"react/prefer-stateless-function": 0
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
build/
node_modules/
npm-debug.log
lib/
9 changes: 0 additions & 9 deletions .npmignore

This file was deleted.

10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ node_js:
- "4"
- "5"
- stable

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
email:
on_failure: change
on_success: never
script:
- npm run lint
- npm test
6 changes: 4 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"build",
"examples",
"lib",
"src",
"node_modules",
"specs",
"package.json"
"package.json",
"webpack.*"
]
}
}
6 changes: 3 additions & 3 deletions examples/basic/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Tab, Tabs, TabList, TabPanel } from '../../lib/main';
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';

const App = React.createClass({
render() {
Expand Down Expand Up @@ -83,7 +83,7 @@ const App = React.createClass({
</Tabs>
</div>
);
}
},
});

ReactDOM.render(<App/>, document.getElementById('example'));
ReactDOM.render(<App />, document.getElementById('example'));
34 changes: 17 additions & 17 deletions examples/conditional/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Tab, Tabs, TabList, TabPanel } from '../../lib/main';
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';

const App = React.createClass({
getInitialState() {
return {
showA: true,
showB: true,
showC: true
showC: true,
};
},

Expand All @@ -19,35 +19,35 @@ const App = React.createClass({

render() {
return (
<div style={{padding: 50}}>
<div style={{ padding: 50 }}>
<p>
<label>
<input type="checkbox" checked={this.state.showA} name="showA" onChange={this.handleCheckClicked}/>
<input type="checkbox" checked={this.state.showA} name="showA" onChange={this.handleCheckClicked} />
Show A
</label><br/>
</label><br />
<label>
<input type="checkbox" checked={this.state.showB} name="showB" onChange={this.handleCheckClicked}/>
<input type="checkbox" checked={this.state.showB} name="showB" onChange={this.handleCheckClicked} />
Show B
</label><br/>
</label><br />
<label>
<input type="checkbox" checked={this.state.showC} name="showC" onChange={this.handleCheckClicked}/>
<input type="checkbox" checked={this.state.showC} name="showC" onChange={this.handleCheckClicked} />
Show C
</label><br/>
</label><br />
</p>
<Tabs>
<TabList>
{ this.state.showA && <Tab>Tab A</Tab> }
{ this.state.showB && <Tab>Tab B</Tab> }
{ this.state.showC && <Tab>Tab C</Tab> }
{this.state.showA && <Tab>Tab A</Tab>}
{this.state.showB && <Tab>Tab B</Tab>}
{this.state.showC && <Tab>Tab C</Tab>}
</TabList>
{ this.state.showA && <TabPanel>This is tab A</TabPanel> }
{ this.state.showB && <TabPanel>This is tab B</TabPanel> }
{ this.state.showC && <TabPanel>This is tab C</TabPanel> }
{this.state.showA && <TabPanel>This is tab A</TabPanel>}
{this.state.showB && <TabPanel>This is tab B</TabPanel>}
{this.state.showC && <TabPanel>This is tab C</TabPanel>}
</Tabs>
</div>
);
}
},
});

ReactDOM.render(<App/>, document.getElementById('example'));
ReactDOM.render(<App />, document.getElementById('example'));

36 changes: 18 additions & 18 deletions examples/dyno/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Modal from 'react-modal';
import { Tab, Tabs, TabList, TabPanel } from '../../lib/main';
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';

Modal.setAppElement(document.getElementById('example'));
Modal.injectCSS();
Expand All @@ -12,17 +12,17 @@ const App = React.createClass({
isModalOpen: false,
selectedIndex: -1,
tabs: [
{label: 'Foo', content: 'This is foo'},
{label: 'Bar', content: 'This is bar'},
{label: 'Baz', content: 'This is baz'},
{label: 'Zap', content: 'This is zap'}
]
{ label: 'Foo', content: 'This is foo' },
{ label: 'Bar', content: 'This is bar' },
{ label: 'Baz', content: 'This is baz' },
{ label: 'Zap', content: 'This is zap' },
],
};
},

render() {
return (
<div style={{padding: 50}}>
<div style={{ padding: 50 }}>
<p>
<button onClick={this.openModal}>+ Add</button>
</p>
Expand All @@ -43,13 +43,13 @@ const App = React.createClass({
<Modal
isOpen={this.state.isModalOpen}
onRequestClose={this.closeModal}
style={{width: 400, height: 350, margin: '0 auto'}}
style={{ width: 400, height: 350, margin: '0 auto' }}
>
<h2>Add a Tab</h2>
<label htmlFor="label">Label:</label><br/>
<input id="label" type="text" ref="label"/><br/><br/>
<label htmlFor="content">Content:</label><br/>
<textarea id="content" ref="content" rows="10" cols="50"></textarea><br/><br/>
<label htmlFor="label">Label:</label><br />
<input id="label" type="text" ref="label" /><br /><br />
<label htmlFor="content">Content:</label><br />
<textarea id="content" ref="content" rows="10" cols="50"></textarea><br /><br />
<button onClick={this.addTab}>OK</button>{' '}
<button onClick={this.closeModal}>Cancel</button>
</Modal>
Expand All @@ -59,13 +59,13 @@ const App = React.createClass({

openModal() {
this.setState({
isModalOpen: true
isModalOpen: true,
});
},

closeModal() {
this.setState({
isModalOpen: false
isModalOpen: false,
});
},

Expand All @@ -75,18 +75,18 @@ const App = React.createClass({

this.state.tabs.push({
label: label,
content: content
content: content,
});
this.setState({
selectedIndex: this.state.tabs.length - 1
selectedIndex: this.state.tabs.length - 1,
});
this.closeModal();
},

removeTab(index) {
this.state.tabs.splice(index, 1);
this.forceUpdate();
}
},
});

ReactDOM.render(<App/>, document.getElementById('example'));
ReactDOM.render(<App />, document.getElementById('example'));
8 changes: 4 additions & 4 deletions examples/focus/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Tab, Tabs, TabList, TabPanel } from '../../lib/main';
import { Tab, Tabs, TabList, TabPanel } from '../../src/main';

const App = React.createClass({
handleInputChange() {
Expand All @@ -9,7 +9,7 @@ const App = React.createClass({

render() {
return (
<div style={{padding: 50}}>
<div style={{ padding: 50 }}>
<Tabs>
<TabList>
<Tab>First</Tab>
Expand All @@ -28,7 +28,7 @@ const App = React.createClass({
</Tabs>
</div>
);
}
},
});

ReactDOM.render(<App/>, document.getElementById('example'));
ReactDOM.render(<App />, document.getElementById('example'));
48 changes: 0 additions & 48 deletions lib/components/__tests__/Tab-test.js

This file was deleted.

23 changes: 0 additions & 23 deletions lib/components/__tests__/TabList-test.js

This file was deleted.

39 changes: 0 additions & 39 deletions lib/components/__tests__/TabPanel-test.js

This file was deleted.

Loading