├── demo.gif ├── .babelrc ├── src ├── components │ ├── SliderRail.js │ ├── KeyboardHandle.js │ ├── Tick.js │ ├── Handle.js │ └── Track.js ├── styles │ └── index.scss └── index.js ├── .gitignore ├── webpack.config.js ├── LICENSE ├── package.json └── README.md /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizashkod/react-timeline-range-slider/HEAD/demo.gif -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"], 3 | "plugins": [ 4 | "transform-object-rest-spread", 5 | "transform-react-jsx", 6 | "@babel/plugin-proposal-class-properties" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/components/SliderRail.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | export const SliderRail = ({ getRailProps }) => ( 5 | <> 6 |
7 |
8 | 9 | ) 10 | 11 | SliderRail.propTypes = { getRailProps: PropTypes.func.isRequired } 12 | 13 | export default SliderRail 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | /.idea 8 | /dist 9 | 10 | # testing 11 | /coverage 12 | 13 | # production 14 | /build 15 | 16 | # misc 17 | .DS_Store 18 | .env.local 19 | .env.development.local 20 | .env.test.local 21 | .env.production.local 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = { 4 | mode: 'production', 5 | entry: './src/index.js', 6 | output: { 7 | path: path.resolve(__dirname, 'dist'), 8 | filename: 'index.js', 9 | library: 'react-timeline-range-slider', 10 | libraryTarget: 'commonjs2' 11 | }, 12 | module: { 13 | rules: [ 14 | { 15 | test: /\.js$/, 16 | include: path.resolve(__dirname, 'src'), 17 | exclude: /node_modules/, 18 | use: { 19 | loader: 'babel-loader', 20 | options: { 21 | presets: ['@babel/preset-react', "@babel/preset-env"] 22 | } 23 | } 24 | }, { 25 | test: /\.s[ac]ss$/i, 26 | use : [ 'style-loader', 'css-loader', 'sass-loader'] 27 | }, 28 | ] 29 | }, 30 | externals: { 31 | 'react': 'commonjs react' 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/KeyboardHandle.js: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types' 2 | import React from 'react' 3 | 4 | const KeyboardHandle = ({ domain: [min, max], handle: { id, value, percent = 0 }, disabled, getHandleProps }) => ( 5 |