react-tooltip 4.5.0 → 5.0.0-beta.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.
Files changed (90) hide show
  1. package/.editorconfig +25 -0
  2. package/.eslintrc.json +94 -0
  3. package/.gitattributes +3 -0
  4. package/.github/FUNDING.yml +13 -0
  5. package/.github/workflows/lint.yaml +35 -0
  6. package/.github/workflows/pull-request.yaml +11 -0
  7. package/.github/workflows/release.yaml +30 -0
  8. package/.husky/pre-commit +6 -0
  9. package/.prettierrc.json +10 -0
  10. package/.stylelintrc.json +19 -0
  11. package/.vscode/settings.json +27 -0
  12. package/bower.json +26 -0
  13. package/build/dist/react-tooltip.cjs.js +2909 -0
  14. package/build/dist/react-tooltip.cjs.min.js +6 -0
  15. package/build/dist/react-tooltip.css +73 -0
  16. package/build/dist/react-tooltip.esm.js +2901 -0
  17. package/build/dist/react-tooltip.esm.min.js +6 -0
  18. package/build/dist/react-tooltip.min.css +1 -0
  19. package/build/dist/react-tooltip.umd.js +2913 -0
  20. package/build/dist/react-tooltip.umd.min.js +6 -0
  21. package/build/index.css +79 -0
  22. package/build/index.html +19 -0
  23. package/build/index.js +36190 -0
  24. package/cli.js +30 -0
  25. package/contributing.md +40 -0
  26. package/dist/react-tooltip.cjs.js +2932 -0
  27. package/dist/react-tooltip.cjs.min.js +6 -0
  28. package/dist/react-tooltip.css +73 -0
  29. package/dist/react-tooltip.esm.js +2924 -0
  30. package/dist/react-tooltip.esm.min.js +6 -0
  31. package/dist/react-tooltip.min.css +1 -0
  32. package/dist/react-tooltip.umd.js +2936 -0
  33. package/dist/react-tooltip.umd.min.js +6 -0
  34. package/docs/README.md +50 -0
  35. package/docs/babel.config.js +3 -0
  36. package/docs/docs/examples/_category_.json +7 -0
  37. package/docs/docs/examples/basic-examples.mdx +68 -0
  38. package/docs/docs/examples/children.mdx +67 -0
  39. package/docs/docs/examples/content.mdx +80 -0
  40. package/docs/docs/examples/delay.mdx +84 -0
  41. package/docs/docs/examples/events.mdx +85 -0
  42. package/docs/docs/examples/get-content.mdx +58 -0
  43. package/docs/docs/examples/html.mdx +75 -0
  44. package/docs/docs/examples/multiline.mdx +91 -0
  45. package/docs/docs/examples/offset.mdx +69 -0
  46. package/docs/docs/examples/place.mdx +55 -0
  47. package/docs/docs/examples/state.mdx +331 -0
  48. package/docs/docs/examples/styling.mdx +388 -0
  49. package/docs/docs/examples/variant.mdx +100 -0
  50. package/docs/docs/getting-started.md +70 -0
  51. package/docs/docs/options.mdx +105 -0
  52. package/docs/docs/upgrade-guide/_category_.json +7 -0
  53. package/docs/docs/upgrade-guide/basic-examples-v4-v5.mdx +119 -0
  54. package/docs/docs/upgrade-guide/changelog-v4-v5.md +85 -0
  55. package/docs/docusaurus.config.js +126 -0
  56. package/docs/package.json +47 -0
  57. package/docs/sidebars.js +33 -0
  58. package/docs/src/components/HomepageFeatures/index.tsx +70 -0
  59. package/docs/src/components/HomepageFeatures/styles.module.css +11 -0
  60. package/docs/src/css/custom.css +74 -0
  61. package/docs/src/pages/index.module.css +35 -0
  62. package/docs/src/pages/index.tsx +42 -0
  63. package/docs/src/pages/markdown-page.md +7 -0
  64. package/docs/static/.nojekyll +0 -0
  65. package/docs/static/img/docusaurus.png +0 -0
  66. package/docs/static/img/favicon.ico +0 -0
  67. package/docs/static/img/logo.svg +1 -0
  68. package/docs/static/img/undraw_docusaurus_mountain.svg +171 -0
  69. package/docs/static/img/undraw_docusaurus_react.svg +170 -0
  70. package/docs/static/img/undraw_docusaurus_tree.svg +40 -0
  71. package/docs/tsconfig.json +7 -0
  72. package/docs/yarn.lock +7579 -0
  73. package/example-v5/package.json +21 -0
  74. package/example-v5/public/index.html +20 -0
  75. package/example-v5/public/manifest.json +8 -0
  76. package/example-v5/src/App.jsx +908 -0
  77. package/example-v5/src/index.css +238 -0
  78. package/example-v5/src/index.js +15 -0
  79. package/example-v5/src/index.scss +251 -0
  80. package/package.json +94 -146
  81. package/public/index.html +19 -0
  82. package/rollup.config.dev.js +88 -0
  83. package/rollup.config.prod.js +104 -0
  84. package/rollup.config.types.js +7 -0
  85. package/tsconfig.json +109 -0
  86. package/dist/index.es.js +0 -3185
  87. package/dist/index.es.js.map +0 -1
  88. package/dist/index.js +0 -3192
  89. package/dist/index.js.map +0 -1
  90. package/dist/react-tooltip.d.ts +0 -124
@@ -1,124 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface Offset {
4
- top?: number;
5
- right?: number;
6
- left?: number;
7
- bottom?: number;
8
- }
9
-
10
- type Place = 'top' | 'right' | 'bottom' | 'left';
11
- type Type = 'dark' | 'success' | 'warning' | 'error' | 'info' | 'light';
12
- type Effect = 'float' | 'solid';
13
-
14
- type VoidFunc = (...args: any[]) => void;
15
- type GetContentFunc = (toolTipStr: string) => React.ReactNode;
16
- type GetContent = GetContentFunc | [GetContentFunc, number];
17
-
18
- export interface TooltipProps {
19
- children?: React.ReactNode;
20
- uuid?: string;
21
- // Placement of tooltip
22
- place?: Place;
23
- // Tooltip styling theme
24
- type?: Type;
25
- // Behavior of tooltip
26
- effect?: Effect;
27
- // Global tooltip offset, e.g., offset={{ top: 10, left: 5 }}
28
- offset?: Offset;
29
- // Support <br /> to make explicitly multiline tooltip comments
30
- multiline?: boolean;
31
- // Add 1px white border
32
- border?: boolean;
33
- // A custom class name to use for the border
34
- borderClass?: string;
35
- // Popup text color
36
- textColor?: string;
37
- // Popup background color
38
- backgroundColor?: string;
39
- // Popup border color
40
- borderColor?: string;
41
- // Popup arrow color
42
- arrowColor?: string;
43
- // Whether to inject the style header into the page
44
- // dynamically (violates CSP style-src, but is a convenient default);
45
- // default = true
46
- insecure?: boolean;
47
- // Extra style class
48
- class?: string;
49
- // Extra style class
50
- className?: string;
51
- // HTML id attribute
52
- id?: string;
53
- // Inject raw HTML? (This is a security risk)
54
- html?: boolean;
55
- // Time delay for hiding popup
56
- delayHide?: number;
57
- // Time delay for updating popup
58
- delayUpdate?: number;
59
- // Time delay for showing popup
60
- delayShow?: number;
61
- // Custom event to trigger tooltip
62
- event?: keyof HTMLElementEventMap | string;
63
- // Custom event to hide tooltip
64
- // (this requires the event prop as well)
65
- eventOff?: keyof HTMLElementEventMap | string;
66
- // When set to true, custom event's propagation
67
- // mode will be captue
68
- isCapture?: boolean;
69
- // Global event to hide tooltip
70
- globalEventOff?: keyof HTMLElementEventMap | string;
71
- // Function to dynamically generate the tooltip content
72
- getContent?: GetContent;
73
- // Callback after tooltip is shown
74
- afterShow?: VoidFunc;
75
- // Callback after tooltip is hidden
76
- afterHide?: VoidFunc;
77
- // Callback to override the tooltip position
78
- overridePosition?: (
79
- position: { left: number; top: number },
80
- currentEvent: Event,
81
- currentTarget: EventTarget,
82
- // node is the ref argument, and the wrapper
83
- // is restricted to: div | span
84
- refNode: null | HTMLDivElement | HTMLSpanElement,
85
- place: Place,
86
- desiredPlace: Place,
87
- effect: Effect,
88
- offset: Offset
89
- ) => { left: number; top: number };
90
- // Manually disable the tooltip behavior
91
- disable?: boolean;
92
- // Hide the tooltip when scrolling;
93
- // default = true
94
- scrollHide?: boolean;
95
- // Hide the tooltip when risizing the window;
96
- // default = true
97
- resizeHide?: boolean;
98
- // The tooltip parent component;
99
- // default = 'div'
100
- wrapper?: 'div' | 'span';
101
- // Listen to body events vs. individual events
102
- bodyMode?: boolean;
103
- // List of potential custom events to trigger the popup (in body mode)
104
- possibleCustomEvents?: string;
105
- // List of potential custom events to hide the popup (in body mode)
106
- possibleCustomEventsOff?: string;
107
- // Should the tooltip by clickable?
108
- clickable?: boolean;
109
- // Aria role for the tooltip
110
- role?: string;
111
- // Padding attribute
112
- padding?: string;
113
- // Set internal style as optional
114
- disableInternalStyle?: boolean;
115
- }
116
-
117
- // ReactTooltip component is the default export
118
- // You can overview demo examples here: https://bddeu.csb.app
119
- export default class ReactTooltip extends React.Component<TooltipProps> {
120
- // static methods
121
- static show: (target: Element) => {};
122
- static hide: (target?: Element) => {};
123
- static rebuild: () => {};
124
- }