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
@@ -0,0 +1,238 @@
1
+ html,
2
+ body {
3
+ margin: 0px;
4
+ padding: 0px;
5
+ min-width: 1024px;
6
+ letter-spacing: 0.05rem;
7
+ }
8
+ .tooltip-example {
9
+ background: #1182dd;
10
+ height: 900px;
11
+ position: relative;
12
+ }
13
+ .tooltip-example .title {
14
+ color: #fff;
15
+ padding-top: 50px;
16
+ margin-top: 0px;
17
+ font-size: 45px;
18
+ text-align: center;
19
+ margin-bottom: 20px;
20
+ font-weight: 700;
21
+ }
22
+ .demonstration {
23
+ width: 600px;
24
+ height: 150px;
25
+ margin: 10px auto;
26
+ background: rgba(0, 0, 0, 0.1);
27
+ border-radius: 5px;
28
+ box-sizing: border-box;
29
+ position: relative;
30
+ }
31
+ .demonstration a {
32
+ display: block;
33
+ width: 60px;
34
+ height: 60px;
35
+ line-height: 60px;
36
+ border-radius: 60px;
37
+ text-align: center;
38
+ color: #222;
39
+ background: rgba(255, 255, 255, 1);
40
+ position: absolute;
41
+ left: 50%;
42
+ top: 50%;
43
+ margin-left: -30px;
44
+ margin-top: -15px;
45
+ cursor: pointer;
46
+ box-shadow: 3px 4px 3px rgba(0, 0, 0, 0.5);
47
+ border: 1px solid #333;
48
+ }
49
+ .demonstration a:after {
50
+ content: 'hover on me';
51
+ text-align: center;
52
+ color: rgba(0, 0, 0, 0.25);
53
+ position: absolute;
54
+ width: 100px;
55
+ top: 45px;
56
+ left: -18px;
57
+ }
58
+ .control-panel {
59
+ background: rgba(255, 255, 255, 0.4);
60
+ border-top: 1px solid rgba(0, 0, 0, 0.2);
61
+ position: absolute;
62
+ bottom: 0px;
63
+ left: 0px;
64
+ right: 0px;
65
+ width: 100%;
66
+ height: auto;
67
+ padding-bottom: 30px;
68
+ overflow: auto;
69
+ }
70
+ .control-panel:after {
71
+ content: '';
72
+ height: 0px;
73
+ display: block;
74
+ clear: both;
75
+ }
76
+ .control-panel .button-group {
77
+ box-sizing: border-box;
78
+ width: 55%;
79
+ float: left;
80
+ padding-left: 10px;
81
+ }
82
+ .control-panel .button-group .item {
83
+ padding: 3px 2px;
84
+ clear: both;
85
+ }
86
+ .control-panel .button-group .item p {
87
+ margin: 10px 0px 2px;
88
+ font-size: 18px;
89
+ color: black;
90
+ }
91
+ .control-panel .button-group .item a {
92
+ border-radius: 3px;
93
+ text-align: center;
94
+ cursor: pointer;
95
+ transition: background 0.25s ease-out;
96
+ background: #e8e8e8;
97
+ float: left;
98
+ margin-right: 8px;
99
+ padding: 7px 10px;
100
+ font-size: 14px;
101
+ }
102
+ .control-panel .button-group .item a .mark {
103
+ color: #888;
104
+ font-size: 13px;
105
+ display: inline-block;
106
+ padding-left: 3px;
107
+ }
108
+ .control-panel .button-group .item a.active,
109
+ .control-panel .button-group .item a:hover {
110
+ color: #fff;
111
+ background: #1182dd;
112
+ }
113
+ .control-panel .button-group .item a.active .mark,
114
+ .control-panel .button-group .item a:hover .mark {
115
+ color: rgba(255, 255, 255, 0.6);
116
+ }
117
+ .control-panel pre {
118
+ box-sizing: border-box;
119
+ width: 45%;
120
+ float: left;
121
+ }
122
+ .control-panel pre div {
123
+ background: rgba(255, 255, 255, 0.8);
124
+ margin: 0px 20px;
125
+ padding: 8px 12px;
126
+ }
127
+ .control-panel pre .label {
128
+ margin: 10px 0px 2px;
129
+ font-size: 18px;
130
+ color: #777;
131
+ }
132
+ .advance .title {
133
+ color: #222;
134
+ padding-top: 100px;
135
+ margin-top: 0px;
136
+ font-size: 30px;
137
+ text-align: center;
138
+ margin-bottom: 20px;
139
+ font-weight: 700;
140
+ }
141
+ .advance .sub-title {
142
+ border-bottom: 1px solid rgba(0, 0, 0, 0.4);
143
+ color: #666;
144
+ font-size: 20px;
145
+ padding-bottom: 5px;
146
+ }
147
+ .advance .section {
148
+ width: 800px;
149
+ margin: 20px auto;
150
+ }
151
+ .example-jsx {
152
+ padding: 10px 0px;
153
+ height: 50px;
154
+ }
155
+ .example-jsx:after {
156
+ content: '';
157
+ clear: both;
158
+ height: 0;
159
+ visibility: hidden;
160
+ }
161
+ .example-jsx .block {
162
+ float: left;
163
+ }
164
+ .example-jsx .block a {
165
+ text-align: center;
166
+ width: 55px;
167
+ height: 55px;
168
+ border: 1px solid #999;
169
+ border-radius: 0px;
170
+ }
171
+ .example-jsx .side {
172
+ width: 50%;
173
+ float: left;
174
+ box-sizing: border-box;
175
+ }
176
+ .example-jsx .side-3 {
177
+ width: 33.333%;
178
+ float: left;
179
+ box-sizing: border-box;
180
+ }
181
+ .example-jsx a {
182
+ text-align: center;
183
+ width: 55px;
184
+ height: 55px;
185
+ line-height: 55px;
186
+ border-radius: 55px;
187
+ display: block;
188
+ margin: auto;
189
+ cursor: pointer;
190
+ color: #999;
191
+ border: 1px solid #999;
192
+ font-size: 13px;
193
+ }
194
+ .example-jsx a:hover {
195
+ color: #222;
196
+ border: 1px solid #222;
197
+ }
198
+ .example-jsx p {
199
+ margin-bottom: 2px;
200
+ padding: 0px;
201
+ }
202
+ .example-jsx ul {
203
+ padding: 0px;
204
+ list-style: none;
205
+ }
206
+ .example-jsx ul li {
207
+ padding-left: 10px;
208
+ margin: 0px;
209
+ text-align: left;
210
+ }
211
+ .example-pre {
212
+ border-radius: 2px;
213
+ border: 1px solid rgba(0, 0, 0, 0.2);
214
+ box-sizing: border-box;
215
+ padding: 10px;
216
+ margin-bottom: 60px;
217
+ font-size: 14px;
218
+ }
219
+ .example-pre p {
220
+ line-height: 30px;
221
+ }
222
+ .extraClass {
223
+ font-size: 20px;
224
+ background-color: #00ffe5;
225
+ color: #222;
226
+ }
227
+ .extraClass .extraClassArrow {
228
+ background-color: #00ffe5;
229
+ }
230
+ .customTheme {
231
+ color: #ff6e00;
232
+ background-color: orange;
233
+ }
234
+ .customTheme.place-top:after {
235
+ border-top-color: orange;
236
+ border-top-style: solid;
237
+ border-top-width: 6px;
238
+ }
@@ -0,0 +1,15 @@
1
+ import { StrictMode, version } from 'react'
2
+ import { createRoot } from 'react-dom/client'
3
+ import 'react-tooltip/dist/react-tooltip.css'
4
+ import './index.css'
5
+ import App from './App'
6
+
7
+ console.log('Examples folder loaded React version: ', version)
8
+
9
+ const container = document.getElementById('root')
10
+ const root = createRoot(container)
11
+ root.render(
12
+ <StrictMode>
13
+ <App />
14
+ </StrictMode>,
15
+ )
@@ -0,0 +1,251 @@
1
+ html,
2
+ body {
3
+ margin: 0px;
4
+ padding: 0px;
5
+ min-width: 1024px;
6
+ letter-spacing: 0.05rem;
7
+ }
8
+ .tooltip-example {
9
+ background: #1182dd;
10
+ height: 900px;
11
+ position: relative;
12
+ .title {
13
+ color: #fff;
14
+ padding-top: 50px;
15
+ margin-top: 0px;
16
+ font-size: 45px;
17
+ text-align: center;
18
+ margin-bottom: 20px;
19
+ font-weight: 700;
20
+ }
21
+ }
22
+ .demonstration {
23
+ width: 600px;
24
+ height: 150px;
25
+ margin: 10px auto;
26
+ background: rgba(0, 0, 0, 0.1);
27
+ border-radius: 5px;
28
+ box-sizing: border-box;
29
+ position: relative;
30
+ $wd: 60px;
31
+ a {
32
+ display: block;
33
+ width: $wd;
34
+ height: $wd;
35
+ line-height: $wd;
36
+ border-radius: $wd;
37
+ text-align: center;
38
+ color: #222;
39
+ background: rgba(255, 255, 255, 1);
40
+ position: absolute;
41
+ left: 50%;
42
+ top: 50%;
43
+ margin-left: -$wd / 2;
44
+ margin-top: -$wd / 2 - 15;
45
+ cursor: pointer;
46
+ box-shadow: 3px 4px 3px rgba(0, 0, 0, 0.5);
47
+ border: 1px solid #333;
48
+ &:after {
49
+ content: 'hover on me';
50
+ text-align: center;
51
+ color: rgba(0, 0, 0, 0.25);
52
+ position: absolute;
53
+ width: 100px;
54
+ top: 45px;
55
+ left: -18px;
56
+ }
57
+ }
58
+ }
59
+ .control-panel {
60
+ background: rgba(255, 255, 255, 0.4);
61
+ border-top: 1px solid rgba(0, 0, 0, 0.2);
62
+ position: absolute;
63
+ bottom: 0px;
64
+ left: 0px;
65
+ right: 0px;
66
+ width: 100%;
67
+ height: auto;
68
+ padding-bottom: 30px;
69
+ overflow: auto;
70
+ &:after {
71
+ content: '';
72
+ height: 0px;
73
+ display: block;
74
+ clear: both;
75
+ }
76
+ .button-group {
77
+ box-sizing: border-box;
78
+ width: 55%;
79
+ float: left;
80
+ padding-left: 10px;
81
+ .item {
82
+ padding: 3px 2px;
83
+ clear: both;
84
+ p {
85
+ margin: 10px 0px 2px;
86
+ font-size: 18px;
87
+ color: white;
88
+ }
89
+ a {
90
+ border-radius: 3px;
91
+ text-align: center;
92
+ cursor: pointer;
93
+ transition: background 0.25s ease-out;
94
+ background: #e8e8e8;
95
+ float: left;
96
+ margin-right: 8px;
97
+ padding: 7px 10px;
98
+ font-size: 14px;
99
+ .mark {
100
+ color: #888;
101
+ font-size: 13px;
102
+ display: inline-block;
103
+ padding-left: 3px;
104
+ }
105
+ &.active,
106
+ &:hover {
107
+ color: #fff;
108
+ background: #1182dd;
109
+ .mark {
110
+ color: rgba(255, 255, 255, 0.6);
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ pre {
117
+ box-sizing: border-box;
118
+ width: 45%;
119
+ float: left;
120
+ div {
121
+ background: rgba(255, 255, 255, 0.8);
122
+ margin: 0px 20px;
123
+ padding: 8px 12px;
124
+ }
125
+ .label {
126
+ margin: 10px 0px 2px;
127
+ font-size: 18px;
128
+ color: #777;
129
+ }
130
+ }
131
+ }
132
+
133
+ .advance {
134
+ .title {
135
+ color: #222;
136
+ padding-top: 100px;
137
+ margin-top: 0px;
138
+ font-size: 30px;
139
+ text-align: center;
140
+ margin-bottom: 20px;
141
+ font-weight: 700;
142
+ }
143
+ .sub-title {
144
+ border-bottom: 1px solid rgba(0, 0, 0, 0.4);
145
+ color: #666;
146
+ font-size: 20px;
147
+ padding-bottom: 5px;
148
+ }
149
+ .section {
150
+ width: 800px;
151
+ margin: 20px auto;
152
+ }
153
+ }
154
+
155
+ .example-jsx {
156
+ padding: 10px 0px;
157
+ height: 50px;
158
+ &:after {
159
+ content: '';
160
+ clear: both;
161
+ height: 0;
162
+ visibility: hidden;
163
+ }
164
+ .block {
165
+ float: left;
166
+ $width: 55px;
167
+
168
+ a {
169
+ text-align: center;
170
+ width: $width;
171
+ height: $width;
172
+ border: 1px solid #999;
173
+ border-radius: 0px;
174
+ }
175
+ }
176
+ .side {
177
+ width: 50%;
178
+ float: left;
179
+ box-sizing: border-box;
180
+ }
181
+ .side-3 {
182
+ width: 33.333%;
183
+ float: left;
184
+ box-sizing: border-box;
185
+ }
186
+ a {
187
+ text-align: center;
188
+ $width: 55px;
189
+ width: $width;
190
+ height: $width;
191
+ line-height: $width;
192
+ border-radius: $width;
193
+ display: block;
194
+ margin: auto;
195
+ cursor: pointer;
196
+ color: #999;
197
+ border: 1px solid #999;
198
+ font-size: 13px;
199
+ &:hover {
200
+ color: #222;
201
+ border: 1px solid #222;
202
+ }
203
+ }
204
+ p {
205
+ margin-bottom: 2px;
206
+ padding: 0px;
207
+ }
208
+ ul {
209
+ padding: 0px;
210
+ list-style: none;
211
+ li {
212
+ padding-left: 10px;
213
+ margin: 0px;
214
+ text-align: left;
215
+ }
216
+ }
217
+ }
218
+
219
+ .example-pre {
220
+ border-radius: 2px;
221
+ border: 1px solid rgba(0, 0, 0, 0.2);
222
+ box-sizing: border-box;
223
+ padding: 10px;
224
+ margin-bottom: 60px;
225
+ font-size: 14px;
226
+ p {
227
+ line-height: 30px;
228
+ }
229
+ }
230
+
231
+ // Extra class for demonstration
232
+ .extraClass {
233
+ font-size: 20px !important;
234
+ pointer-events: auto !important;
235
+ &:hover {
236
+ visibility: visible !important;
237
+ opacity: 1 !important;
238
+ }
239
+ }
240
+
241
+ .customTheme {
242
+ color: #ff6e00 !important;
243
+ background-color: orange !important;
244
+ &.place-top {
245
+ &:after {
246
+ border-top-color: orange !important;
247
+ border-top-style: solid !important;
248
+ border-top-width: 6px !important;
249
+ }
250
+ }
251
+ }