Skip to content

Commit 53cbec9

Browse files
committed
Merge In Progress
2 parents 75138a3 + 4609833 commit 53cbec9

31 files changed

+21857
-14135
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dependency directories
2+
node_modules/
3+
4+
# Styling
5+
*.scss
6+
7+
# Dist
8+
build/
9+
dist/
10+
standalone/

.eslintrc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": [
4+
"standard",
5+
"standard-react",
6+
"prettier",
7+
"eslint:recommended"
8+
],
9+
"env": {
10+
"es6": true,
11+
"jest": true
12+
},
13+
"plugins": [
14+
"react",
15+
"prettier"
16+
],
17+
"parserOptions": {
18+
"sourceType": "module",
19+
"ecmaVersion": 2018,
20+
"ecmaFeatures": {
21+
"impliedStrict": true,
22+
"jsx": true,
23+
"arrowFunctions": true,
24+
"blockBindings": true,
25+
"defaultParams": true,
26+
"destructuring": true,
27+
"forOf": true,
28+
"generators": true,
29+
"objectLiteralComputedProperties": true,
30+
"objectLiteralShorthandMethods": true,
31+
"objectLiteralShorthandProperties": true,
32+
"experimentalObjectRestSpread": true,
33+
"restParams": true,
34+
"spread": true,
35+
"templateStrings": true,
36+
"modules": true,
37+
"classes": true
38+
}
39+
},
40+
"rules": {
41+
"space-before-function-paren": 0,
42+
"react/jsx-boolean-value": 0,
43+
"max-len": [2, {"code":120,"ignoreComments":true}],
44+
"newline-per-chained-call": 0,
45+
"quotes": ["error", "double"],
46+
"comma-dangle": ["error", "never"],
47+
"semi": ["error", "always"],
48+
"array-bracket-spacing": ["error", "always"],
49+
"quote-props": ["error", "consistent-as-needed"]
50+
}
51+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
!.gitignore
99
!.npmignore
1010

11+
# NPM
12+
package-lock.json
13+
1114
# files
1215
node_modules/
1316
example/dist/

Makefile

Lines changed: 0 additions & 67 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,32 @@
77
[download-image]: https://img.shields.io/npm/dm/react-tooltip.svg?style=flat-square
88
[download-url]: https://npmjs.org/package/react-tooltip
99

10+
## Demo
11+
12+
[![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/heuristic-curran-bddeu?fontsize=14&hidenavigation=1&theme=dark)
13+
1014
## Maintainers
1115

12-
[huumanoid](https://github.com/huumanoid)
16+
[aronhelser](https://github.com/aronhelser) Passive maintainer - accepting PRs and doing minor testing, but not fixing issues or doing active development.
17+
18+
[Rogger794](https://github.com/Rogger794) Active maintainer - accepting PRs and doing minor testing, fixing issues or doing active development.
1319

14-
[aronhelser](https://github.com/aronhelser)
20+
[huumanoid](https://github.com/huumanoid) (inactive)
21+
22+
We would gladly accept a new maintainer to help out!
1523

1624
## Installation
1725

1826
```sh
1927
npm install react-tooltip
2028
```
2129

30+
or
31+
32+
```sh
33+
yarn add react-tooltip
34+
```
35+
2236
## Usage
2337
**Using NPM**
2438

@@ -29,13 +43,13 @@ import ReactTooltip from 'react-tooltip'
2943
```
3044

3145
2 . Add data-tip = "your placeholder" to your element
46+
3247
```jsx
3348
<p data-tip="hello world">Tooltip</p>
3449
```
3550

3651
3 . Include react-tooltip component
3752

38-
3953
```js
4054
<ReactTooltip />
4155
```
@@ -88,9 +102,6 @@ className | data-class | String | | extra custom class, can use !importan
88102

89103
The `html` option allows a tooltip to directly display raw HTML. This is a security risk if any of that content is supplied by the user. Any user-supplied content must be sanitized, using a package like [sanitize-html-react](https://www.npmjs.com/package/sanitize-html-react). We chose not to include sanitization after discovering it [increased our package size](https://github.com/wwayne/react-tooltip/issues/429) too much - we don't want to penalize people who don't use the `html` option.
90104

91-
## Using react component as tooltip
92-
Check the example [React-tooltip Test](https://react-tooltip.netlify.com/)
93-
94105
##### Note:
95106
1. **data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
96107
2. **data-for** corresponds to the **id** of `<ReactTooltip />`

bin/transferSass.js

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
1-
var sass = require('node-sass')
2-
var fs = require('fs')
3-
var path = require('path')
1+
var sass = require("node-sass");
2+
var fs = require("fs");
3+
var path = require("path");
44

5-
function transferSass () {
6-
sass.render({
7-
file: path.resolve(__dirname, '../src/index.scss'),
8-
outputStyle: 'compressed'
9-
}, function (err, result) {
10-
if (err) {
11-
console.log(err)
12-
return
13-
}
14-
var cssSource = result.css.toString()
15-
fs.writeFile(path.resolve(__dirname, '../src/style.js'), "export default '" + cssSource.replace(/\n/g, '') + "'", function (err) {
5+
function transferSass() {
6+
sass.render(
7+
{
8+
file: path.resolve(__dirname, "../src/index.scss"),
9+
outputStyle: "compressed",
10+
},
11+
function(err, result) {
1612
if (err) {
17-
console.error(err)
13+
console.log(err);
14+
return;
1815
}
19-
console.log('css file has been transformed to JS successful')
20-
fs.writeFile(path.resolve(__dirname, '../src/style.css'), cssSource, function (err) {
21-
if (err) {
22-
console.error(err)
16+
var cssSource = result.css.toString();
17+
fs.writeFile(
18+
path.resolve(__dirname, "../src/style.js"),
19+
"export default '" + cssSource.replace(/\n/g, "") + "'",
20+
function(err) {
21+
if (err) {
22+
console.error(err);
23+
}
24+
console.log("css file has been transformed to JS successful");
25+
fs.writeFile(
26+
path.resolve(__dirname, "../src/style.css"),
27+
cssSource,
28+
function(err) {
29+
if (err) {
30+
console.error(err);
31+
}
32+
console.log("css file has been transformed successful");
33+
process.exit();
34+
}
35+
);
2336
}
24-
console.log('css file has been transformed successful')
25-
process.exit()
26-
})
27-
})
28-
})
37+
);
38+
}
39+
);
2940
}
3041

31-
transferSass()
42+
transferSass();
3243

33-
fs.watch(path.resolve(__dirname, '../src/index.scss'), function (event, filename) {
34-
console.log(event, filename)
35-
transferSass()
36-
})
44+
fs.watch(path.resolve(__dirname, "../src/index.scss"), function(
45+
event,
46+
filename
47+
) {
48+
console.log(event, filename);
49+
transferSass();
50+
});

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"gh-pages": "^2.1.1",
88
"react": "^16.4.1",
99
"react-dom": "^16.4.1",
10-
"react-scripts": "^1.1.4"
10+
"react-scripts": "^1.1.4",
11+
"react-tooltip": "link:.."
1112
},
1213
"scripts": {
1314
"start": "react-scripts start",

0 commit comments

Comments
 (0)