@korsolutions/guidon 1.0.0 → 1.0.2

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 (144) hide show
  1. package/README.md +11 -11
  2. package/dist/commonjs/babel.config.js +15 -0
  3. package/dist/commonjs/babel.config.js.map +1 -0
  4. package/dist/commonjs/bob.config.js +11 -0
  5. package/dist/commonjs/bob.config.js.map +1 -0
  6. package/dist/commonjs/components/GuidonOverlay.js +206 -0
  7. package/dist/commonjs/components/GuidonOverlay.js.map +1 -0
  8. package/dist/commonjs/components/GuidonProvider.js +157 -0
  9. package/dist/commonjs/components/GuidonProvider.js.map +1 -0
  10. package/dist/commonjs/components/GuidonTarget.js +108 -0
  11. package/dist/commonjs/components/GuidonTarget.js.map +1 -0
  12. package/dist/commonjs/components/GuidonTooltip.js +422 -0
  13. package/dist/commonjs/components/GuidonTooltip.js.map +1 -0
  14. package/dist/commonjs/components/index.js +40 -0
  15. package/dist/commonjs/components/index.js.map +1 -0
  16. package/dist/commonjs/hooks/index.js +13 -0
  17. package/dist/commonjs/hooks/index.js.map +1 -0
  18. package/dist/commonjs/hooks/useGuidonRef.js +132 -0
  19. package/dist/commonjs/hooks/useGuidonRef.js.map +1 -0
  20. package/dist/commonjs/index.js +143 -0
  21. package/dist/commonjs/index.js.map +1 -0
  22. package/dist/commonjs/package.json +1 -0
  23. package/dist/commonjs/persistence/adapters.js +213 -0
  24. package/dist/commonjs/persistence/adapters.js.map +1 -0
  25. package/dist/commonjs/persistence/hooks.js +153 -0
  26. package/dist/commonjs/persistence/hooks.js.map +1 -0
  27. package/dist/commonjs/persistence/index.js +28 -0
  28. package/dist/commonjs/persistence/index.js.map +1 -0
  29. package/dist/commonjs/store.js +305 -0
  30. package/dist/commonjs/store.js.map +1 -0
  31. package/dist/commonjs/tsconfig.json +32 -0
  32. package/dist/commonjs/types.js +6 -0
  33. package/dist/commonjs/types.js.map +1 -0
  34. package/dist/module/babel.config.js +15 -0
  35. package/dist/module/babel.config.js.map +1 -0
  36. package/dist/module/bob.config.js +11 -0
  37. package/dist/module/bob.config.js.map +1 -0
  38. package/dist/module/components/GuidonOverlay.js +201 -0
  39. package/dist/module/components/GuidonOverlay.js.map +1 -0
  40. package/dist/module/components/GuidonProvider.js +152 -0
  41. package/dist/module/components/GuidonProvider.js.map +1 -0
  42. package/dist/module/components/GuidonTarget.js +104 -0
  43. package/dist/module/components/GuidonTarget.js.map +1 -0
  44. package/dist/module/components/GuidonTooltip.js +417 -0
  45. package/dist/module/components/GuidonTooltip.js.map +1 -0
  46. package/dist/module/components/index.js +7 -0
  47. package/dist/module/components/index.js.map +1 -0
  48. package/dist/module/hooks/index.js +4 -0
  49. package/dist/module/hooks/index.js.map +1 -0
  50. package/dist/module/hooks/useGuidonRef.js +129 -0
  51. package/dist/module/hooks/useGuidonRef.js.map +1 -0
  52. package/dist/module/index.js +17 -0
  53. package/dist/module/index.js.map +1 -0
  54. package/dist/module/package.json +1 -0
  55. package/dist/module/persistence/adapters.js +203 -0
  56. package/dist/module/persistence/adapters.js.map +1 -0
  57. package/dist/module/persistence/hooks.js +148 -0
  58. package/dist/module/persistence/hooks.js.map +1 -0
  59. package/dist/module/persistence/index.js +5 -0
  60. package/dist/module/persistence/index.js.map +1 -0
  61. package/dist/module/store.js +295 -0
  62. package/dist/module/store.js.map +1 -0
  63. package/dist/module/tsconfig.json +32 -0
  64. package/dist/module/types.js +4 -0
  65. package/dist/module/types.js.map +1 -0
  66. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts +9 -0
  67. package/dist/typescript/commonjs/components/GuidonOverlay.d.ts.map +1 -0
  68. package/dist/typescript/commonjs/components/GuidonProvider.d.ts +14 -0
  69. package/dist/typescript/commonjs/components/GuidonProvider.d.ts.map +1 -0
  70. package/dist/typescript/commonjs/components/GuidonTarget.d.ts +7 -0
  71. package/dist/typescript/commonjs/components/GuidonTarget.d.ts.map +1 -0
  72. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts +24 -0
  73. package/dist/typescript/commonjs/components/GuidonTooltip.d.ts.map +1 -0
  74. package/dist/typescript/commonjs/components/index.d.ts +5 -0
  75. package/dist/typescript/commonjs/components/index.d.ts.map +1 -0
  76. package/dist/typescript/commonjs/hooks/index.d.ts +2 -0
  77. package/dist/typescript/commonjs/hooks/index.d.ts.map +1 -0
  78. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts +35 -0
  79. package/dist/typescript/commonjs/hooks/useGuidonRef.d.ts.map +1 -0
  80. package/dist/typescript/commonjs/index.d.ts +7 -0
  81. package/dist/typescript/commonjs/index.d.ts.map +1 -0
  82. package/dist/typescript/commonjs/package.json +1 -0
  83. package/dist/typescript/commonjs/persistence/adapters.d.ts +57 -0
  84. package/dist/typescript/commonjs/persistence/adapters.d.ts.map +1 -0
  85. package/dist/typescript/commonjs/persistence/hooks.d.ts +29 -0
  86. package/dist/typescript/commonjs/persistence/hooks.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/persistence/index.d.ts +3 -0
  88. package/dist/typescript/commonjs/persistence/index.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/store.d.ts +89 -0
  90. package/dist/typescript/commonjs/store.d.ts.map +1 -0
  91. package/dist/{index-D_JFvCIg.d.mts → typescript/commonjs/types.d.ts} +40 -104
  92. package/dist/typescript/commonjs/types.d.ts.map +1 -0
  93. package/dist/typescript/module/components/GuidonOverlay.d.ts +9 -0
  94. package/dist/typescript/module/components/GuidonOverlay.d.ts.map +1 -0
  95. package/dist/typescript/module/components/GuidonProvider.d.ts +14 -0
  96. package/dist/typescript/module/components/GuidonProvider.d.ts.map +1 -0
  97. package/dist/typescript/module/components/GuidonTarget.d.ts +7 -0
  98. package/dist/typescript/module/components/GuidonTarget.d.ts.map +1 -0
  99. package/dist/typescript/module/components/GuidonTooltip.d.ts +24 -0
  100. package/dist/typescript/module/components/GuidonTooltip.d.ts.map +1 -0
  101. package/dist/typescript/module/components/index.d.ts +5 -0
  102. package/dist/typescript/module/components/index.d.ts.map +1 -0
  103. package/dist/typescript/module/hooks/index.d.ts +2 -0
  104. package/dist/typescript/module/hooks/index.d.ts.map +1 -0
  105. package/dist/typescript/module/hooks/useGuidonRef.d.ts +35 -0
  106. package/dist/typescript/module/hooks/useGuidonRef.d.ts.map +1 -0
  107. package/dist/typescript/module/index.d.ts +7 -0
  108. package/dist/typescript/module/index.d.ts.map +1 -0
  109. package/dist/typescript/module/package.json +1 -0
  110. package/dist/typescript/module/persistence/adapters.d.ts +57 -0
  111. package/dist/typescript/module/persistence/adapters.d.ts.map +1 -0
  112. package/dist/typescript/module/persistence/hooks.d.ts +29 -0
  113. package/dist/typescript/module/persistence/hooks.d.ts.map +1 -0
  114. package/dist/typescript/module/persistence/index.d.ts +3 -0
  115. package/dist/typescript/module/persistence/index.d.ts.map +1 -0
  116. package/dist/typescript/module/store.d.ts +89 -0
  117. package/dist/typescript/module/store.d.ts.map +1 -0
  118. package/dist/{index-D_JFvCIg.d.ts → typescript/module/types.d.ts} +40 -104
  119. package/dist/typescript/module/types.d.ts.map +1 -0
  120. package/package.json +25 -13
  121. package/src/babel.config.js +18 -0
  122. package/src/bob.config.js +14 -0
  123. package/src/components/GuidonOverlay.tsx +60 -4
  124. package/src/components/GuidonProvider.tsx +29 -1
  125. package/src/components/GuidonTarget.tsx +26 -16
  126. package/src/components/GuidonTooltip.tsx +143 -9
  127. package/src/hooks/index.ts +1 -0
  128. package/src/hooks/useGuidonRef.ts +154 -0
  129. package/src/index.ts +6 -0
  130. package/src/store.ts +40 -0
  131. package/src/tsconfig.json +32 -0
  132. package/src/types.ts +32 -2
  133. package/dist/index.d.mts +0 -128
  134. package/dist/index.d.ts +0 -128
  135. package/dist/index.js +0 -1098
  136. package/dist/index.js.map +0 -1
  137. package/dist/index.mjs +0 -1073
  138. package/dist/index.mjs.map +0 -1
  139. package/dist/persistence/index.d.mts +0 -2
  140. package/dist/persistence/index.d.ts +0 -2
  141. package/dist/persistence/index.js +0 -300
  142. package/dist/persistence/index.js.map +0 -1
  143. package/dist/persistence/index.mjs +0 -291
  144. package/dist/persistence/index.mjs.map +0 -1
package/dist/index.d.mts DELETED
@@ -1,128 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { G as GuidonTargetProps, a as GuidonTheme, b as GuidonStep, c as GuidonProviderProps, d as GuidonStore, e as GuidonConfig, T as TargetMeasurements } from './index-D_JFvCIg.mjs';
3
- export { l as GuidonActions, g as GuidonPersistenceAdapter, f as GuidonProgress, k as GuidonState, h as GuidonTooltipLabels, i as GuidonTooltipRenderProps, j as TooltipPosition, q as createApiAdapter, p as createAsyncStorageAdapter, r as createCompositeAdapter, o as createLocalStorageAdapter, n as createMemoryAdapter, m as createNoopAdapter, u as useGuidonPersistence, s as useShouldShowGuidon } from './index-D_JFvCIg.mjs';
4
- import * as zustand from 'zustand';
5
- import 'react';
6
-
7
- /**
8
- * Wrapper component that marks an element as a walkthrough target
9
- * Automatically measures and reports its position to the walkthrough store
10
- */
11
- declare function GuidonTarget({ children, targetId, active, }: GuidonTargetProps): react_jsx_runtime.JSX.Element;
12
-
13
- interface GuidonOverlayProps {
14
- theme?: GuidonTheme;
15
- animationDuration?: number;
16
- onBackdropPress?: () => void;
17
- }
18
- declare function GuidonOverlay({ theme, animationDuration, onBackdropPress, }: GuidonOverlayProps): react_jsx_runtime.JSX.Element | null;
19
-
20
- interface GuidonTooltipProps {
21
- theme?: GuidonTheme;
22
- animationDuration?: number;
23
- renderCustomTooltip?: (props: {
24
- step: GuidonStep;
25
- currentIndex: number;
26
- totalSteps: number;
27
- onNext: () => void;
28
- onPrevious: () => void;
29
- onSkip: () => void;
30
- }) => React.ReactNode;
31
- labels?: {
32
- next?: string;
33
- previous?: string;
34
- skip?: string;
35
- finish?: string;
36
- stepOf?: (current: number, total: number) => string;
37
- };
38
- }
39
- declare function GuidonTooltip({ theme, animationDuration, renderCustomTooltip, labels, }: GuidonTooltipProps): react_jsx_runtime.JSX.Element | null;
40
-
41
- interface GuidonContextValue {
42
- start: () => void;
43
- skip: () => void;
44
- reset: () => void;
45
- replay: () => Promise<void>;
46
- isActive: boolean;
47
- isCompleted: boolean;
48
- isLoading: boolean;
49
- }
50
- declare function useGuidonContext(): GuidonContextValue;
51
- declare function GuidonProvider({ children, config, autoStart, shouldStart, persistenceAdapter, portalComponent: Portal, renderTooltip, tooltipLabels, onBackdropPress, }: GuidonProviderProps): react_jsx_runtime.JSX.Element;
52
-
53
- declare const useGuidonStore: zustand.UseBoundStore<zustand.StoreApi<GuidonStore>>;
54
- /**
55
- * Guidon API for external control
56
- * Can be used outside of React components
57
- */
58
- declare const Guidon: {
59
- /**
60
- * Configure the walkthrough with steps and options
61
- */
62
- configure: (config: GuidonConfig) => void;
63
- /**
64
- * Start the walkthrough
65
- */
66
- start: () => void;
67
- /**
68
- * Go to the next step
69
- */
70
- next: () => void;
71
- /**
72
- * Go to the previous step
73
- */
74
- previous: () => void;
75
- /**
76
- * Go to a specific step by index
77
- */
78
- goToStep: (index: number) => void;
79
- /**
80
- * Skip the walkthrough
81
- */
82
- skip: () => void;
83
- /**
84
- * Complete the walkthrough
85
- */
86
- complete: () => void;
87
- /**
88
- * Reset the walkthrough to initial state
89
- */
90
- reset: () => void;
91
- /**
92
- * Check if the walkthrough is currently active
93
- */
94
- isActive: () => boolean;
95
- /**
96
- * Check if the walkthrough has been completed
97
- */
98
- isCompleted: () => boolean;
99
- /**
100
- * Get the current step index
101
- */
102
- getCurrentStepIndex: () => number;
103
- /**
104
- * Get the current step
105
- */
106
- getCurrentStep: () => GuidonStep | null;
107
- /**
108
- * Get all steps
109
- */
110
- getSteps: () => GuidonStep[];
111
- /**
112
- * Subscribe to store changes
113
- */
114
- subscribe: (listener: (state: GuidonStore, prevState: GuidonStore) => void) => () => void;
115
- };
116
- /**
117
- * Hook selectors for common use cases
118
- */
119
- declare const useGuidonActive: () => boolean;
120
- declare const useGuidonStep: () => GuidonStep | null;
121
- declare const useGuidonProgress: () => {
122
- currentStep: number;
123
- totalSteps: number;
124
- percentage: number;
125
- };
126
- declare const useTargetMeasurements: (targetId: string) => TargetMeasurements;
127
-
128
- export { Guidon, GuidonConfig, GuidonOverlay, GuidonProvider, GuidonProviderProps, GuidonStep, GuidonStore, GuidonTarget, GuidonTargetProps, GuidonTheme, GuidonTooltip, TargetMeasurements, useGuidonActive, useGuidonContext, useGuidonProgress, useGuidonStep, useGuidonStore, useTargetMeasurements };
package/dist/index.d.ts DELETED
@@ -1,128 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { G as GuidonTargetProps, a as GuidonTheme, b as GuidonStep, c as GuidonProviderProps, d as GuidonStore, e as GuidonConfig, T as TargetMeasurements } from './index-D_JFvCIg.js';
3
- export { l as GuidonActions, g as GuidonPersistenceAdapter, f as GuidonProgress, k as GuidonState, h as GuidonTooltipLabels, i as GuidonTooltipRenderProps, j as TooltipPosition, q as createApiAdapter, p as createAsyncStorageAdapter, r as createCompositeAdapter, o as createLocalStorageAdapter, n as createMemoryAdapter, m as createNoopAdapter, u as useGuidonPersistence, s as useShouldShowGuidon } from './index-D_JFvCIg.js';
4
- import * as zustand from 'zustand';
5
- import 'react';
6
-
7
- /**
8
- * Wrapper component that marks an element as a walkthrough target
9
- * Automatically measures and reports its position to the walkthrough store
10
- */
11
- declare function GuidonTarget({ children, targetId, active, }: GuidonTargetProps): react_jsx_runtime.JSX.Element;
12
-
13
- interface GuidonOverlayProps {
14
- theme?: GuidonTheme;
15
- animationDuration?: number;
16
- onBackdropPress?: () => void;
17
- }
18
- declare function GuidonOverlay({ theme, animationDuration, onBackdropPress, }: GuidonOverlayProps): react_jsx_runtime.JSX.Element | null;
19
-
20
- interface GuidonTooltipProps {
21
- theme?: GuidonTheme;
22
- animationDuration?: number;
23
- renderCustomTooltip?: (props: {
24
- step: GuidonStep;
25
- currentIndex: number;
26
- totalSteps: number;
27
- onNext: () => void;
28
- onPrevious: () => void;
29
- onSkip: () => void;
30
- }) => React.ReactNode;
31
- labels?: {
32
- next?: string;
33
- previous?: string;
34
- skip?: string;
35
- finish?: string;
36
- stepOf?: (current: number, total: number) => string;
37
- };
38
- }
39
- declare function GuidonTooltip({ theme, animationDuration, renderCustomTooltip, labels, }: GuidonTooltipProps): react_jsx_runtime.JSX.Element | null;
40
-
41
- interface GuidonContextValue {
42
- start: () => void;
43
- skip: () => void;
44
- reset: () => void;
45
- replay: () => Promise<void>;
46
- isActive: boolean;
47
- isCompleted: boolean;
48
- isLoading: boolean;
49
- }
50
- declare function useGuidonContext(): GuidonContextValue;
51
- declare function GuidonProvider({ children, config, autoStart, shouldStart, persistenceAdapter, portalComponent: Portal, renderTooltip, tooltipLabels, onBackdropPress, }: GuidonProviderProps): react_jsx_runtime.JSX.Element;
52
-
53
- declare const useGuidonStore: zustand.UseBoundStore<zustand.StoreApi<GuidonStore>>;
54
- /**
55
- * Guidon API for external control
56
- * Can be used outside of React components
57
- */
58
- declare const Guidon: {
59
- /**
60
- * Configure the walkthrough with steps and options
61
- */
62
- configure: (config: GuidonConfig) => void;
63
- /**
64
- * Start the walkthrough
65
- */
66
- start: () => void;
67
- /**
68
- * Go to the next step
69
- */
70
- next: () => void;
71
- /**
72
- * Go to the previous step
73
- */
74
- previous: () => void;
75
- /**
76
- * Go to a specific step by index
77
- */
78
- goToStep: (index: number) => void;
79
- /**
80
- * Skip the walkthrough
81
- */
82
- skip: () => void;
83
- /**
84
- * Complete the walkthrough
85
- */
86
- complete: () => void;
87
- /**
88
- * Reset the walkthrough to initial state
89
- */
90
- reset: () => void;
91
- /**
92
- * Check if the walkthrough is currently active
93
- */
94
- isActive: () => boolean;
95
- /**
96
- * Check if the walkthrough has been completed
97
- */
98
- isCompleted: () => boolean;
99
- /**
100
- * Get the current step index
101
- */
102
- getCurrentStepIndex: () => number;
103
- /**
104
- * Get the current step
105
- */
106
- getCurrentStep: () => GuidonStep | null;
107
- /**
108
- * Get all steps
109
- */
110
- getSteps: () => GuidonStep[];
111
- /**
112
- * Subscribe to store changes
113
- */
114
- subscribe: (listener: (state: GuidonStore, prevState: GuidonStore) => void) => () => void;
115
- };
116
- /**
117
- * Hook selectors for common use cases
118
- */
119
- declare const useGuidonActive: () => boolean;
120
- declare const useGuidonStep: () => GuidonStep | null;
121
- declare const useGuidonProgress: () => {
122
- currentStep: number;
123
- totalSteps: number;
124
- percentage: number;
125
- };
126
- declare const useTargetMeasurements: (targetId: string) => TargetMeasurements;
127
-
128
- export { Guidon, GuidonConfig, GuidonOverlay, GuidonProvider, GuidonProviderProps, GuidonStep, GuidonStore, GuidonTarget, GuidonTargetProps, GuidonTheme, GuidonTooltip, TargetMeasurements, useGuidonActive, useGuidonContext, useGuidonProgress, useGuidonStep, useGuidonStore, useTargetMeasurements };