react-tooltip 5.0.0-beta.1 → 5.0.0-beta.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.
- package/.eslintrc.json +2 -1
- package/CODE_OF_CONDUCT.md +53 -0
- package/LICENSE +1 -2
- package/README.md +30 -152
- package/coverage/clover.xml +610 -0
- package/coverage/coverage-final.json +11 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/Tooltip/Tooltip.tsx.html +646 -0
- package/coverage/lcov-report/components/Tooltip/index.html +146 -0
- package/coverage/lcov-report/components/Tooltip/index.ts.html +88 -0
- package/coverage/lcov-report/components/Tooltip/styles.module.css.html +277 -0
- package/coverage/lcov-report/components/TooltipContent/TooltipContent.tsx.html +109 -0
- package/coverage/lcov-report/components/TooltipContent/index.html +131 -0
- package/coverage/lcov-report/components/TooltipContent/index.ts.html +88 -0
- package/coverage/lcov-report/components/TooltipController/TooltipController.tsx.html +664 -0
- package/coverage/lcov-report/components/TooltipController/constants.ts.html +118 -0
- package/coverage/lcov-report/components/TooltipController/index.html +146 -0
- package/coverage/lcov-report/components/TooltipController/index.ts.html +88 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +161 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/sum.js.html +97 -0
- package/coverage/lcov-report/sum.ts.html +100 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/sum.ts.html +100 -0
- package/coverage/lcov-report/utils/compute-positions.ts.html +277 -0
- package/coverage/lcov-report/utils/debounce.ts.html +181 -0
- package/coverage/lcov-report/utils/index.html +131 -0
- package/coverage/lcov.info +729 -0
- package/dist/react-tooltip.cjs.js +3 -6
- package/dist/react-tooltip.cjs.min.js +1 -1
- package/dist/react-tooltip.esm.js +3 -6
- package/dist/react-tooltip.esm.min.js +1 -1
- package/dist/react-tooltip.umd.js +3 -6
- package/dist/react-tooltip.umd.min.js +1 -1
- package/jest.config.ts +214 -0
- package/package.json +12 -4
- package/tsconfig.json +2 -2
- package/.github/FUNDING.yml +0 -13
- package/.github/workflows/lint.yaml +0 -35
- package/.github/workflows/pull-request.yaml +0 -11
- package/.github/workflows/release.yaml +0 -30
- package/.husky/pre-commit +0 -6
- package/.vscode/settings.json +0 -27
- package/build/dist/react-tooltip.cjs.js +0 -2909
- package/build/dist/react-tooltip.cjs.min.js +0 -6
- package/build/dist/react-tooltip.css +0 -73
- package/build/dist/react-tooltip.esm.js +0 -2901
- package/build/dist/react-tooltip.esm.min.js +0 -6
- package/build/dist/react-tooltip.min.css +0 -1
- package/build/dist/react-tooltip.umd.js +0 -2913
- package/build/dist/react-tooltip.umd.min.js +0 -6
- package/build/index.css +0 -79
- package/build/index.html +0 -19
- package/build/index.js +0 -36190
- package/docs/README.md +0 -50
- package/docs/babel.config.js +0 -3
- package/docs/docs/examples/_category_.json +0 -7
- package/docs/docs/examples/basic-examples.mdx +0 -68
- package/docs/docs/examples/children.mdx +0 -67
- package/docs/docs/examples/content.mdx +0 -80
- package/docs/docs/examples/delay.mdx +0 -84
- package/docs/docs/examples/events.mdx +0 -85
- package/docs/docs/examples/get-content.mdx +0 -58
- package/docs/docs/examples/html.mdx +0 -75
- package/docs/docs/examples/multiline.mdx +0 -91
- package/docs/docs/examples/offset.mdx +0 -69
- package/docs/docs/examples/place.mdx +0 -55
- package/docs/docs/examples/state.mdx +0 -331
- package/docs/docs/examples/styling.mdx +0 -388
- package/docs/docs/examples/variant.mdx +0 -100
- package/docs/docs/getting-started.mdx +0 -100
- package/docs/docs/options.mdx +0 -105
- package/docs/docs/upgrade-guide/_category_.json +0 -7
- package/docs/docs/upgrade-guide/basic-examples-v4-v5.mdx +0 -119
- package/docs/docs/upgrade-guide/changelog-v4-v5.md +0 -86
- package/docs/docusaurus.config.js +0 -135
- package/docs/package.json +0 -47
- package/docs/sidebars.js +0 -33
- package/docs/src/components/HomepageFeatures/index.tsx +0 -71
- package/docs/src/components/HomepageFeatures/styles.module.css +0 -11
- package/docs/src/css/custom.css +0 -74
- package/docs/src/pages/index.module.css +0 -35
- package/docs/src/pages/index.tsx +0 -45
- package/docs/src/pages/markdown-page.md +0 -7
- package/docs/static/.nojekyll +0 -0
- package/docs/static/img/Octocat.jpg +0 -0
- package/docs/static/img/Octocat.png +0 -0
- package/docs/static/img/Octocat.svg +0 -9
- package/docs/static/img/android-chrome-192x192.png +0 -0
- package/docs/static/img/android-chrome-512x512.png +0 -0
- package/docs/static/img/apple-touch-icon.png +0 -0
- package/docs/static/img/docusaurus.png +0 -0
- package/docs/static/img/favicon-16x16.png +0 -0
- package/docs/static/img/favicon-32x32.png +0 -0
- package/docs/static/img/favicon-old.ico +0 -0
- package/docs/static/img/favicon.ico +0 -0
- package/docs/static/img/github.svg +0 -1
- package/docs/static/img/happy-face-tooltip.png +0 -0
- package/docs/static/img/happy-face-tooltip.svg +0 -21
- package/docs/static/img/logo-dinossaur.svg +0 -1
- package/docs/static/img/logo.png +0 -0
- package/docs/static/img/logo.svg +0 -21
- package/docs/static/img/only-tooltip-top.png +0 -0
- package/docs/static/img/only-tooltip-top.svg +0 -4
- package/docs/static/img/only-tooltip.png +0 -0
- package/docs/static/img/only-tooltip.svg +0 -4
- package/docs/static/img/site.webmanifest +0 -1
- package/docs/static/img/undraw_docusaurus_mountain.svg +0 -171
- package/docs/static/img/undraw_docusaurus_react.svg +0 -170
- package/docs/static/img/undraw_docusaurus_tree.svg +0 -40
- package/docs/tsconfig.json +0 -7
- package/docs/yarn.lock +0 -7599
- package/example-v5/package.json +0 -21
- package/example-v5/public/index.html +0 -20
- package/example-v5/public/manifest.json +0 -8
- package/example-v5/src/App.jsx +0 -908
- package/example-v5/src/index.css +0 -238
- package/example-v5/src/index.js +0 -15
- package/example-v5/src/index.scss +0 -251
- package/public/index.html +0 -19
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 4
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Basic examples V4 -> V5
|
|
6
|
-
|
|
7
|
-
import { Tooltip } from 'react-tooltip'
|
|
8
|
-
import 'react-tooltip/dist/react-tooltip.css'
|
|
9
|
-
|
|
10
|
-
export const TooltipAnchor = ({ children, id, ...rest }) => {
|
|
11
|
-
return (
|
|
12
|
-
<span
|
|
13
|
-
id={id}
|
|
14
|
-
style={{
|
|
15
|
-
display: 'flex',
|
|
16
|
-
justifyContent: 'center',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
width: '60px',
|
|
19
|
-
height: '60px',
|
|
20
|
-
borderRadius: '60px',
|
|
21
|
-
color: '#222',
|
|
22
|
-
background: 'rgba(255, 255, 255, 1)',
|
|
23
|
-
cursor: 'pointer',
|
|
24
|
-
boxShadow: '3px 4px 3px rgba(0, 0, 0, 0.5)',
|
|
25
|
-
border: '1px solid #333',
|
|
26
|
-
}}
|
|
27
|
-
{...rest}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
</span>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
### V4 or less
|
|
35
|
-
|
|
36
|
-
```jsx
|
|
37
|
-
import ReactTooltip from 'react-tooltip';
|
|
38
|
-
|
|
39
|
-
<a data-tip="hello world!" data-for="tooltip"> ◕‿‿◕ </a>
|
|
40
|
-
|
|
41
|
-
<ReactTooltip id="tooltip" place="top" type="dark" />
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
(v4) `data-tip` = `data-content` (v5)
|
|
45
|
-
|
|
46
|
-
- `V4` - CSS styles are built-in and injected by tooltip into the header (not a good practice but convenient), [issues in GitHub](https://github.com/ReactTooltip/react-tooltip/issues?q=is%3Aissue+header)
|
|
47
|
-
- `V5` - CSS styles are optional and can be imported or not to the project
|
|
48
|
-
|
|
49
|
-
### V5 - props option
|
|
50
|
-
|
|
51
|
-
```jsx
|
|
52
|
-
import { Tooltip } from 'react-tooltip';
|
|
53
|
-
import 'react-tooltip/dist/react-tooltip.css'
|
|
54
|
-
|
|
55
|
-
<a id="props-basic"> ◕‿‿◕ </a>
|
|
56
|
-
|
|
57
|
-
<Tooltip anchorId="props-basic" content="hello world!" />
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
<TooltipAnchor id="props-basic">◕‿‿◕</TooltipAnchor>
|
|
61
|
-
<Tooltip anchorId="props-basic" content="hello world!" />
|
|
62
|
-
|
|
63
|
-
### V5 - data attributes
|
|
64
|
-
|
|
65
|
-
```jsx
|
|
66
|
-
import { Tooltip } from 'react-tooltip';
|
|
67
|
-
import 'react-tooltip/dist/react-tooltip.css';
|
|
68
|
-
|
|
69
|
-
<a id="attributes-basic" data-content="hello world!"> ◕‿‿◕ </a>
|
|
70
|
-
|
|
71
|
-
<Tooltip anchorId="attributes-basic" />
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
<TooltipAnchor id="attributes-basic" data-tooltip-content="hello world!">
|
|
75
|
-
◕‿‿◕
|
|
76
|
-
</TooltipAnchor>
|
|
77
|
-
<Tooltip anchorId="attributes-basic" />
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
# Colors
|
|
82
|
-
|
|
83
|
-
### V4 or less - type
|
|
84
|
-
|
|
85
|
-
```jsx
|
|
86
|
-
import ReactTooltip from 'react-tooltip';
|
|
87
|
-
|
|
88
|
-
<a data-tip="hello world!" data-for="tooltip"> ◕‿‿◕ </a>
|
|
89
|
-
|
|
90
|
-
<ReactTooltip id="tooltip" place="top" type="success" />
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
(v4) `type` = `variant` (v5)
|
|
94
|
-
|
|
95
|
-
### V5 - variant
|
|
96
|
-
|
|
97
|
-
Available values `dark` | `light` | `success` | `warning` | `error` | `info`
|
|
98
|
-
|
|
99
|
-
```jsx
|
|
100
|
-
import { Tooltip } from 'react-tooltip';
|
|
101
|
-
import 'react-tooltip/dist/react-tooltip.css';
|
|
102
|
-
|
|
103
|
-
<a id="attributes-variant" data-tooltip-content="hello world!" data-tooltip-variant="success"> ◕‿‿◕ </a>
|
|
104
|
-
|
|
105
|
-
<Tooltip anchorId="attributes-variant" />
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
<TooltipAnchor
|
|
109
|
-
id="attributes-variant"
|
|
110
|
-
data-tooltip-content="hello world!"
|
|
111
|
-
data-tooltip-variant="success"
|
|
112
|
-
>
|
|
113
|
-
◕‿‿◕
|
|
114
|
-
</TooltipAnchor>
|
|
115
|
-
<Tooltip anchorId="attributes-variant" />
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
Please see [all V5 Options here](../options.mdx).
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 1
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Changelog V4 -> V5
|
|
6
|
-
|
|
7
|
-
If you are using V4 and want to use V5, please read this doc.
|
|
8
|
-
|
|
9
|
-
## From V4 to V5
|
|
10
|
-
|
|
11
|
-
V4 was a great react tooltip component but was built a few years ago, he was built with react class components and it's hard to maintain and to the community give contributions, so, with this in mind, we build a new version of react tooltip using [float-ui](https://floating-ui.com/) behind the scenes. This gives a great improvement in performance and in a new and easier code to let the community contribute to the project.
|
|
12
|
-
|
|
13
|
-
## Improvements
|
|
14
|
-
|
|
15
|
-
- Dropped package dependency `uuid`
|
|
16
|
-
- - Using React `useId` - [Docs](https://reactjs.org/docs/hooks-reference.html#useid)
|
|
17
|
-
- - - Unfortunately `useId` was introduced only into React v18, so, that will be the minimum necessary version of React to V5
|
|
18
|
-
- Dropped package dependency `prop-types`
|
|
19
|
-
- V5 is written in TypeScript
|
|
20
|
-
- V5 has minified and unminified files available to be used as you want
|
|
21
|
-
|
|
22
|
-
## Break Changes
|
|
23
|
-
|
|
24
|
-
- All data attributes now has `tooltip` into his name
|
|
25
|
-
- Default Padding changed from `padding: 8px 21px;` to `padding: 8px 16px;`
|
|
26
|
-
- Exported module now is `Tooltip` instead of `ReactTooltip`
|
|
27
|
-
- - If you already have a `Tooltip` component in your application and want to explicitly declare this is `ReactTooltip`, just `import { Tooltip as ReactTooltip } from "react-tooltip"`
|
|
28
|
-
- CSS import is now optional, so, you can modify and/or add any styling to your floating tooltip element
|
|
29
|
-
- `data-tip` attribute now is `data-content`
|
|
30
|
-
- `getContent` prop now doesn't accept `any` anymore, just a `function`
|
|
31
|
-
- default behavior of tooltip now is `solid` instead of `float`
|
|
32
|
-
|
|
33
|
-
## New Props
|
|
34
|
-
|
|
35
|
-
- [x] classNameArrow
|
|
36
|
-
- [x] events - `data-events` -`['hover', 'click']` - default: `['hover']` (always an array when using as prop, even with only one option, when using as data attribute: `data-events="hover click"`)
|
|
37
|
-
- [x] isOpen - `boolean` (to control tooltip state) - if not used, internal state of tooltip will handle the show state
|
|
38
|
-
- [x] setIsOpen - `function` (to control tooltip state) - if not used, internal state of tooltip will handle the show state
|
|
39
|
-
|
|
40
|
-
## `V4` props available in `V5`
|
|
41
|
-
|
|
42
|
-
- [x] children
|
|
43
|
-
- [x] place - `data-place`
|
|
44
|
-
- [x] type - **Deprecated** | in V5 -> `variant` - `data-variant`
|
|
45
|
-
- [ ] effect
|
|
46
|
-
- [x] offset - `data-offset`
|
|
47
|
-
- [ ] padding - **Deprecated** | in V5 -> can be easy updated by className prop
|
|
48
|
-
- [ ] multiline - **Deprecated** | in V5 -> this is already supported as default by `content` and `html` props
|
|
49
|
-
- [ ] border - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
50
|
-
- [ ] borderClass - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
51
|
-
- [ ] textColor - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
52
|
-
- [ ] backgroundColor - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
53
|
-
- [ ] borderColor - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
54
|
-
- [ ] arrowColor - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
55
|
-
- [ ] arrowRadius - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
56
|
-
- [ ] tooltipRadius - **Deprecated** | in V5 -> can be easy updated by `className` prop
|
|
57
|
-
- [ ] insecure - **Deprecated** | in V5 -> CSS will be a separate file and can be imported or not
|
|
58
|
-
- [x] className
|
|
59
|
-
- [x] id
|
|
60
|
-
- [x] html
|
|
61
|
-
- [x] delayHide - `data-delay-hide`
|
|
62
|
-
- [ ] delayUpdate - **Deprecated** | if requested, can be implemented later
|
|
63
|
-
- [x] delayShow - `data-delay-show`
|
|
64
|
-
- [ ] event
|
|
65
|
-
- [ ] eventOff
|
|
66
|
-
- [ ] isCapture - **Deprecated**
|
|
67
|
-
- [ ] globalEventOff - **Deprecated**
|
|
68
|
-
- [x] getContent - Now this attribute only accepts a function instead of any
|
|
69
|
-
- [ ] afterShow
|
|
70
|
-
- [ ] afterHide
|
|
71
|
-
- [ ] overridePosition - **Deprecated**
|
|
72
|
-
- [ ] disable
|
|
73
|
-
- [ ] scrollHide
|
|
74
|
-
- [ ] resizeHide
|
|
75
|
-
- [x] wrapper - `data-wrapper`
|
|
76
|
-
- [ ] bodyMode - **Deprecated**
|
|
77
|
-
- [ ] clickable - **Deprecated** | Supported by default in V5
|
|
78
|
-
- [ ] disableInternalStyle - **Deprecated** | in V5 -> CSS will be a separate file and can be imported or not
|
|
79
|
-
|
|
80
|
-
### Detailed informations
|
|
81
|
-
|
|
82
|
-
- [The Pull Request of V5](https://github.com/ReactTooltip/react-tooltip/pull/820)
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
Please see [all V5 Options here](../options.mdx).
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
// Note: type annotations allow type checking and IDEs autocompletion
|
|
3
|
-
|
|
4
|
-
const lightCodeTheme = require('prism-react-renderer/themes/github')
|
|
5
|
-
const darkCodeTheme = require('prism-react-renderer/themes/dracula')
|
|
6
|
-
|
|
7
|
-
/** @type {import('@docusaurus/types').Config} */
|
|
8
|
-
const config = {
|
|
9
|
-
title: 'React Tooltip',
|
|
10
|
-
tagline: 'Awesome React Tooltip component',
|
|
11
|
-
url: 'https://react-tooltip.com',
|
|
12
|
-
baseUrl: '/',
|
|
13
|
-
onBrokenLinks: 'throw',
|
|
14
|
-
onBrokenMarkdownLinks: 'warn',
|
|
15
|
-
favicon: 'img/favicon.ico',
|
|
16
|
-
|
|
17
|
-
// GitHub pages deployment config.
|
|
18
|
-
// If you aren't using GitHub pages, you don't need these.
|
|
19
|
-
organizationName: 'ReactTooltip', // Usually your GitHub org/user name.
|
|
20
|
-
projectName: 'ReactTooltip', // Usually your repo name.
|
|
21
|
-
|
|
22
|
-
// Even if you don't use internalization, you can use this field to set useful
|
|
23
|
-
// metadata like html lang. For example, if your site is Chinese, you may want
|
|
24
|
-
// to replace "en" with "zh-Hans".
|
|
25
|
-
i18n: {
|
|
26
|
-
defaultLocale: 'en',
|
|
27
|
-
locales: ['en'],
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
presets: [
|
|
31
|
-
[
|
|
32
|
-
'classic',
|
|
33
|
-
/** @type {import('@docusaurus/preset-classic').Options} */
|
|
34
|
-
({
|
|
35
|
-
docs: {
|
|
36
|
-
sidebarPath: require.resolve('./sidebars.js'),
|
|
37
|
-
// Please change this to your repo.
|
|
38
|
-
// Remove this to remove the "edit this page" links.
|
|
39
|
-
editUrl: 'https://github.com/ReactTooltip/react-tooltip/tree/v5/docs/',
|
|
40
|
-
},
|
|
41
|
-
// blog: {
|
|
42
|
-
// showReadingTime: true,
|
|
43
|
-
// // Please change this to your repo.
|
|
44
|
-
// // Remove this to remove the "edit this page" links.
|
|
45
|
-
// editUrl:
|
|
46
|
-
// 'https://github.com/ReactTooltip/react-tooltip/tree/v5/docs/',
|
|
47
|
-
// },
|
|
48
|
-
theme: {
|
|
49
|
-
customCss: require.resolve('./src/css/custom.css'),
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
],
|
|
53
|
-
],
|
|
54
|
-
|
|
55
|
-
themeConfig:
|
|
56
|
-
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
|
57
|
-
({
|
|
58
|
-
announcementBar: {
|
|
59
|
-
id: 'support_us',
|
|
60
|
-
content:
|
|
61
|
-
'⭐️ If you like ReactTooltip, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/ReactTooltip/react-tooltip">GitHub</a> ⭐️',
|
|
62
|
-
backgroundColor: '#222',
|
|
63
|
-
textColor: '#fff',
|
|
64
|
-
isCloseable: false,
|
|
65
|
-
},
|
|
66
|
-
navbar: {
|
|
67
|
-
title: 'React Tooltip',
|
|
68
|
-
logo: {
|
|
69
|
-
alt: 'React Tooltip Logo',
|
|
70
|
-
src: 'img/only-tooltip.svg',
|
|
71
|
-
width: 120,
|
|
72
|
-
},
|
|
73
|
-
items: [
|
|
74
|
-
{
|
|
75
|
-
type: 'doc',
|
|
76
|
-
docId: 'getting-started',
|
|
77
|
-
position: 'left',
|
|
78
|
-
label: 'Docs',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
href: 'https://github.com/ReactTooltip/react-tooltip/',
|
|
82
|
-
label: 'GitHub',
|
|
83
|
-
position: 'right',
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
footer: {
|
|
88
|
-
style: 'dark',
|
|
89
|
-
links: [
|
|
90
|
-
{
|
|
91
|
-
title: 'Docs',
|
|
92
|
-
items: [
|
|
93
|
-
{
|
|
94
|
-
label: 'Getting Started',
|
|
95
|
-
to: '/docs/getting-started',
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
// {
|
|
100
|
-
// title: 'Community',
|
|
101
|
-
// items: [
|
|
102
|
-
// {
|
|
103
|
-
// label: 'Stack Overflow',
|
|
104
|
-
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
|
105
|
-
// },
|
|
106
|
-
// {
|
|
107
|
-
// label: 'Discord',
|
|
108
|
-
// href: 'https://discordapp.com/invite/docusaurus',
|
|
109
|
-
// },
|
|
110
|
-
// {
|
|
111
|
-
// label: 'Twitter',
|
|
112
|
-
// href: 'https://twitter.com/docusaurus',
|
|
113
|
-
// },
|
|
114
|
-
// ],
|
|
115
|
-
// },
|
|
116
|
-
{
|
|
117
|
-
title: 'More',
|
|
118
|
-
items: [
|
|
119
|
-
{
|
|
120
|
-
label: 'GitHub',
|
|
121
|
-
href: 'https://github.com/ReactTooltip/react-tooltip/',
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
copyright: `Copyright © ${new Date().getFullYear()} React Tooltip. Docs built with Docusaurus.`,
|
|
127
|
-
},
|
|
128
|
-
prism: {
|
|
129
|
-
theme: lightCodeTheme,
|
|
130
|
-
darkTheme: darkCodeTheme,
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
module.exports = config
|
package/docs/package.json
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-tooltip-docs",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"docusaurus": "docusaurus",
|
|
7
|
-
"start": "docusaurus start",
|
|
8
|
-
"build": "docusaurus build",
|
|
9
|
-
"swizzle": "docusaurus swizzle",
|
|
10
|
-
"deploy": "docusaurus deploy",
|
|
11
|
-
"clear": "docusaurus clear",
|
|
12
|
-
"serve": "docusaurus serve",
|
|
13
|
-
"write-translations": "docusaurus write-translations",
|
|
14
|
-
"write-heading-ids": "docusaurus write-heading-ids",
|
|
15
|
-
"typecheck": "tsc"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@docusaurus/core": "2.2.0",
|
|
19
|
-
"@docusaurus/preset-classic": "2.2.0",
|
|
20
|
-
"@mdx-js/react": "^1.6.22",
|
|
21
|
-
"clsx": "^1.2.1",
|
|
22
|
-
"prism-react-renderer": "^1.3.5",
|
|
23
|
-
"react": "18.2.0",
|
|
24
|
-
"react-dom": "18.2.0",
|
|
25
|
-
"react-tooltip": "5.0.0-beta.0"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@docusaurus/module-type-aliases": "2.2.0",
|
|
29
|
-
"@tsconfig/docusaurus": "^1.0.5",
|
|
30
|
-
"typescript": "^4.7.4"
|
|
31
|
-
},
|
|
32
|
-
"browserslist": {
|
|
33
|
-
"production": [
|
|
34
|
-
">0.5%",
|
|
35
|
-
"not dead",
|
|
36
|
-
"not op_mini all"
|
|
37
|
-
],
|
|
38
|
-
"development": [
|
|
39
|
-
"last 1 chrome version",
|
|
40
|
-
"last 1 firefox version",
|
|
41
|
-
"last 1 safari version"
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=16.14 <17.x"
|
|
46
|
-
}
|
|
47
|
-
}
|
package/docs/sidebars.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creating a sidebar enables you to:
|
|
3
|
-
- create an ordered group of docs
|
|
4
|
-
- render a sidebar for each doc of that group
|
|
5
|
-
- provide next/previous navigation
|
|
6
|
-
|
|
7
|
-
The sidebars can be generated from the filesystem, or explicitly defined here.
|
|
8
|
-
|
|
9
|
-
Create as many sidebars as you want.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
// @ts-check
|
|
13
|
-
|
|
14
|
-
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
|
15
|
-
const sidebars = {
|
|
16
|
-
// By default, Docusaurus generates a sidebar from the docs folder structure
|
|
17
|
-
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
|
|
18
|
-
|
|
19
|
-
// But you can create a sidebar manually
|
|
20
|
-
/*
|
|
21
|
-
tutorialSidebar: [
|
|
22
|
-
'intro',
|
|
23
|
-
'hello',
|
|
24
|
-
{
|
|
25
|
-
type: 'category',
|
|
26
|
-
label: 'Tutorial',
|
|
27
|
-
items: ['tutorial-basics/create-a-document'],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
*/
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = sidebars
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-unresolved */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
3
|
-
/* eslint-disable global-require */
|
|
4
|
-
import React from 'react'
|
|
5
|
-
import clsx from 'clsx'
|
|
6
|
-
import styles from './styles.module.css'
|
|
7
|
-
|
|
8
|
-
type FeatureItem = {
|
|
9
|
-
title: string
|
|
10
|
-
Svg: React.ComponentType<React.ComponentProps<'svg'>>
|
|
11
|
-
description: JSX.Element
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const FeatureList: FeatureItem[] = [
|
|
15
|
-
{
|
|
16
|
-
title: 'Easy to Use',
|
|
17
|
-
Svg: require('@site/static/img/only-tooltip-top.svg').default,
|
|
18
|
-
description: (
|
|
19
|
-
<>ReactTooltip was designed with love from the ground up to be easily installed and used.</>
|
|
20
|
-
),
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
title: 'Open Source',
|
|
24
|
-
Svg: require('@site/static/img/github.svg').default,
|
|
25
|
-
description: (
|
|
26
|
-
<>
|
|
27
|
-
An Open Source project built by developers to developers, we work together with the
|
|
28
|
-
community to always try to improve ReactTooltip.
|
|
29
|
-
</>
|
|
30
|
-
),
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: 'Focus on What Matters',
|
|
34
|
-
Svg: require('@site/static/img/happy-face-tooltip.svg').default,
|
|
35
|
-
description: (
|
|
36
|
-
<>
|
|
37
|
-
Don’t waste your time building a tooltip component from scratch, just use ReactTooltip
|
|
38
|
-
and focus on new features or bug fixes.
|
|
39
|
-
</>
|
|
40
|
-
),
|
|
41
|
-
},
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
function Feature({ title, Svg, description }: FeatureItem) {
|
|
45
|
-
return (
|
|
46
|
-
<div className={clsx('col col--4')}>
|
|
47
|
-
<div className="text--center">
|
|
48
|
-
<Svg className={styles.featureSvg} role="img" />
|
|
49
|
-
</div>
|
|
50
|
-
<div className="text--center padding-horiz--md">
|
|
51
|
-
<h3>{title}</h3>
|
|
52
|
-
<p>{description}</p>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default function HomepageFeatures(): JSX.Element {
|
|
59
|
-
return (
|
|
60
|
-
<section className={styles.features}>
|
|
61
|
-
<div className="container">
|
|
62
|
-
<div className="row">
|
|
63
|
-
{FeatureList.map((props, idx) => (
|
|
64
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
65
|
-
<Feature key={idx} {...props} />
|
|
66
|
-
))}
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</section>
|
|
70
|
-
)
|
|
71
|
-
}
|
package/docs/src/css/custom.css
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Any CSS included here will be global. The classic template
|
|
3
|
-
* bundles Infima by default. Infima is a CSS framework designed to
|
|
4
|
-
* work well for content-centric websites.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/* You can override the default Infima variables here. */
|
|
8
|
-
:root {
|
|
9
|
-
--ifm-color-primary: #2e8555;
|
|
10
|
-
--ifm-color-primary-dark: #29784c;
|
|
11
|
-
--ifm-color-primary-darker: #277148;
|
|
12
|
-
--ifm-color-primary-darkest: #205d3b;
|
|
13
|
-
--ifm-color-primary-light: #33925d;
|
|
14
|
-
--ifm-color-primary-lighter: #359962;
|
|
15
|
-
--ifm-color-primary-lightest: #3cad6e;
|
|
16
|
-
--ifm-code-font-size: 95%;
|
|
17
|
-
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
|
21
|
-
[data-theme='dark'] {
|
|
22
|
-
--ifm-color-primary: #25c2a0;
|
|
23
|
-
--ifm-color-primary-dark: #21af90;
|
|
24
|
-
--ifm-color-primary-darker: #1fa588;
|
|
25
|
-
--ifm-color-primary-darkest: #1a8870;
|
|
26
|
-
--ifm-color-primary-light: #29d5b0;
|
|
27
|
-
--ifm-color-primary-lighter: #32d8b4;
|
|
28
|
-
--ifm-color-primary-lightest: #4fddbf;
|
|
29
|
-
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** styling examples **/
|
|
33
|
-
.example-container .example {
|
|
34
|
-
color: #222;
|
|
35
|
-
background-color: rgb(0, 247, 255);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.example-container .example .example-arrow {
|
|
39
|
-
background-color: rgb(0, 247, 255);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.example-container .example-orange {
|
|
43
|
-
color: #222;
|
|
44
|
-
background-color: rgb(255, 153, 0);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.example-container .example-orange .example-arrow {
|
|
48
|
-
background-color: rgb(255, 153, 0);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.example-container .example-pink {
|
|
52
|
-
color: #fff;
|
|
53
|
-
background-color: rgb(255, 0, 255);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.example-container .example-pink .example-arrow {
|
|
57
|
-
background-color: rgb(255, 0, 255);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.example-container .example-no-radius {
|
|
61
|
-
border-radius: 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.example-container .example-rounded {
|
|
65
|
-
border-radius: 50%;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.example-container .example-no-padding {
|
|
69
|
-
padding: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.example-container .example-padding {
|
|
73
|
-
padding: 48px;
|
|
74
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CSS files with the .module.css suffix will be treated as CSS modules
|
|
3
|
-
* and scoped locally.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
.heroBanner {
|
|
7
|
-
padding: 4rem 0;
|
|
8
|
-
text-align: center;
|
|
9
|
-
position: relative;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@media screen and (max-width: 996px) {
|
|
14
|
-
.heroBanner {
|
|
15
|
-
padding: 2rem;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.buttons {
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
row-gap: 16px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media screen and (min-width: 768px) {
|
|
28
|
-
.buttons {
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
flex-direction: row;
|
|
33
|
-
column-gap: 16px;
|
|
34
|
-
}
|
|
35
|
-
}
|
package/docs/src/pages/index.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-unresolved */
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import clsx from 'clsx'
|
|
4
|
-
import Link from '@docusaurus/Link'
|
|
5
|
-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
|
|
6
|
-
import Layout from '@theme/Layout'
|
|
7
|
-
import HomepageFeatures from '@site/src/components/HomepageFeatures'
|
|
8
|
-
|
|
9
|
-
import styles from './index.module.css'
|
|
10
|
-
|
|
11
|
-
function HomepageHeader() {
|
|
12
|
-
const { siteConfig } = useDocusaurusContext()
|
|
13
|
-
return (
|
|
14
|
-
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
|
15
|
-
<div className="container">
|
|
16
|
-
<h1 className="hero__title">{siteConfig.title}</h1>
|
|
17
|
-
<p className="hero__logo">
|
|
18
|
-
<img src="img/logo.svg" alt="Happy face with a tooltip saying 'Hello I'm a tooltip'" />
|
|
19
|
-
</p>
|
|
20
|
-
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
|
21
|
-
<div className={styles.buttons}>
|
|
22
|
-
<Link className="button button--primary button--lg" to="/docs/category/upgrade-guide">
|
|
23
|
-
Upgrade from V4 to V5
|
|
24
|
-
</Link>
|
|
25
|
-
<Link className="button button--secondary button--lg" to="/docs/getting-started">
|
|
26
|
-
Getting Started with V5
|
|
27
|
-
</Link>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</header>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default function Home(): JSX.Element {
|
|
35
|
-
// const { siteConfig } = useDocusaurusContext()
|
|
36
|
-
return (
|
|
37
|
-
// <Layout title={`${siteConfig.title}`} description="Awesome React Tooltip component">
|
|
38
|
-
<Layout title="Welcome" description="Awesome React Tooltip component">
|
|
39
|
-
<HomepageHeader />
|
|
40
|
-
<main>
|
|
41
|
-
<HomepageFeatures />
|
|
42
|
-
</main>
|
|
43
|
-
</Layout>
|
|
44
|
-
)
|
|
45
|
-
}
|
package/docs/static/.nojekyll
DELETED
|
File without changes
|
|
Binary file
|
|
Binary file
|