Skip to content

Commit a90d539

Browse files
committed
Babel configuration, Documentation updates
1 parent 3d80a8f commit a90d539

File tree

16 files changed

+18311
-9829
lines changed

16 files changed

+18311
-9829
lines changed

.babelrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
2-
"presets": ["es2015", "react", "stage-0"],
3-
"plugins": ["transform-decorators-legacy"],
2+
"plugins": [
3+
["@babel/plugin-proposal-decorators", { "legacy": true }],
4+
"@babel/plugin-syntax-dynamic-import",
5+
"@babel/plugin-syntax-import-meta",
6+
["@babel/plugin-proposal-class-properties", { "loose": false }],
7+
"@babel/plugin-proposal-json-strings"
8+
],
9+
"presets": [
10+
"@babel/preset-env",
11+
"@babel/preset-react"
12+
]
413
}

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ deploy: lint
6060
@echo success!
6161

6262
.PHONY: lint convertCSS genStand devJS devCSS devServer dev deployExample deployJS deployCSS deploy
63+

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ className | data-class | String | | extra custom class, can use !importan
7070
delayUpdate | data-delay-update | Number | | `<p data-tip="tooltip" data-delay-update='1000'></p>` or `<ReactTooltip delayUpdate={1000} />` Sets a delay in calling getContent if the tooltip is already shown and you mouse over another target
7171
insecure | null | Bool | true, false | Whether to inject the style header into the page dynamically (violates CSP style-src but is a convenient default)
7272
border | data-border | Bool | true, false | Add one pixel white border
73+
textColor | data-text-color | String | e.g. red | Popup text color
74+
backgroundColor | data-background-color | String | e.g. yellow | Popup background color
75+
arrowColor | data-arrow-color | String | e.g. #fff | Popup arrow color - if not specified, will use the *backgroundColor* value
7376
getContent | null | Func or Array | (dataTip) => {}, [(dataTip) => {}, Interval] | Generate the tip content dynamically
7477
afterShow | null | Func | (evt) => {} | Function that will be called after tooltip show, with event that triggered show
7578
afterHide | null | Func | (evt) => {} | Function that will be called after tooltip hide, with event that triggered hide

exa.json

Lines changed: 535 additions & 0 deletions
Large diffs are not rendered by default.

example/index.html

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

example/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "react-tooltip-example",
3+
"homepage": "https://github.com/wwayne/react-tooltip",
4+
"version": "1.0.0",
5+
"license": "MIT",
6+
"dependencies": {
7+
"gh-pages": "^2.1.1",
8+
"react": "^16.4.1",
9+
"react-dom": "^16.4.1",
10+
"react-scripts": "^1.1.4",
11+
"react-tooltip": "link:.."
12+
},
13+
"scripts": {
14+
"start": "react-scripts start",
15+
"build": "react-scripts build",
16+
"test": "react-scripts test --env=jsdom",
17+
"eject": "react-scripts eject",
18+
"predeploy": "npm run build",
19+
"deploy": "gh-pages -d build"
20+
}
21+
}

example/public/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<meta name="theme-color" content="#000000">
7+
8+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
9+
10+
<title>react-tooltip</title>
11+
</head>
12+
13+
<body>
14+
<noscript>
15+
You need to enable JavaScript to run this app.
16+
</noscript>
17+
18+
<div id="root"></div>
19+
</body>
20+
</html>

example/public/manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"short_name": "react-tooltip",
3+
"name": "react-tooltip",
4+
"start_url": "./index.html",
5+
"display": "standalone",
6+
"theme_color": "#000000",
7+
"background_color": "#ffffff"
8+
}

example/src/index.css

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
html, body {
2+
margin: 0px;
3+
padding: 0px;
4+
min-width: 1024px;
5+
}
6+
.tooltip-example {
7+
background: #1182dd;
8+
height: 550px;
9+
position: relative;
10+
}
11+
.tooltip-example .title {
12+
color: #fff;
13+
padding-top: 50px;
14+
margin-top: 0px;
15+
font-size: 45px;
16+
text-align: center;
17+
margin-bottom: 20px;
18+
font-weight: 700;
19+
}
20+
.demonstration {
21+
width: 600px;
22+
height: 150px;
23+
margin: 10px auto;
24+
background: rgba(0, 0, 0, 0.1);
25+
border-radius: 5px;
26+
box-sizing: border-box;
27+
position: relative;
28+
}
29+
.demonstration a {
30+
display: block;
31+
width: 60px;
32+
height: 60px;
33+
line-height: 60px;
34+
border-radius: 60px;
35+
text-align: center;
36+
color: #222;
37+
background: rgba(255, 255, 255, 1);
38+
position: absolute;
39+
left: 50%;
40+
top: 50%;
41+
margin-left: - 30px;
42+
margin-top: - 15px;
43+
cursor: pointer;
44+
box-shadow: 3px 4px 3px rgba(0, 0, 0, 0.5);
45+
border: 1px solid #333;
46+
}
47+
.demonstration a:after {
48+
content: "hover on me";
49+
text-align: center;
50+
color: rgba(0, 0, 0, 0.25);
51+
position: absolute;
52+
width: 100px;
53+
top: 45px;
54+
left: -18px;
55+
}
56+
.control-panel {
57+
background: rgba(255, 255, 255, 0.4);
58+
border-top: 1px solid rgba(0, 0, 0, 0.2);
59+
position: absolute;
60+
bottom: 0px;
61+
left: 0px;
62+
right: 0px;
63+
width: 100%;
64+
height: 230px;
65+
overflow: auto;
66+
}
67+
.control-panel:after {
68+
content: '';
69+
height: 0px;
70+
display: block;
71+
clear: both;
72+
}
73+
.control-panel .button-group {
74+
box-sizing: border-box;
75+
width: 55%;
76+
float: left;
77+
padding-left: 10px;
78+
}
79+
.control-panel .button-group .item {
80+
padding: 3px 2px;
81+
clear: both;
82+
}
83+
.control-panel .button-group .item p {
84+
margin: 10px 0px 2px;
85+
font-size: 18px;
86+
color: #777;
87+
}
88+
.control-panel .button-group .item a {
89+
border-radius: 3px;
90+
text-align: center;
91+
cursor: pointer;
92+
transition: background 0.25s ease-out;
93+
background: #e8e8e8;
94+
float: left;
95+
margin-right: 8px;
96+
padding: 7px 10px;
97+
font-size: 14px;
98+
}
99+
.control-panel .button-group .item a .mark {
100+
color: #888;
101+
font-size: 13px;
102+
display: inline-block;
103+
padding-left: 3px;
104+
}
105+
.control-panel .button-group .item a.active, .control-panel .button-group .item a:hover {
106+
color: #fff;
107+
background: #1182dd;
108+
}
109+
.control-panel .button-group .item a.active .mark, .control-panel .button-group .item a:hover .mark {
110+
color: rgba(255, 255, 255, 0.6);
111+
}
112+
.control-panel pre {
113+
box-sizing: border-box;
114+
width: 45%;
115+
float: left;
116+
}
117+
.control-panel pre div {
118+
background: rgba(255, 255, 255, 0.8);
119+
margin: 0px 20px;
120+
padding: 8px 12px;
121+
}
122+
.control-panel pre .label {
123+
margin: 10px 0px 2px;
124+
font-size: 18px;
125+
color: #777;
126+
}
127+
.advance .title {
128+
color: #222;
129+
padding-top: 100px;
130+
margin-top: 0px;
131+
font-size: 30px;
132+
text-align: center;
133+
margin-bottom: 20px;
134+
font-weight: 700;
135+
}
136+
.advance .sub-title {
137+
border-bottom: 1px solid rgba(0, 0, 0, 0.4);
138+
color: #666;
139+
font-size: 20px;
140+
padding-bottom: 5px;
141+
}
142+
.advance .section {
143+
width: 800px;
144+
margin: 20px auto;
145+
}
146+
.example-jsx {
147+
padding: 10px 0px;
148+
height: 50px;
149+
}
150+
.example-jsx:after {
151+
content: '';
152+
clear: both;
153+
height: 0;
154+
visibility: hidden;
155+
}
156+
.example-jsx .block {
157+
float: left;
158+
}
159+
.example-jsx .block a {
160+
text-align: center;
161+
width: 55px;
162+
height: 55px;
163+
border: 1px solid #999;
164+
border-radius: 0px;
165+
}
166+
.example-jsx .side {
167+
width: 50%;
168+
float: left;
169+
box-sizing: border-box;
170+
}
171+
.example-jsx a {
172+
text-align: center;
173+
width: 55px;
174+
height: 55px;
175+
line-height: 55px;
176+
border-radius: 55px;
177+
display: block;
178+
margin: auto;
179+
cursor: pointer;
180+
color: #999;
181+
border: 1px solid #999;
182+
font-size: 13px;
183+
}
184+
.example-jsx a:hover {
185+
color: #222;
186+
border: 1px solid #222;
187+
}
188+
.example-jsx p {
189+
margin-bottom: 2px;
190+
padding: 0px;
191+
}
192+
.example-jsx ul {
193+
padding: 0px;
194+
list-style: none;
195+
}
196+
.example-jsx ul li {
197+
padding-left: 10px;
198+
margin: 0px;
199+
text-align: left;
200+
}
201+
.example-pre {
202+
border-radius: 2px;
203+
border: 1px solid rgba(0, 0, 0, 0.2);
204+
box-sizing: border-box;
205+
padding: 10px;
206+
margin-bottom: 60px;
207+
font-size: 14px;
208+
}
209+
.example-pre p {
210+
line-height: 30px;
211+
}
212+
.extraClass {
213+
font-size: 20px !important;
214+
pointer-events: auto !important;
215+
}
216+
.extraClass:hover {
217+
visibility: visible !important;
218+
opacity: 1 !important;
219+
}
220+
.customeTheme {
221+
color: #ff6e00 !important;
222+
background-color: orange !important;
223+
}
224+
.customeTheme.place-top:after {
225+
border-top-color: orange !important;
226+
border-top-style: solid !important;
227+
border-top-width: 6px !important;
228+
}

0 commit comments

Comments
 (0)