{"_id":"@deriv/deriv-onboarding","_rev":"12-f8697d6e0c9fdf698f7a3c5efef88ab3","name":"@deriv/deriv-onboarding","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@deriv/deriv-onboarding","version":"1.0.0","description":"Tourist Guide into your React Components","main":"dist/reactour.cjs.js","module":"dist/reactour.esm.js","scripts":{"prepare":"npm run lib","start":"webpack-dev-server --mode development --open","prelib":"rimraf dist","lib":"rollup -c","build":"webpack --mode production","lint":"eslint --fix ./; exit 0","dev":"rollup -c -w"},"repository":{"type":"git"},"keywords":["react","tour","intro","guide","introduction","step-by-step","guide","walkthrough","joyride","tourist-guide","product-intro","presentation"],"author":{"name":"Akmal Djumakhodjaev","email":"akmal@deriv.com"},"license":"MIT","bugs":{"url":"https://github.com/binary-com/deriv-onboarding-component/issues"},"homepage":"https://github.com/binary-com/deriv-onboarding-component#readme","devDependencies":{"@babel/cli":"7.7.5","@babel/core":"7.7.5","@babel/plugin-proposal-class-properties":"7.7.4","@babel/plugin-syntax-dynamic-import":"7.7.4","@babel/polyfill":"7.7.0","@babel/preset-env":"7.7.5","@babel/preset-react":"7.7.4","babel-eslint":"10.0.3","babel-loader":"8.0.6","body-scroll-lock":"2.6.4","css-loader":"3.2.1","eslint":"6.7.2","eslint-config-prettier":"6.7.0","eslint-plugin-prettier":"3.1.1","html-loader":"0.5.5","html-webpack-plugin":"3.2.0","prettier":"1.19.1","react":"^16.8","react-dom":"^16.8","react-is":"^16.8","reshake":"1.2.1","rimraf":"3.0.0","rollup":"1.27.8","rollup-plugin-babel":"4.3.3","rollup-plugin-filesize":"6.2.1","rollup-plugin-node-resolve":"5.2.0","style-loader":"1.0.1","webpack":"4.41.2","webpack-cli":"3.3.10","webpack-dev-server":"3.9.0"},"peerDependencies":{"react":"^16.3.0","react-dom":"^16.3.0","react-is":"^16.8"},"dependencies":{"@rooks/use-mutation-observer":"3.4.2","classnames":"2.2.6","focus-outline-manager":"^1.0.2","lodash.debounce":"4.0.8","prop-types":"15.7.2","react-focus-lock":"2.2.1","react-virtualized":"^9.22.2","scroll-smooth":"1.1.0","scrollparent":"2.0.1","styled-components":"^5.0.0"},"gitHead":"ac1e7ae6a4dc35f934de1c8da994ffb2e82bd042","_id":"@deriv/deriv-onboarding@1.0.0","_nodeVersion":"15.8.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-a0xYUwqYZqRhtfrHoMcVHCkLcTT462LXhXmQA0eLzSIUX1LSSQyNor2cdGReI3HICnsTlckyJZXLtjYdLmVZkQ==","shasum":"c9e56f46ee31977ebf0dfbb3652de10e91f09c3b","tarball":"https://registry.npmjs.org/@deriv/deriv-onboarding/-/deriv-onboarding-1.0.0.tgz","fileCount":5,"unpackedSize":84705,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoj8ICRA9TVsSAnZWagAAN8oQAJO8xNaudogSJokrgONt\nQlbrQgwq2lKdAzMhfWrC9uYTyxqUARFl4N3fe1B7Zpw2+C+Lz2/PBn9U7gf3\nJ6wuZKrFnfEZ843q49yVskT/D27ayBlzgC0vogwhfoMNZsie3P0yOl0c7qz0\nVw5SnQP4J3lZj4TVgOVoU4InbdWc35g5eAC5hkruxTb3/u1No5hRGoIYFksL\n0bE2g2GQhA+hTTKlmyMIs8rt9IbaSXBVOEm3ImTkykqiC0eYQpiLzYLyA5Ph\nDGDmz+bZpzvu3MP5jpu1t2/uPQAyiRNxNxvAO3ACv8cX4Wmop49AXlxjSzrH\nStjTs+9G6pn7/89R28DwtsWG/77f12533KHc0kW8m6iHGwro+nzANLWs39rP\nrc/uV4+7i/4h6XCznrwMjzt0yx4V15AoZVhB3hWrpQBRAdEXoX2eRLNnRht9\nNukgitN/nSuSqmUEziJqeofwJqmn8zB3JypjQwLpi8NAA83wZeZn7/88ybdR\nkfFgfo936A4JG7jYa3C8iHLLaxmK56C9R7jK8/NEQnuLfH6zZTkv8W0HoIJp\noSv4pNUf+qfKS2leI5yG0klHF3w0ZiVh7gGnuvwNj7WliVHRbx4xYPHS/OuD\nTY0zpAl5fP9FpAyrnKvHZAgONfd3u2zCBhrFJp8Tu4sfNS6cxYKmIMm3yUfm\nZvzd\r\n=0GYb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2oTd+8XE9EPiyIV9fRU3VVUFBeHxu8FoPWEzSnljyBQIgclNqAJm5CiM/mhNxWBeoc9baRvBAY5OomU0a7yZaZ5Q="}]},"_npmUser":{"name":"zaki-binary","email":"zaki@binary.com"},"directories":{},"maintainers":[{"name":"mahdiaryayi-fs","email":"mahdi.aryayi@firstsource.tech"},{"name":"shayan-binary-2","email":"shayan@firstsource.tech"},{"name":"balakrishna-binary","email":"bala.krishna@regentmarkets.com"},{"name":"kevin-binary","email":"kevin@binary.com"},{"name":"deriv-frontend","email":"fe-access@deriv.com"},{"name":"ashkanx","email":"ashkan@binary.com"},{"name":"zaki-binary","email":"zaki@binary.com"},{"name":"negar-binary","email":"negar@binary.com"},{"name":"aaron-binary","email":"aaim@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deriv-onboarding_1.0.0_1621245703956_0.06026926024232071"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-17T10:01:43.661Z","1.0.0":"2021-05-17T10:01:44.082Z","modified":"2023-01-12T11:54:27.898Z"},"maintainers":[{"email":"lipika@deriv.com","name":"lipika-deriv"},{"email":"fe-access@deriv.com","name":"deriv-frontend"}],"description":"Tourist Guide into your React Components","homepage":"https://github.com/binary-com/deriv-onboarding-component#readme","keywords":["react","tour","intro","guide","introduction","step-by-step","guide","walkthrough","joyride","tourist-guide","product-intro","presentation"],"repository":{"type":"git"},"author":{"name":"Akmal Djumakhodjaev","email":"akmal@deriv.com"},"bugs":{"url":"https://github.com/binary-com/deriv-onboarding-component/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img alt=\"Reactour\" title=\"Reactour\" src=\"/logo.svg\" width=\"250\">\n</p>\n<p align=\"center\" style=\"margin-top: 40px\">\n  <strong>Tourist Guide</strong> into your React Components\n</p>\n<p align=\"center\">\n  <a href=\"https://elrumordelaluz.github.io/reactour/\">Demo</a>\n</p>\n<p align=\"center\">\n  <a href=\"https://codesandbox.io/s/6z56m8x18k?module=%2FApp.js\">\n    <img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"Edit 6z56m8x18k\">\n  </a>\n</p>\n\n<br />\n\n> ⚠️ The `master` branch is currently in _development_. Please use the [v1 branch](https://github.com/elrumordelaluz/reactour/tree/v1) to follow the current versions published.\n\n<br />\n\n## Install\n\n```zsh\nnpm i -S reactour\n# or\nyarn add reactour\n```\n\n<small>From `v1.9.1` [styled-components](https://www.styled-components.com/) it isn't bundled into the package and is required `styled-components@^4` and `react@^16.3` due to the use of [createRef](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs), so: </small>\n\n```zsh\nnpm i -S styled-components@^4.0.0\n# or\nyarn add styled-components@^4.0.0\n```\n\n## Usage\n\nAdd the `Tour` Component in your Application, passing the `steps` with the elements to highlight during the _Tour_.\n\n```js\nimport React, { useState } from 'react'\nimport Tour from 'reactour'\n\nconst steps = [\n  {\n    selector: '.first-step',\n    content: 'This is my first Step',\n  },\n  // ...\n];\n\nconst App = () => {\n  const [isTourOpen, setIsTourOpen] = useState(false);\n\n  return (\n    <>\n      { /* other stuff */}\n      <Tour\n        steps={steps}\n        isOpen={isTourOpen}\n        onRequestClose={() => setIsTourOpen(false)}\n      />\n    </>\n  )\n};\n```\n\n### Tour Props\n\n#### accentColor\n\n> Change `--reactour-accent` _(defaults to accentColor on IE)_ css custom prop to apply color in _Helper_, number, dots, etc\n\nType: `string`\n\nDefault: `#007aff`\n\n#### accessibilityOptions\n\n> Configure accessibility related accessibility options\n\nType: `object`\n\nDefault:\n```js\n    // attribute to associate the dialog with a title for screen readers\n    ariaLabelledBy: null,\n    // aria-label attribute for the close button\n    closeButtonAriaLabel: 'Close',\n    // Show/Hide Navigation Dots for screen reader software\n    showNavigationScreenReaders: true,\n```\n\n#### badgeContent\n\n> Customize _Badge_ content using `current` and `total` steps values\n\nType: `func`\n\n```js\n// example\n<Tour badgeContent={(curr, tot) => `${curr} of ${tot}`} />\n```\n\n#### children\n\n> Content to be rendered inside the _Helper_\n\nType: `node | elem`\n\n#### className\n\n> Custom class name to add to the _Helper_\n\nType: `string`\n\n#### closeWithMask\n\n> Close the _Tour_ by clicking the _Mask_\n\nType: `bool`\n\nDefault: `true`\n\n#### disableDotsNavigation\n\n> Disable interactivity with _Dots_ navigation in _Helper_\n\nType: `bool`\n\n#### disableInteraction\n\n> Disable the ability to click or intercat in any way with the _Highlighted_ element\n\nType: `bool`\n\n#### disableFocusLock\n\n> Disable the ability to set a focus on Input in the _Highlighted_ element\n\nType: `bool`\n\nDefault: `true`\n\n#### disableKeyboardNavigation\n\n> Disable all keyboard navigation (next and prev step) when true, disable only selected keys when array\n\nType: `bool | array(['esc', 'right', 'left'])`\n\n```js\n// example\n<Tour disableKeyboardNavigation={['esc']} />\n```\n\n#### getCurrentStep\n\n> Function triggered each time current step change\n\nType: `func`\n\n```js\n// example\n<Tour getCurrentStep={curr => console.log(`The current step is ${curr + 1}`)} />\n```\n\n#### goToStep\n\n> Programmatically change current step after the first render, when the value changes\n\nType: `number`\n\n#### highlightedMaskClassName\n\n> Custom class name to add to the element which is the overlay for the target element when `disableInteraction`\n\nType: `string`\n\n#### inViewThreshold\n\n> Tolerance in pixels to add when calculating if an element is outside viewport to scroll into view\n\nType: `number`\n\n#### isOpen\n\n> You know…\n\nType: `bool`\n\nRequired: `true`\n\n#### lastStepNextButton\n\n> Change Next button in last step into a custom button to close the Tour\n\nType: `node`\n\n```js\n// example\n<Tour lastStepNextButton={<MyButton>Done! Let's start playing</MyButton>} />\n```\n\n#### maskClassName\n\n> Custom class name to add to the _Mask_\n\nType: `string`\n\n#### maskSpace\n\n> Extra Space between in pixels between Highlighted element and _Mask_\n\nType: `number`\n\nDefault: `10`\n\n#### nextButton\n\n> Renders as next button navigation\n\nType: `node`\n\n#### nextStep\n\n> Overrides default `nextStep` internal function\n\nType: `func`\n\n#### onAfterOpen\n\n> Do something after _Tour_ is opened\n\nType: `func`\n\n```js\n// example\n<Tour onAfterOpen={target => (document.body.style.overflowY = 'hidden')} />\n```\n\n#### onBeforeClose\n\n> Do something before _Tour_ is closed\n\nType: `func`\n\n```js\n// example\n<Tour onBeforeClose={target => (document.body.style.overflowY = 'auto')} />\n```\n\n#### onRequestClose\n\n> Function to close the _Tour_\n\nType: `func`\n\nRequired: `true`\n\n#### prevButton\n\n> Renders as prev button navigation\n\nType: `node`\n\n#### prevStep\n\n> Overrides default `prevStep` internal function\n\nType: `func`\n\n#### rounded\n\n> Beautify _Helper_ and _Mask_ with `border-radius` (in px)\n\nType: `number`\n\nDefault: `0`\n\n#### scrollDuration\n\n> Smooth scroll duration when positioning the target element (in ms)\n\nType: `number`\n\nDefault: `1`\n\n#### scrollOffset\n\n> Offset when positioning the target element after scroll to it\n\nType: `number`\n\nDefault: a calculation to the center of the viewport\n\n#### showButtons\n\n> Show/Hide _Helper_ Navigation buttons\n\nType: `bool`\n\nDefault: `true`\n\n#### showCloseButton\n\n> Show/Hide _Helper_ Close button\n\nType: `bool`\n\nDefault: `true`\n\n#### showNavigation\n\n> Show/Hide _Helper_ Navigation Dots\n\nType: `bool`\n\nDefault: `true`\n\n#### showNavigationNumber\n\n> Show/Hide number when hovers on each Navigation Dot\n\nType: `bool`\n\nDefault: `true`\n\n#### showNumber\n\n> Show/Hide _Helper_ Number Badge\n\nType: `bool`\n\nDefault: `true`\n\n#### startAt\n\n> Starting step when _Tour_ is open the first time\n\nType: `number`\n\nDefault: `0`\n\n#### steps\n\n> Array of elements to highlight with special info and props\n\nType: `shape`\n\nRequired: `true`\n\n##### Steps shape\n\n```js\nsteps: PropTypes.arrayOf(PropTypes.shape({\n  'selector': PropTypes.string,\n  'content': PropTypes.oneOfType([\n    PropTypes.node,\n    PropTypes.element,\n    PropTypes.func,\n  ]).isRequired,\n  'position':PropTypes.oneOfType([\n    PropTypes.arrayOf(PropTypes.number),\n    PropTypes.oneOf(['top', 'right', 'bottom', 'left', 'center']),\n  ]),\n  'action': PropTypes.func,\n  'style': PropTypes.object,\n  'stepInteraction': PropTypes.bool,\n  'navDotAriaLabel': PropTypes.string,\n})),\n```\n\n##### Steps example\n\n```js\nconst steps = [\n  {\n    selector: '[data-tour=\"my-first-step\"]',\n    content: ({ goTo, inDOM }) => (\n      <div>\n        Lorem ipsum <button onClick={() => goTo(4)}>Go to Step 5</button>\n        <br />\n        {inDOM && '🎉 Look at your step!'}\n      </div>\n    ),\n    position: 'top',\n    // you could do something like:\n    // position: [160, 250],\n    action: node => {\n      // by using this, focus trap is temporary disabled\n      node.focus()\n      console.log('yup, the target element is also focused!')\n    },\n    style: {\n      backgroundColor: '#bada55',\n    },\n    // Disable interaction for this specific step.\n    // Could be enabled passing `true`\n    // when `disableInteraction` prop is present in Tour\n    stepInteraction: false,\n    // Text read to screen reader software for this step's navigation dot\n    navDotAriaLabel: 'Go to step 4',\n  },\n  // ...\n]\n```\n\n#### update\n\n> Value to listen if a forced update is needed\n\nType: `string`\n\n#### updateDelay\n\n> Delay time when forcing update. Useful when there are known animation/transitions\n\nType: `number`\n\nDefault: `1`\n\n## FAQ\n\n<p>\n  <details>\n    <summary>How is implemented the scroll lock behaviour in the <a href=\"https://github.com/elrumordelaluz/reactour/blob/master/src/demo/App.js\">Demo</a>?</summary>\n    <p>\n      To guarantee a cross browser behaviour we use <a href=\"https://www.npmjs.com/package/body-scroll-lock\">body-scroll-lock</a>. </p>\n      <p>Import the library\n        <pre lang=js>\nimport { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'</pre>\n    </p>\n    <p>Create the event handlers\n        <pre lang=js>\ndisableBody = target => disableBodyScroll(target)\nenableBody = target => enableBodyScroll(target)</pre>\n    </p>\n    <p>Then assign them into the Tour props\n        <pre lang=js>\n&lt;Tour\n  {...props}\n  onAfterOpen={this.disableBody}\n  onBeforeClose={this.enableBody}\n/&gt;</pre>\n    </p>\n  </details>\n</p>\n","readmeFilename":"README.md"}