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
11 changes: 9 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"presets": ["es2015", "react", "stage-0"],
"plugins": ["transform-decorators-legacy"],
"plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
],
"presets": [
["@babel/preset-env", {
"modules": false
}],
"@babel/preset-react"
]
}
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ cache:
directories:
- node_modules
node_js:
- "8"
- 12
notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
install:
- npm install
- yarn

script:
- npm run build
- yarn build
- git config --global user.name "Travis CI"
- git config --global user.email "[email protected]"
- export GIT_PUBLISH_URL=https://${GH_TOKEN}@github.com/wwayne/react-tooltip.git
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run gh-pages -- --repo ${GIT_PUBLISH_URL}; fi
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then yarn gh-pages -- --repo ${GIT_PUBLISH_URL}; fi

after_success:
- npm run semantic-release
- yarn semantic-release

branches:
except:
Expand Down
12 changes: 0 additions & 12 deletions example/index.html

This file was deleted.

21 changes: 21 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "react-tooltip-example",
"homepage": "https://github.com/wwayne/react-tooltip",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"gh-pages": "^2.1.1",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "^1.1.4",
"react-tooltip": "link:.."
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
}
}
20 changes: 20 additions & 0 deletions example/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">

<link rel="manifest" href="%PUBLIC_URL%/manifest.json">

<title>react-tooltip</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>

<div id="root"></div>
</body>
</html>
8 changes: 8 additions & 0 deletions example/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"short_name": "react-tooltip",
"name": "react-tooltip",
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
228 changes: 228 additions & 0 deletions example/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
html, body {
margin: 0px;
padding: 0px;
min-width: 1024px;
}
.tooltip-example {
background: #1182dd;
height: 550px;
position: relative;
}
.tooltip-example .title {
color: #fff;
padding-top: 50px;
margin-top: 0px;
font-size: 45px;
text-align: center;
margin-bottom: 20px;
font-weight: 700;
}
.demonstration {
width: 600px;
height: 150px;
margin: 10px auto;
background: rgba(0, 0, 0, 0.1);
border-radius: 5px;
box-sizing: border-box;
position: relative;
}
.demonstration a {
display: block;
width: 60px;
height: 60px;
line-height: 60px;
border-radius: 60px;
text-align: center;
color: #222;
background: rgba(255, 255, 255, 1);
position: absolute;
left: 50%;
top: 50%;
margin-left: - 30px;
margin-top: - 15px;
cursor: pointer;
box-shadow: 3px 4px 3px rgba(0, 0, 0, 0.5);
border: 1px solid #333;
}
.demonstration a:after {
content: "hover on me";
text-align: center;
color: rgba(0, 0, 0, 0.25);
position: absolute;
width: 100px;
top: 45px;
left: -18px;
}
.control-panel {
background: rgba(255, 255, 255, 0.4);
border-top: 1px solid rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
height: 230px;
overflow: auto;
}
.control-panel:after {
content: '';
height: 0px;
display: block;
clear: both;
}
.control-panel .button-group {
box-sizing: border-box;
width: 55%;
float: left;
padding-left: 10px;
}
.control-panel .button-group .item {
padding: 3px 2px;
clear: both;
}
.control-panel .button-group .item p {
margin: 10px 0px 2px;
font-size: 18px;
color: #777;
}
.control-panel .button-group .item a {
border-radius: 3px;
text-align: center;
cursor: pointer;
transition: background 0.25s ease-out;
background: #e8e8e8;
float: left;
margin-right: 8px;
padding: 7px 10px;
font-size: 14px;
}
.control-panel .button-group .item a .mark {
color: #888;
font-size: 13px;
display: inline-block;
padding-left: 3px;
}
.control-panel .button-group .item a.active, .control-panel .button-group .item a:hover {
color: #fff;
background: #1182dd;
}
.control-panel .button-group .item a.active .mark, .control-panel .button-group .item a:hover .mark {
color: rgba(255, 255, 255, 0.6);
}
.control-panel pre {
box-sizing: border-box;
width: 45%;
float: left;
}
.control-panel pre div {
background: rgba(255, 255, 255, 0.8);
margin: 0px 20px;
padding: 8px 12px;
}
.control-panel pre .label {
margin: 10px 0px 2px;
font-size: 18px;
color: #777;
}
.advance .title {
color: #222;
padding-top: 100px;
margin-top: 0px;
font-size: 30px;
text-align: center;
margin-bottom: 20px;
font-weight: 700;
}
.advance .sub-title {
border-bottom: 1px solid rgba(0, 0, 0, 0.4);
color: #666;
font-size: 20px;
padding-bottom: 5px;
}
.advance .section {
width: 800px;
margin: 20px auto;
}
.example-jsx {
padding: 10px 0px;
height: 50px;
}
.example-jsx:after {
content: '';
clear: both;
height: 0;
visibility: hidden;
}
.example-jsx .block {
float: left;
}
.example-jsx .block a {
text-align: center;
width: 55px;
height: 55px;
border: 1px solid #999;
border-radius: 0px;
}
.example-jsx .side {
width: 50%;
float: left;
box-sizing: border-box;
}
.example-jsx a {
text-align: center;
width: 55px;
height: 55px;
line-height: 55px;
border-radius: 55px;
display: block;
margin: auto;
cursor: pointer;
color: #999;
border: 1px solid #999;
font-size: 13px;
}
.example-jsx a:hover {
color: #222;
border: 1px solid #222;
}
.example-jsx p {
margin-bottom: 2px;
padding: 0px;
}
.example-jsx ul {
padding: 0px;
list-style: none;
}
.example-jsx ul li {
padding-left: 10px;
margin: 0px;
text-align: left;
}
.example-pre {
border-radius: 2px;
border: 1px solid rgba(0, 0, 0, 0.2);
box-sizing: border-box;
padding: 10px;
margin-bottom: 60px;
font-size: 14px;
}
.example-pre p {
line-height: 30px;
}
.extraClass {
font-size: 20px !important;
pointer-events: auto !important;
}
.extraClass:hover {
visibility: visible !important;
opacity: 1 !important;
}
.customeTheme {
color: #ff6e00 !important;
background-color: orange !important;
}
.customeTheme.place-top:after {
border-top-color: orange !important;
border-top-style: solid !important;
border-top-width: 6px !important;
}
7 changes: 3 additions & 4 deletions example/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'

import "./index.css";
import React from 'react'
import ReactDOM from 'react-dom'
import ReactTooltip from '../../src'
import ReactTooltip from 'react-tooltip'

class Test extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -499,4 +498,4 @@ class Test extends React.Component {
}
}

ReactDOM.render(<Test />, document.getElementById('main'))
ReactDOM.render(<Test />, document.getElementById('root'))
Loading