@numidev/react-joyride 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +93 -0
  3. package/dist/index.cjs +2677 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +753 -0
  6. package/dist/index.d.mts +753 -0
  7. package/dist/index.mjs +2638 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +158 -0
  10. package/src/components/Arrow.tsx +138 -0
  11. package/src/components/Beacon.tsx +141 -0
  12. package/src/components/Floater.tsx +381 -0
  13. package/src/components/Loader.tsx +80 -0
  14. package/src/components/Overlay.tsx +167 -0
  15. package/src/components/Portal.tsx +17 -0
  16. package/src/components/Step.tsx +72 -0
  17. package/src/components/Tooltip/CloseButton.tsx +29 -0
  18. package/src/components/Tooltip/DefaultTooltip.tsx +82 -0
  19. package/src/components/Tooltip/index.tsx +163 -0
  20. package/src/components/TourRenderer.tsx +157 -0
  21. package/src/defaults.ts +64 -0
  22. package/src/global.d.ts +8 -0
  23. package/src/hooks/useControls.ts +219 -0
  24. package/src/hooks/useDebugLogger.ts +58 -0
  25. package/src/hooks/useEventEmitter.ts +55 -0
  26. package/src/hooks/useFocusTrap.ts +72 -0
  27. package/src/hooks/useJoyride.tsx +32 -0
  28. package/src/hooks/useLifecycleEffect.ts +512 -0
  29. package/src/hooks/usePortalElement.ts +49 -0
  30. package/src/hooks/usePropSync.ts +84 -0
  31. package/src/hooks/useScrollEffect.ts +217 -0
  32. package/src/hooks/useTargetPosition.ts +154 -0
  33. package/src/hooks/useTourEngine.ts +106 -0
  34. package/src/index.tsx +23 -0
  35. package/src/literals/index.ts +61 -0
  36. package/src/modules/changes.ts +20 -0
  37. package/src/modules/dom.ts +359 -0
  38. package/src/modules/helpers.tsx +230 -0
  39. package/src/modules/step.ts +156 -0
  40. package/src/modules/store.ts +215 -0
  41. package/src/modules/svg.ts +40 -0
  42. package/src/styles.ts +183 -0
  43. package/src/types/common.ts +315 -0
  44. package/src/types/components.ts +84 -0
  45. package/src/types/events.ts +89 -0
  46. package/src/types/floating.ts +60 -0
  47. package/src/types/index.ts +8 -0
  48. package/src/types/props.ts +124 -0
  49. package/src/types/state.ts +49 -0
  50. package/src/types/step.ts +108 -0
  51. package/src/types/utilities.ts +26 -0
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2015, Gil Barbara
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ 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.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # React Joyride
2
+
3
+ [![](https://badge.fury.io/js/react-joyride.svg)](https://www.npmjs.com/package/react-joyride) [![CI](https://github.com/gilbarbara/react-joyride/actions/workflows/ci.yml/badge.svg)](https://github.com/gilbarbara/react-joyride/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=gilbarbara_react-joyride&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=gilbarbara_react-joyride) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=gilbarbara_react-joyride&metric=coverage)](https://sonarcloud.io/summary/new_code?id=gilbarbara_react-joyride)
4
+
5
+ #### Create awesome tours for your app!
6
+
7
+ Showcase your app to new users or explain the functionality of new features.
8
+
9
+ [![Joyride example image](https://react-joyride.com/images/react-joyride-v3.gif)](https://react-joyride.com/)
10
+
11
+ ### Highlights
12
+
13
+ - 🎨 **Easy to use:** Just set the `steps` and you're good to go
14
+ - 🔧 **Customizable:** Use your own components and styles
15
+ - ♿ **Accessible:** Focus trapping, keyboard navigation, and ARIA support
16
+ - 📦 **Lightweight:** ~30% smaller bundle than v2
17
+ - 🔄 **Broad compatibility:** React 16.8+ through React 19
18
+ - 🖥️ **SSR-safe:** Works with Next.js, Remix, and other server-rendering frameworks
19
+
20
+ ### Resources
21
+
22
+ - [Documentation](https://react-joyride.com/docs/getting-started)
23
+ - [Demos](https://react-joyride.com/demos)
24
+ - [What's new in v3](https://react-joyride.com/docs/new-in-v3)
25
+ - [StackBlitz Playground](https://stackblitz.com/edit/react-joyride)
26
+
27
+ ## Setup
28
+
29
+ ```bash
30
+ npm i react-joyride
31
+ ```
32
+
33
+ ## Quick Start
34
+
35
+ ### Component API
36
+
37
+ ```tsx
38
+ import { Joyride } from 'react-joyride';
39
+
40
+ const steps = [
41
+ { target: '.my-first-step', content: 'This is my awesome feature!' },
42
+ { target: '.my-other-step', content: 'This is another awesome feature!' },
43
+ ];
44
+
45
+ export function App() {
46
+ return (
47
+ <div>
48
+ <Joyride run steps={steps} />
49
+ {/* your app */}
50
+ </div>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ### Hook API
56
+
57
+ ```tsx
58
+ import { useJoyride } from 'react-joyride';
59
+
60
+ const steps = [
61
+ { target: '.my-first-step', content: 'This is my awesome feature!' },
62
+ { target: '.my-other-step', content: 'This is another awesome feature!' },
63
+ ];
64
+
65
+ export function App() {
66
+ const { controls, state, Tour } = useJoyride({ steps });
67
+
68
+ return (
69
+ <div>
70
+ <button onClick={() => controls.start()}>Start Tour</button>
71
+ {Tour}
72
+ {/* your app */}
73
+ </div>
74
+ );
75
+ }
76
+ ```
77
+
78
+ ## Agent Skill
79
+
80
+ Enable AI assistants to implement guided tours with React Joyride.
81
+
82
+ The skill gives your AI assistant comprehensive knowledge of the API, step configuration, events, custom components, and common patterns.
83
+
84
+ ```bash
85
+ npx skills add gilbarbara/react-joyride
86
+ ```
87
+
88
+ ## Migration from v2
89
+
90
+ Check the [migration guide](https://react-joyride.com/docs/migration) for detailed instructions on upgrading from v2.
91
+
92
+ ## License
93
+ MIT