Skip to content

Commit a654d67

Browse files
author
Minh Tran
committed
Version 0.2.0
1 parent e07dda9 commit a654d67

37 files changed

Lines changed: 852 additions & 539 deletions

.babelrc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{
22
"stage": 0,
3-
"optional": []
4-
}
3+
"optional": [],
4+
"env": {
5+
"development": {
6+
"plugins": ["react-transform"],
7+
"extra": {
8+
"react-transform": {
9+
"transforms": [
10+
{
11+
"transform": "react-transform-hmr",
12+
"imports": ["react"],
13+
"locals": ["module"]
14+
}
15+
]
16+
}
17+
}
18+
}
19+
}
20+
}

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "example/app/bower_components"
2+
"directory": "example/app/assets/bower_components"
33
}

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"quotes": [2, "single", "avoid-escape"],
2828
"semi": 2,
2929
"no-underscore-dangle": 0,
30-
"no-unused-vars": [2, {"args": "all"}],
30+
"no-unused-vars": 2,
3131
"camelcase": [2, {"properties": "never"}],
3232
"new-cap": 0,
3333
"accessor-pairs": 0,

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ npm install --save-dev react-tooltip-component
1515
#### Webpack
1616

1717
```js
18-
import('react-tooltip-component/lib/tooltip.css');
18+
import 'react-tooltip-component/lib/tooltip.css';
1919
//require('react-tooltip-component/lib/tooltip.css');
2020
```
2121

@@ -35,6 +35,17 @@ import Tooltip from 'react-tooltip-component';
3535
</Tooltip>
3636
```
3737

38+
### UMD
39+
40+
```html
41+
<link rel="stylesheet" type="text/css" href="path/to/react-tooltip-component/dist/tooltip.css">
42+
<script src="path/to/react-tooltip-component/dist/react-tooltip-component.js"></script>
43+
```
44+
45+
```js
46+
const Tooltip = window.ReactTooltipComponent;
47+
```
48+
3849
## Props
3950

4051
| Name | Type | Required | Default | Description |
@@ -47,4 +58,4 @@ import Tooltip from 'react-tooltip-component';
4758

4859
## Example
4960

50-
View [demo](http://vn38minhtran.github.io/react-tooltip-component) or example folder.
61+
View [demo](http://vn38minhtran.github.io/react-tooltip-component) or example folder.

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "react-tooltip-component",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "React component.",
5-
"main": "lib/index.js",
5+
"main": ["dist/react-tooltip-component.js", "dist/tooltip"],
66
"keywords": [
77
"react-component",
88
"react",
@@ -21,4 +21,4 @@
2121
"devDependencies": {
2222
"bootstrap-customize": "~3.3.4"
2323
}
24-
}
24+
}

dist/react-tooltip-component.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tooltip.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/app/app.js

Lines changed: 30 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,39 @@
11
import 'babel-core/polyfill';
2+
23
import React from 'react';
34
import ReactDOM from 'react-dom';
4-
import Header from './components/Header.js';
5-
import Footer from './components/Footer.js';
6-
import Tooltip from 'react-tooltip-component';
5+
import {createHistory, useBasename} from 'history';
6+
import Router from 'react-router';
7+
import App from 'components/App.js';
8+
import pkg from '../../package.json';
79

8-
import './bower_components/bootstrap-customize/css/bootstrap.css';
9-
//import 'react-tooltip-component/src/tooltip.scss';
10-
import './assets/styles/app.scss';
10+
import 'assets/bower_components/bootstrap-customize/css/bootstrap.css';
11+
import 'react-tooltip-component/src/tooltip.scss';
12+
import 'assets/styles/app.scss';
1113

12-
class App extends React.Component {
13-
render() {
14-
return (
15-
<div className='layout-page'>
16-
<Header/>
17-
<main className='layout-main'>
18-
<div className='container'>
19-
<div className='tooltips-example'>
20-
<Tooltip title='Tooltip on top' position='top'>
21-
<button className='btn btn-default'>Tooltip on top</button>
22-
</Tooltip>
23-
<Tooltip title='Tooltip on bottom' position='bottom'>
24-
<button className='btn btn-default'>Tooltip on bottom</button>
25-
</Tooltip>
26-
<Tooltip title='Tooltip on left' position='left'>
27-
<button className='btn btn-default'>Tooltip on left</button>
28-
</Tooltip>
29-
<Tooltip title='Tooltip on right' position='right'>
30-
<button className='btn btn-default'>Tooltip on right</button>
31-
</Tooltip>
32-
</div>
33-
<hr/>
34-
<div className='tooltips-example'>
35-
<Tooltip title='Tooltip on top' position='top' fixed={false}>
36-
<button className='btn btn-default btn-lg'>
37-
Tooltip on top [fixed=false]
38-
</button>
39-
</Tooltip>
40-
<Tooltip title='Tooltip on bottom' position='bottom'
41-
fixed={false}>
42-
<button className='btn btn-default btn-lg'>
43-
Tooltip on bottom [fixed=false]
44-
</button>
45-
</Tooltip>
46-
<Tooltip title='Tooltip on left' position='left' fixed={false}>
47-
<button className='btn btn-default btn-lg'>
48-
Tooltip on left [fixed=false]
49-
</button>
50-
</Tooltip>
51-
<Tooltip title='Tooltip on right' position='right' fixed={false}>
52-
<button className='btn btn-default btn-lg'>
53-
Tooltip on right [fixed=false]
54-
</button>
55-
</Tooltip>
56-
</div>
57-
<hr/>
58-
<div className='tooltips-example'>
59-
<Tooltip title='Tooltip on bottom' position='bottom' space={10}>
60-
<button className='btn btn-default'>
61-
Tooltip on bottom [space=10]
62-
</button>
63-
</Tooltip>
64-
<Tooltip title='Tooltip on bottom' position='bottom' space={20}>
65-
<button className='btn btn-default'>
66-
Tooltip on bottom [space=20]
67-
</button>
68-
</Tooltip>
69-
<Tooltip title='Tooltip on bottom' position='bottom' space={30}>
70-
<button className='btn btn-default'>
71-
Tooltip on bottom [space=30]
72-
</button>
73-
</Tooltip>
74-
<Tooltip title='Tooltip on bottom' position='bottom' space={40}>
75-
<button className='btn btn-default'>
76-
Tooltip on bottom [space=40]
77-
</button>
78-
</Tooltip>
79-
</div>
80-
</div>
81-
</main>
82-
<Footer/>
83-
</div>
84-
);
85-
}
86-
}
14+
const routes = {
15+
path: '/',
16+
component: App,
17+
indexRoute: {
18+
component: require('./components/pages/PageHome')
19+
},
20+
childRoutes: [
21+
require('./routes/Example1Route'),
22+
require('./routes/Example2Route')
23+
]
24+
};
8725

88-
function run() {
89-
ReactDOM.render(<App />, document.getElementById('app'));
90-
}
26+
const DEV = process && process.env && process.env.NODE_ENV === 'development';
27+
const history = useBasename(createHistory)({
28+
basename: '/' + (DEV ? '' : pkg.name)
29+
});
30+
31+
const run = () => {
32+
ReactDOM.render(
33+
<Router routes={routes} history={history}/>,
34+
document.getElementById('app')
35+
);
36+
};
9137

9238
if (window.addEventListener) {
9339
window.addEventListener('DOMContentLoaded', run);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@keyframes spinner {
2+
0% {
3+
transform: rotate(0deg);
4+
}
5+
100% {
6+
transform: rotate(360deg);
7+
}
8+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@mixin clearfix() {
2+
&:before,
3+
&:after {
4+
content: " ";
5+
display: table;
6+
}
7+
&:after {
8+
clear: both;
9+
}
10+
}

0 commit comments

Comments
 (0)