@xsolla/xui-tooltip 0.95.0 → 0.97.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 +36 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @xsolla/xui-tooltip
|
|
2
|
+
|
|
3
|
+
Hover- and focus-triggered informational overlay with configurable placement and delay.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-tooltip
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Tooltip } from '@xsolla/xui-tooltip';
|
|
15
|
+
import { Button } from '@xsolla/xui-button';
|
|
16
|
+
|
|
17
|
+
const Example = () => (
|
|
18
|
+
<Tooltip content="Delete this item" placement="top">
|
|
19
|
+
<Button>Delete</Button>
|
|
20
|
+
</Tooltip>
|
|
21
|
+
);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
### Tooltip
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
|------|------|---------|-------------|
|
|
30
|
+
| `content` | `ReactNode` | — | Content shown inside the tooltip |
|
|
31
|
+
| `placement` | `"top" \| "top-left" \| "top-right" \| "bottom" \| "bottom-left" \| "bottom-right" \| "left" \| "right"` | `"top"` | Position relative to the trigger |
|
|
32
|
+
| `size` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` | Tooltip size |
|
|
33
|
+
| `offset` | `number` | `12` | Gap between tooltip and trigger (px) |
|
|
34
|
+
| `delayEnter` | `number` | — | Show delay in ms |
|
|
35
|
+
| `delayLeave` | `number` | — | Hide delay in ms |
|
|
36
|
+
| `controlledVisible` | `boolean` | — | Externally control visibility |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-tooltip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-button": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-button": "0.97.0",
|
|
17
|
+
"@xsolla/xui-core": "0.97.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0",
|