diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..4687bc4
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,3 @@
+{
+ "presets": ["es2015", "react", "stage-0"]
+}
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..8d87b1d
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+node_modules/*
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..cd99e01
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,153 @@
+{
+ "env": {
+ "browser": true,
+ "node": true
+ },
+
+ "parser": "babel-eslint",
+
+ "plugins": [
+ "react"
+ ],
+
+ "ecmaFeatures": {
+ "jsx": true
+ },
+
+ "rules": {
+ // For a complete reference, check out http://eslint.org/docs/rules/
+
+ //-------------------------------------------------------------------------
+ // Best practices
+ //-------------------------------------------------------------------------
+
+ // Prevent abbreviated blocks for clarity
+ "curly": 2,
+
+ // Enforce a reasonable cap on functions spiralling out of control
+ // with many branches.
+ "complexity": [2, 10],
+
+ // Prefer foo.x over foo['x']; static properties are always preferable
+ // to dynamic strings.
+ "dot-notation": 2,
+
+ "dot-location": [2, "property"],
+
+ // enforce === and !== for comparisons
+ "eqeqeq": [2, "smart"],
+
+ "guard-for-in": 2,
+
+ "no-floating-decimal": 2,
+
+ // Avoid funny things with parseInt.
+ // See: http://stackoverflow.com/questions/850341
+ "radix": 2,
+
+ // Avoid pitfalls when trying to call a just-declared function.
+ "wrap-iife": 2,
+
+ // May the force be with you.
+ "yoda": [0, "always"],
+
+ //-------------------------------------------------------------------------
+ // Strict Mode
+ //-------------------------------------------------------------------------
+
+ // Transpilers deal with the effects of strict, so ignore it.
+ "strict": [2, "never"],
+
+ //-------------------------------------------------------------------------
+ // Variable declaration
+ //-------------------------------------------------------------------------
+ "no-use-before-define": 2,
+
+ "no-undefined": 2,
+
+ "no-unused-vars": 2,
+
+ //-------------------------------------------------------------------------
+ // Code style
+ //-------------------------------------------------------------------------
+
+ // The one true brace style.
+ "brace-style": [2, "1tbs"],
+
+ "camelcase": 0,
+
+ "comma-spacing": [2, { "before": false, "after": true }],
+
+ "consistent-this": [2, "_this"],
+
+ "eol-last": 2,
+
+ "indent": [2, 2],
+
+ "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+
+ "new-cap": 2,
+
+ "no-lonely-if": 2,
+
+ "no-mixed-spaces-and-tabs": [2, true],
+
+ "no-multiple-empty-lines": 2,
+
+ // Nested ternaries are just plain confusing. Avoiding them keeps the
+ // code readable.
+ "no-nested-ternary": 2,
+
+ // There are no such thing as "private" properties. Use closure
+ // variables if you really need isolation.
+ "no-underscore-dangle": 0,
+
+ "no-spaced-func": 2,
+
+ // use one variable declaration for each variable you want to define
+ "one-var": [2, "never"],
+
+ // enforce double quotes
+ "quotes": [2, "double"],
+
+ // Enforce whitespace for visual clarity.
+ "space-after-keywords": [2, "always"],
+ "spaced-comment": [2, "always", { "exceptions": ["-"] }],
+
+ //-------------------------------------------------------------------------
+ // ECMAScript 6
+ //-------------------------------------------------------------------------
+
+ // Enforce `const` and `let` to describe what's going on.
+ "no-var": 2,
+
+ //-------------------------------------------------------------------------
+ // React
+ //-------------------------------------------------------------------------
+ "jsx-quotes": [2, "prefer-double"],
+ "react/jsx-uses-vars": 2,
+ "react/jsx-uses-react": 2,
+
+ // Display name is not needed when using ES6-style components
+ "react/display-name": 0,
+
+ // Make things consistent and readable – prefer `x={true}` over `x`
+ "react/jsx-boolean-value": 2,
+
+ // Keep the quote style consistent with Javascript land
+ "react/jsx-no-undef": 2,
+ "react/jsx-sort-props": 0,
+ "react/jsx-sort-prop-types": 0,
+ "react/no-did-mount-set-state": 1,
+ "react/no-did-update-set-state": 1,
+ "react/no-multi-comp": 2,
+ "react/no-unknown-property": 2,
+ "react/react-in-jsx-scope": 1,
+ "react/self-closing-comp": 2,
+ "react/wrap-multilines": 2,
+
+ // Potential issue in React ESLint package- receiving 'Can't add property
+ // react, object is not extensible' when used with eslint-loader.
+ "react/prop-types": 0
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..3f363a7
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+build/*
diff --git a/README.md b/README.md
index 1f3f1ec..6874e41 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,13 @@
# FlowTip
-*A flexible, adaptable and easy to use tooltip positioning library.*
+*A flexible, adaptable and easy to use tooltip component for React.js*
-* [Website](http://qiushihe.github.io/flowtip)
-* [Interactive Demo](http://qiushihe.github.io/flowtip/demo.html)
-* [Github Repo](https://github.com/qiushihe/flowtip)
+Looking for the non-React.js version? It's in the [v1](v1) folder.
## Dependencies
-* [jQuery](http://jquery.com)
-* [Unerscore.js](http://underscorejs.org)
-* [CoffeeScript](http://coffeescript.org) (development only)
+* React
+* ReactDOM
## Glossaries
@@ -38,40 +35,35 @@ then in term aligned to the pivot.
## Basic Usage
-Creates an instance of the **FlowTip** object:
+To include an instance of FlowTip in your component:
- var tooltip = new FlowTip();
+```
+
+ FlowTip as React Component
+