hintorium-react 1.0.0
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.
- package/README.md +104 -0
- package/dist/components/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/TooltipProvider.d.ts +36 -0
- package/dist/components/TooltipProvider.d.ts.map +1 -0
- package/dist/components/Tour.d.ts +42 -0
- package/dist/components/Tour.d.ts.map +1 -0
- package/dist/context/TooltipContext.d.ts +16 -0
- package/dist/context/TooltipContext.d.ts.map +1 -0
- package/dist/hooks/useAnalytics.d.ts +8 -0
- package/dist/hooks/useAnalytics.d.ts.map +1 -0
- package/dist/hooks/useHintoriumI18n.d.ts +26 -0
- package/dist/hooks/useHintoriumI18n.d.ts.map +1 -0
- package/dist/hooks/useInlineHint.d.ts +40 -0
- package/dist/hooks/useInlineHint.d.ts.map +1 -0
- package/dist/hooks/useTooltip.d.ts +43 -0
- package/dist/hooks/useTooltip.d.ts.map +1 -0
- package/dist/hooks/useTooltipAnalytics.d.ts +4 -0
- package/dist/hooks/useTooltipAnalytics.d.ts.map +1 -0
- package/dist/hooks/useTooltipManager.d.ts +23 -0
- package/dist/hooks/useTooltipManager.d.ts.map +1 -0
- package/dist/hooks/useTour.d.ts +31 -0
- package/dist/hooks/useTour.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2826 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +69 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Hintorium
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
> Advanced, accessible, and fully customizable tooltip library for modern web apps.
|
|
7
|
+
> Built with TypeScript and SCSS.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🚀 Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install hintorium-core
|
|
15
|
+
# or
|
|
16
|
+
pnpm add hintorium-core
|
|
17
|
+
# or
|
|
18
|
+
yarn add hintorium-core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🧩 Usage
|
|
24
|
+
|
|
25
|
+
Import the core script and styles in your app:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { initTooltips } from "hintorium-core";
|
|
29
|
+
import "hintorium-core/dist/core.css";
|
|
30
|
+
|
|
31
|
+
initTooltips({
|
|
32
|
+
theme: "dark",
|
|
33
|
+
animation: "fade",
|
|
34
|
+
delay: 150,
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then, in your HTML:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<button data-tooltip="Save changes">💾 Save</button>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Hintorium automatically finds elements with `data-tooltip` attributes and applies positioning, animations, and themes.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🎨 Themes & Animations
|
|
49
|
+
|
|
50
|
+
Available out of the box:
|
|
51
|
+
|
|
52
|
+
**Themes:** `light`, `dark`, `glass`, `neon`, `pastel`, `gradient`
|
|
53
|
+
**Animations:** `fade`, `slide`, `zoom`, `bounce`
|
|
54
|
+
|
|
55
|
+
You can customize them with SCSS variables or extend them via plugin API.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## ⚙️ Configuration
|
|
60
|
+
|
|
61
|
+
| Option | Type | Default | Description |
|
|
62
|
+
| ------------- | ------------------------------------- | --------- | -------------------------------- |
|
|
63
|
+
| `theme` | `string` | `"light"` | Tooltip theme |
|
|
64
|
+
| `delay` | `number` | `150` | Delay before showing tooltip |
|
|
65
|
+
| `animation` | `string` | `"fade"` | Entry/exit animation |
|
|
66
|
+
| `position` | `"top" / "bottom" / "left" / "right"` | `"top"` | Tooltip position |
|
|
67
|
+
| `interactive` | `boolean` | `false` | Allow hover/focus inside tooltip |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🧠 Accessibility
|
|
72
|
+
|
|
73
|
+
- Fully ARIA-compliant
|
|
74
|
+
- Keyboard accessible (`Tab`, `Esc`)
|
|
75
|
+
- Screen-reader support
|
|
76
|
+
- High-contrast mode compatible
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 📘 Documentation
|
|
81
|
+
|
|
82
|
+
👉 Full documentation, examples, and live demos available at
|
|
83
|
+
[https://hintorium.vercel.app](https://hintorium.vercel.app)
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🧱 Project Structure
|
|
88
|
+
|
|
89
|
+
This library is part of the **Hintorium Monorepo**:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
.
|
|
93
|
+
├── apps/
|
|
94
|
+
│ └── docs/ # documentation and examples
|
|
95
|
+
└── packages/
|
|
96
|
+
└── hintorium/ # the core tooltip library
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🧾 License
|
|
102
|
+
|
|
103
|
+
MIT © [Kamil Engineer](https://github.com/kamil-engineer)
|
|
104
|
+
See [LICENSE](https://github.com/kamil-engineer/Hintorium/blob/main/LICENSE)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TooltipComponentProps } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Declarative tooltip component
|
|
5
|
+
* Wraps a single child element and adds tooltip functionality
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Tooltip content="Click me!" position="top" theme="dark">
|
|
10
|
+
* <button>Hover me</button>
|
|
11
|
+
* </Tooltip>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function Tooltip({ content, children, className, disabled, ...options }: TooltipComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/components/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGtD;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,OAAO,EACX,EAAE,qBAAqB,2CAoBvB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipOptions } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface TooltipProviderProps {
|
|
5
|
+
/**
|
|
6
|
+
* Child components
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Global tooltip options applied to all tooltips
|
|
11
|
+
*/
|
|
12
|
+
options?: TooltipOptions;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to initialize the global TooltipManager
|
|
15
|
+
* This enables data-tooltip attributes throughout the app
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
initManager?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Provider component for global tooltip configuration
|
|
22
|
+
* Wraps your app to provide consistent tooltip styling and behavior
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* function App() {
|
|
27
|
+
* return (
|
|
28
|
+
* <TooltipProvider options={{ theme: 'dark', animation: 'fade' }}>
|
|
29
|
+
* <YourApp />
|
|
30
|
+
* </TooltipProvider>
|
|
31
|
+
* );
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function TooltipProvider({ children, options, initManager, }: TooltipProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=TooltipProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipProvider.d.ts","sourceRoot":"","sources":["../../src/components/TooltipProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,OAAY,EACZ,WAAkB,GACnB,EAAE,oBAAoB,2CAUtB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TourStep } from '../types';
|
|
3
|
+
import { useTour } from '../hooks/useTour';
|
|
4
|
+
|
|
5
|
+
export interface TourProps {
|
|
6
|
+
/**
|
|
7
|
+
* Array of tour steps
|
|
8
|
+
*/
|
|
9
|
+
steps: TourStep[];
|
|
10
|
+
/**
|
|
11
|
+
* Render prop function that receives tour controls
|
|
12
|
+
*/
|
|
13
|
+
children: (tour: ReturnType<typeof useTour>) => ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Render prop component for product tours
|
|
17
|
+
* Provides tour controls to children via render prop pattern
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Tour steps={[
|
|
22
|
+
* { element: '#step1', content: 'First step' },
|
|
23
|
+
* { element: '#step2', content: 'Second step' },
|
|
24
|
+
* ]}>
|
|
25
|
+
* {(tour) => (
|
|
26
|
+
* <div>
|
|
27
|
+
* <button onClick={tour.start}>Start Tour</button>
|
|
28
|
+
* {tour.isActive && (
|
|
29
|
+
* <div>
|
|
30
|
+
* <button onClick={tour.prev}>Previous</button>
|
|
31
|
+
* <button onClick={tour.next}>Next</button>
|
|
32
|
+
* <button onClick={tour.stop}>Exit</button>
|
|
33
|
+
* <span>Step {tour.currentStep + 1}</span>
|
|
34
|
+
* </div>
|
|
35
|
+
* )}
|
|
36
|
+
* </div>
|
|
37
|
+
* )}
|
|
38
|
+
* </Tour>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function Tour({ steps, children }: TourProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=Tour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tour.d.ts","sourceRoot":"","sources":["../../src/components/Tour.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,KAAK,SAAS,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,SAAS,2CAGlD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TooltipOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
interface TooltipContextValue {
|
|
4
|
+
/**
|
|
5
|
+
* Global tooltip options that will be merged with individual tooltip options
|
|
6
|
+
*/
|
|
7
|
+
options: TooltipOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare const TooltipContext: import('react').Context<TooltipContextValue | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Hook to access tooltip context
|
|
12
|
+
* Returns null if not inside TooltipProvider
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTooltipContext(): TooltipContextValue | null;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=TooltipContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipContext.d.ts","sourceRoot":"","sources":["../../src/context/TooltipContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,UAAU,mBAAmB;IAC3B;;OAEG;IACH,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,eAAO,MAAM,cAAc,qDAAkD,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnalytics.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnalytics.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY;;mBAmBQ,MAAM;oBAPjC,MAAM;;;EAuBd"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for internationalization (i18n)
|
|
3
|
+
* Provides translation functions and language management
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* function MyComponent() {
|
|
8
|
+
* const { t, language, setLanguage } = useI18n();
|
|
9
|
+
*
|
|
10
|
+
* return (
|
|
11
|
+
* <div>
|
|
12
|
+
* <h1>{t('hintorium.tour.next')}</h1>
|
|
13
|
+
* <button onClick={() => setLanguage('pl')}>Polski</button>
|
|
14
|
+
* <button onClick={() => setLanguage('en')}>English</button>
|
|
15
|
+
* </div>
|
|
16
|
+
* );
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useHintoriumI18n(): {
|
|
21
|
+
language: string;
|
|
22
|
+
setLanguage: (lang: string) => void;
|
|
23
|
+
t: (key: string, fallback?: string) => string;
|
|
24
|
+
supportedLanguages: string[];
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useHintoriumI18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHintoriumI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useHintoriumI18n.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB;;wBAQH,MAAM;aAKjB,MAAM,aAAa,MAAM;;EAU1C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for creating inline hints
|
|
3
|
+
* Inline hints are persistent tooltips that appear inline with content
|
|
4
|
+
*
|
|
5
|
+
* @param content - Hint content
|
|
6
|
+
* @returns Ref to attach to the target element
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* function HelpText() {
|
|
11
|
+
* const hintRef = useInlineHint('This is helpful information');
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <span ref={hintRef}>
|
|
15
|
+
* Hover for help
|
|
16
|
+
* </span>
|
|
17
|
+
* );
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useInlineHint(content: string): React.RefCallback<HTMLElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Hook for initializing all inline hints in the DOM
|
|
24
|
+
* This scans for elements with data-inline-hint attribute
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* function App() {
|
|
29
|
+
* useInlineHintManager();
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <div>
|
|
33
|
+
* <span data-inline-hint="Helper text">Need help?</span>
|
|
34
|
+
* </div>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function useInlineHintManager(): void;
|
|
40
|
+
//# sourceMappingURL=useInlineHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInlineHint.d.ts","sourceRoot":"","sources":["../../src/hooks/useInlineHint.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CA8B7E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,SAanC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Tooltip, TooltipContentSource } from 'hintorium-core';
|
|
2
|
+
import { UseTooltipOptions } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook for creating a tooltip on any element
|
|
6
|
+
*
|
|
7
|
+
* @param content - Tooltip content (string or HTML)
|
|
8
|
+
* @param options - Tooltip configuration options
|
|
9
|
+
* @returns Ref to attach to the target element
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* function MyButton() {
|
|
14
|
+
* const tooltipRef = useTooltip('Click me!', { position: 'top' });
|
|
15
|
+
* return <button ref={tooltipRef}>Hover me</button>;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function useTooltip(content: TooltipContentSource, options?: UseTooltipOptions): React.RefCallback<HTMLElement>;
|
|
20
|
+
/**
|
|
21
|
+
* Alternative hook that returns tooltip instance for manual control
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* function MyButton() {
|
|
26
|
+
* const { ref, tooltip } = useTooltipInstance('Hello');
|
|
27
|
+
*
|
|
28
|
+
* return (
|
|
29
|
+
* <button
|
|
30
|
+
* ref={ref}
|
|
31
|
+
* onClick={() => tooltip?.show()}
|
|
32
|
+
* >
|
|
33
|
+
* Click to show
|
|
34
|
+
* </button>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function useTooltipInstance(content: string, options?: UseTooltipOptions): {
|
|
40
|
+
ref: (element: HTMLElement | null) => void;
|
|
41
|
+
tooltip: Tooltip | null;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=useTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/hooks/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CA4ChC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,iBAAiB;mBAef,WAAW,GAAG,IAAI;;EAiC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTooltipAnalytics.d.ts","sourceRoot":"","sources":["../../src/hooks/useTooltipAnalytics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,iBAAiB,qBAEzC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,UACxB,MAAM,UAUvB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TooltipOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for initializing the global TooltipManager
|
|
5
|
+
* This automatically initializes all tooltips with data-tooltip attributes in the DOM
|
|
6
|
+
*
|
|
7
|
+
* @param options - Global tooltip options
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* function App() {
|
|
12
|
+
* useTooltipManager({ theme: 'dark', animation: 'fade' });
|
|
13
|
+
*
|
|
14
|
+
* return (
|
|
15
|
+
* <div>
|
|
16
|
+
* <button data-tooltip="I'm a tooltip!">Hover me</button>
|
|
17
|
+
* </div>
|
|
18
|
+
* );
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useTooltipManager(options?: TooltipOptions): import('hintorium-core/dist/types/tooltip/manager').TooltipManager | null;
|
|
23
|
+
//# sourceMappingURL=useTooltipManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTooltipManager.d.ts","sourceRoot":"","sources":["../../src/hooks/useTooltipManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,cAAc,6EAwBzD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TourStep, UseTourReturn } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for creating an interactive product tour
|
|
5
|
+
*
|
|
6
|
+
* @param steps - Array of tour steps
|
|
7
|
+
* @returns Tour control methods and state
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* function MyTour() {
|
|
12
|
+
* const tour = useTour([
|
|
13
|
+
* { element: '#step1', content: 'Welcome!' },
|
|
14
|
+
* { element: '#step2', content: 'Click here to continue' },
|
|
15
|
+
* ]);
|
|
16
|
+
*
|
|
17
|
+
* return (
|
|
18
|
+
* <div>
|
|
19
|
+
* <button onClick={tour.start}>Start Tour</button>
|
|
20
|
+
* {tour.isActive && (
|
|
21
|
+
* <div>
|
|
22
|
+
* Step {tour.currentStep + 1} of {steps.length}
|
|
23
|
+
* </div>
|
|
24
|
+
* )}
|
|
25
|
+
* </div>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useTour(steps: TourStep[]): UseTourReturn;
|
|
31
|
+
//# sourceMappingURL=useTour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTour.d.ts","sourceRoot":"","sources":["../../src/hooks/useTour.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,aAAa,CA+GxD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Analytics, I18n } from 'hintorium-core';
|
|
2
|
+
export { TooltipProvider } from './components/TooltipProvider';
|
|
3
|
+
export type { TooltipProviderProps } from './components/TooltipProvider';
|
|
4
|
+
export { Tooltip } from './components/Tooltip';
|
|
5
|
+
export { Tour } from './components/Tour';
|
|
6
|
+
export type { TourProps } from './components/Tour';
|
|
7
|
+
export { useHintoriumI18n } from './hooks/useHintoriumI18n';
|
|
8
|
+
export { useTooltipAnalytics } from './hooks/useTooltipAnalytics';
|
|
9
|
+
export { useAnalytics } from './hooks/useAnalytics';
|
|
10
|
+
export { useTooltip, useTooltipInstance } from './hooks/useTooltip';
|
|
11
|
+
export { useTooltipManager } from './hooks/useTooltipManager';
|
|
12
|
+
export { useTour } from './hooks/useTour';
|
|
13
|
+
export { useInlineHint, useInlineHintManager } from './hooks/useInlineHint';
|
|
14
|
+
export { useTooltipContext } from './context/TooltipContext';
|
|
15
|
+
export type { TooltipOptions, TooltipPosition, TooltipTheme, TooltipAnimation, UseTooltipOptions, TooltipComponentProps, TourStep, UseTourReturn, } from './types';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,YAAY,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC"}
|