diff --git a/.gitignore b/.gitignore index 6a7945e..b3020e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # OS or Editor folders .DS_Store *.sublime-workspace -npm-debug.log +*.log # Project folders to ignore node_modules diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..43dc96d --- /dev/null +++ b/.npmignore @@ -0,0 +1,9 @@ +dist +example +examples +src +test +.babelrc +.editorconfig +.gitattributes +.jscsrc diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..0d3b9ad --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2018 Sönke Kluth + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 163dab6..20bc9df 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # react-sticky-state -The React Sticky[State] Component makes native position:sticky statefull and polyfills the missing sticky browser feature. +The React Sticky[State] Component makes native position:sticky statefull and polyfills the missing sticky browser feature. Its the React version of https://github.com/soenkekluth/sticky-state -todays browser do not all support the position:sticky feature (which by the way is beeing used (polyfilled) on pretty much every site you visit) - moreover the native supported feature itself comes without a readable state. something like a:hover => div:sticky to add different styles to the element in its sticky state - or to read the state if needed in javacript. +todays browser do not all support the position:sticky feature (which by the way is beeing used (polyfilled) on pretty much every site you visit) - moreover the native supported feature itself comes without a readable state. something like a:hover => div:sticky to add different styles to the element in its sticky state - or to read the state if needed in javacript. unlike almost all polyfills you can find in the wild StickyState is high perfomant. the calculations are reduced to a minimum by persisting several attributes. # Warning concerning Chromes implementation of native position:sticky -it looks like chromes implementaton of position:sticky is different to all other implementations out there. don't know if thats a bug - but bottom is currently not recognized by chrome. there will be a fix for this soon in sticky-state +it looks like chromes implementaton of position:sticky is different to all other implementations out there. don't know if thats a bug - but bottom is currently not recognized by chrome. there will be a fix for this soon in sticky-state ### Browser support IE >= 9, * @@ -22,7 +22,7 @@ npm install react-sticky-state ``` ### css -your css should contain the following lines: +your css should contain the following lines: (you can specify the classNames in js) ```css .sticky { @@ -67,7 +67,7 @@ import Sticky from 'react-sticky-state'; Sticky either takes its only child and adds the behavior and classes to it or wrappes all children inside an element if there are more than one. the tagname can be defined by props. -### possible props +### possible props ```javascript static propTypes = { @@ -112,3 +112,9 @@ static propTypes = { } }; ``` + +# License + +The MIT License (MIT) + +Copyright (c) 2018 Sönke Kluth diff --git a/package.json b/package.json index 1ed37aa..ab70bed 100644 --- a/package.json +++ b/package.json @@ -69,5 +69,9 @@ "object-assign": "^4.1.1", "prop-types": "^15.5.8", "scrollfeatures": "^1.8.4" + }, + "peerDependencies": { + "react": "^15.4.1", + "babel-runtime": "^6.20.0" } } diff --git a/yarn.lock b/yarn.lock index 19d8bcd..af971cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1953,6 +1953,18 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +fbjs@^0.8.16: + version "0.8.16" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.9" + fbjs@^0.8.9: version "0.8.12" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" @@ -3183,6 +3195,14 @@ prop-types@^15.5.7, prop-types@~15.5.7: fbjs "^0.8.9" loose-envify "^1.3.1" +prop-types@^15.5.8: + version "15.6.0" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.3.1" + object-assign "^4.1.1" + ps-tree@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014"