diff --git a/.babelrc b/.babelrc deleted file mode 100644 index a3f0def..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-flow"] -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 5023253..0000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true; -insert_final_newline = true; - -[*.md] -trim_trailing_whitespace = false; diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index c624741..0000000 --- a/.eslintrc +++ /dev/null @@ -1,50 +0,0 @@ -{ - "extends": ["airbnb", "prettier", "prettier/react", "prettier/flowtype", "plugin:flowtype/recommended"], - "plugins": ["prettier", "flowtype"], - "parser": "babel-eslint", - "parserOptions": { - "ecmaVersion": 9, - "ecmaFeatures": { - "jsx": true - } - }, - "env": { - "browser": true, - "es6": true, - "jest": true - }, - "rules": { - "no-unused-vars": ["warn", { "vars": "all" }], - "arrow-body-style": ["error", "as-needed"], - "no-param-reassign": ["error", { "props": true }], - "no-console": "warn", - "react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }], - "radix": "off", - "no-shadow": [ - "error", - { - "builtinGlobals": false, - "hoist": "all", - "allow": ["resolve", "reject", "done", "next", "err", "error", "cb", "callback"] - } - ], - "jsx-a11y/anchor-is-valid": [ - "error", - { - "components": ["Link"], - "specialLink": ["hrefLeft", "hrefRight", "to"], - "aspects": ["noHref", "invalidHref", "preferButton"] - } - ], - "flowtype/define-flow-type": "warn", - "flowtype/use-flow-type": "warn", - "import/no-extraneous-dependencies": "off", - "react/jsx-props-no-spreading": "off", - "react/no-array-index-key": "off" - }, - "settings": { - "flowtype": { - "onlyFilesWithFlowAnnotation": true - } - } -} diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index fb140fe..0000000 --- a/.flowconfig +++ /dev/null @@ -1,19 +0,0 @@ -[ignore] -.*/node_modules/.* -.*/flow-typed/.* -.*/public/.* -.*\.(test|spec)\.js -.*/webpack.config\.js - -[include] - -[libs] - -[lints] - -[options] -module.system.node.resolve_dirname=node_modules -module.system.node.resolve_dirname=src -suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore - -[strict] diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 57b529f..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -yarn-debug.log* -yarn-error.log* -node_modules/ -flow-typed/ -dist/ -lib/*.js diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 54ab281..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "es5", - "singleQuote": true, - "semi": false, - "printWidth": 120 -} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 24adbad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: node_js -node_js: - - 12 - -install: - - yarn install - -script: - - yarn eslint - - yarn test - -before_deploy: - - yarn package - -deploy: - provider: npm - skip_cleanup: true - email: "$NPM_EMAIL" - api_key: "$NPM_TOKEN" - on: - tags: true - -after_deploy: - - test ! -e /home/travis/.npm/_logs ; TRAVIS_TEST_RESULT=$? diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 25e74c8..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Keid - -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 deleted file mode 100644 index 38c914b..0000000 --- a/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# reactstrap-scrollspy - -[![NPM version][npm-image]][npm-url] [![npm module downloads][npm-downloads-image]][npm-downloads-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] [![License: MIT][license-image]][license-url] - -Scrollspy library for [Reactstrap](https://github.com/reactstrap/reactstrap) to create an automatically update navigation easily and flexibly. - -## Demo - -:fire: [Enjoy :+1:](https://keidrun.github.io/reactstrap-scrollspy/) :fire: - -## Install - -```bash -npm i reactstrap-scrollspy -``` - -Or - -```bash -yarn add reactstrap-scrollspy -``` - -## Usage - -This library provides `Scrollspy` and `ScrollspyNavLink` components. - -### Scrollspy - -You should wrap your components in `Scrollspy`. This has mainly two props, which are `names` and `homeIndex`. `names` is used to identify each component wrapped by this, so you should give unique names' list that arranged in order. Then, `homeIndex` is an index number to identify home component such as `Header`. - -#### Props - -```javascript -type Props = { - names: Array, - homeIndex?: number, - topOffset?: string | number, - bottomOffset?: string | number, - delayMs?: number, - children: ChildrenArray, -} -``` - -#### Default Props - -```javascript -Scrollspy.defaultProps = { - homeIndex: 0, - topOffset: '50%', - bottomOffset: '40%', - delayMs: 50, -} -``` - -#### Example - -```javascript -// @flow -import React from 'react' - -import { Scrollspy } from 'reactstrap-scrollspy' -... - -function App() { - return ( - <> - - -
- - - -