@rescui/tooltip 0.11.2 → 0.11.3
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 +3 -1
- package/lib/index.css +23 -23
- package/lib/tooltip.p.module.css.js +7 -7
- package/llm/components/tooltip.md +217 -0
- package/llm/index.md +2 -0
- package/package.json +6 -5
package/README.md
CHANGED
package/lib/index.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tooltip_meg4vg_5{
|
|
2
2
|
position:relative;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._closing_meg4vg_9{
|
|
5
5
|
pointer-events:none;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._content_meg4vg_13{
|
|
8
8
|
--rs-theme-dark:1;
|
|
9
9
|
--_rs-tooltip-border-width:1px;
|
|
10
10
|
|
|
@@ -76,33 +76,33 @@
|
|
|
76
76
|
transition:opacity 300ms var(--rs-transition-function, ease), transform 300ms var(--rs-transition-function, ease);
|
|
77
77
|
transform:translate(0, 0);
|
|
78
78
|
}
|
|
79
|
-
[data-popper-placement='top-end'] .
|
|
80
|
-
[data-popper-placement='bottom-end'] .
|
|
79
|
+
[data-popper-placement='top-end'] ._content_meg4vg_13,
|
|
80
|
+
[data-popper-placement='bottom-end'] ._content_meg4vg_13{
|
|
81
81
|
margin-right:0;
|
|
82
82
|
}
|
|
83
|
-
[data-popper-placement='top-start'] .
|
|
84
|
-
[data-popper-placement='bottom-start'] .
|
|
83
|
+
[data-popper-placement='top-start'] ._content_meg4vg_13,
|
|
84
|
+
[data-popper-placement='bottom-start'] ._content_meg4vg_13{
|
|
85
85
|
margin-left:0;
|
|
86
86
|
}
|
|
87
|
-
[data-popper-placement='left-end'] .
|
|
88
|
-
[data-popper-placement='right-end'] .
|
|
87
|
+
[data-popper-placement='left-end'] ._content_meg4vg_13,
|
|
88
|
+
[data-popper-placement='right-end'] ._content_meg4vg_13{
|
|
89
89
|
margin-bottom:0;
|
|
90
90
|
}
|
|
91
|
-
[data-popper-placement='left-start'] .
|
|
92
|
-
[data-popper-placement='right-start'] .
|
|
91
|
+
[data-popper-placement='left-start'] ._content_meg4vg_13,
|
|
92
|
+
[data-popper-placement='right-start'] ._content_meg4vg_13{
|
|
93
93
|
margin-top:0;
|
|
94
94
|
}
|
|
95
|
-
.
|
|
95
|
+
._initial_meg4vg_55 ._content_meg4vg_13{
|
|
96
96
|
transition:none;
|
|
97
97
|
}
|
|
98
|
-
.
|
|
98
|
+
._closing_meg4vg_9 ._content_meg4vg_13{
|
|
99
99
|
transition-duration:200ms, 200ms;
|
|
100
100
|
}
|
|
101
|
-
.
|
|
102
|
-
.
|
|
101
|
+
._initial_meg4vg_55 ._content_meg4vg_13,
|
|
102
|
+
._closing_meg4vg_9 ._content_meg4vg_13{
|
|
103
103
|
opacity:0;
|
|
104
104
|
}
|
|
105
|
-
.
|
|
105
|
+
._outerThemeLight_meg4vg_69 ._content_meg4vg_13{
|
|
106
106
|
--rs-color-primary-dark-theme:var(--rs-color-primary-light-theme);
|
|
107
107
|
--rs-color-primary-dim-dark-theme:var(--rs-color-primary-dim-light-theme);
|
|
108
108
|
--rs-color-primary-fog-dark-theme:var(--rs-color-primary-fog-light-theme);
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
--rs-color-primary-t-fog-light-theme
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
.
|
|
116
|
+
._outerThemeDark_meg4vg_82 ._content_meg4vg_13{
|
|
117
117
|
--rs-color-primary-light-theme:var(--rs-color-primary-dark-theme);
|
|
118
118
|
--rs-color-primary-dim-light-theme:var(--rs-color-primary-dim-dark-theme);
|
|
119
119
|
--rs-color-primary-fog-light-theme:var(--rs-color-primary-fog-dark-theme);
|
|
@@ -124,20 +124,20 @@
|
|
|
124
124
|
--rs-color-primary-t-fog-dark-theme
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
|
-
.
|
|
127
|
+
._initial_meg4vg_55[data-popper-placement^='top'] ._content_meg4vg_13, ._closing_meg4vg_9[data-popper-placement^='top'] ._content_meg4vg_13{
|
|
128
128
|
transform:translate(0, 10px);
|
|
129
129
|
}
|
|
130
|
-
.
|
|
130
|
+
._initial_meg4vg_55[data-popper-placement^='right'] ._content_meg4vg_13, ._closing_meg4vg_9[data-popper-placement^='right'] ._content_meg4vg_13{
|
|
131
131
|
transform:translate(-10px, 0);
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
._initial_meg4vg_55[data-popper-placement^='bottom'] ._content_meg4vg_13, ._closing_meg4vg_9[data-popper-placement^='bottom'] ._content_meg4vg_13{
|
|
134
134
|
transform:translate(0, -10px);
|
|
135
135
|
}
|
|
136
|
-
.
|
|
136
|
+
._initial_meg4vg_55[data-popper-placement^='left'] ._content_meg4vg_13, ._closing_meg4vg_9[data-popper-placement^='left'] ._content_meg4vg_13{
|
|
137
137
|
transform:translate(10px, 0);
|
|
138
138
|
}
|
|
139
|
-
.
|
|
140
|
-
.
|
|
139
|
+
._trigger_meg4vg_114:focus-visible,
|
|
140
|
+
._trigger_meg4vg_114:focus[data-focus-method='key']{
|
|
141
141
|
outline:none;
|
|
142
142
|
|
|
143
143
|
box-shadow:var(--rs-color-primary-t-dim-light-theme) 0 0 0 4px;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"tooltip": "
|
|
3
|
-
"closing": "
|
|
4
|
-
"content": "
|
|
5
|
-
"initial": "
|
|
6
|
-
"outerThemeLight": "
|
|
7
|
-
"outerThemeDark": "
|
|
8
|
-
"trigger": "
|
|
2
|
+
"tooltip": "_tooltip_meg4vg_5",
|
|
3
|
+
"closing": "_closing_meg4vg_9",
|
|
4
|
+
"content": "_content_meg4vg_13",
|
|
5
|
+
"initial": "_initial_meg4vg_55",
|
|
6
|
+
"outerThemeLight": "_outerThemeLight_meg4vg_69",
|
|
7
|
+
"outerThemeDark": "_outerThemeDark_meg4vg_82",
|
|
8
|
+
"trigger": "_trigger_meg4vg_114"
|
|
9
9
|
};
|
|
10
10
|
export { styles as default };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Tooltips display informative text when users hover over, focus on, or click an element.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
#### Simple
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
11
|
+
|
|
12
|
+
<Tooltip content="Simple text">Tooltip will appear on mouseIn</Tooltip>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### With Icon
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
19
|
+
import { InfoIcon } from '@rescui/icons';
|
|
20
|
+
|
|
21
|
+
<Tooltip
|
|
22
|
+
sparse={false}
|
|
23
|
+
placement="right-start"
|
|
24
|
+
content="Based on an average of 260 working days per calendar year."
|
|
25
|
+
>
|
|
26
|
+
<InfoIcon theme="light" />
|
|
27
|
+
</Tooltip>;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Controlled
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
34
|
+
import { useState } from 'react';
|
|
35
|
+
import { Checkbox } from '@rescui/checkbox';
|
|
36
|
+
|
|
37
|
+
const MyTooltip = () => {
|
|
38
|
+
const [checked, setChecked] = useState(false);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Tooltip
|
|
42
|
+
sparse={false}
|
|
43
|
+
isVisible={checked}
|
|
44
|
+
placement="top-start"
|
|
45
|
+
content="Thank you!"
|
|
46
|
+
>
|
|
47
|
+
<div>
|
|
48
|
+
<Checkbox
|
|
49
|
+
checked={checked}
|
|
50
|
+
onChange={e => setChecked(e.target.checked)}
|
|
51
|
+
>
|
|
52
|
+
Please check me
|
|
53
|
+
</Checkbox>
|
|
54
|
+
</div>
|
|
55
|
+
</Tooltip>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
render(<MyTooltip />);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### With links inside
|
|
63
|
+
|
|
64
|
+
Use `renderBesideTrigger` property to allow tab-focusing on the content inside tooltip.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
68
|
+
import { textCn } from '@rescui/typography';
|
|
69
|
+
|
|
70
|
+
<Tooltip
|
|
71
|
+
placement="bottom"
|
|
72
|
+
renderBesideTrigger
|
|
73
|
+
content={
|
|
74
|
+
<span>
|
|
75
|
+
Content with a{' '}
|
|
76
|
+
<a className={textCn('rs-link')} href="">
|
|
77
|
+
link
|
|
78
|
+
</a>{' '}
|
|
79
|
+
and a second{' '}
|
|
80
|
+
<a className={textCn('rs-link')} href="">
|
|
81
|
+
link
|
|
82
|
+
</a>
|
|
83
|
+
</span>
|
|
84
|
+
}
|
|
85
|
+
>
|
|
86
|
+
<span>Tooltip with link will appear on mouseIn</span>
|
|
87
|
+
</Tooltip>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
92
|
+
import { textCn } from '@rescui/typography';
|
|
93
|
+
|
|
94
|
+
<Tooltip
|
|
95
|
+
renderBesideTrigger
|
|
96
|
+
content={
|
|
97
|
+
<span>
|
|
98
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ultrices
|
|
99
|
+
ullamcorper placerat. Etiam tincidunt ornare est, in convallis nibh
|
|
100
|
+
laoreet ut.{' '}
|
|
101
|
+
<a className={textCn('rs-link')} href="">
|
|
102
|
+
Quisque id feugiat tortor.
|
|
103
|
+
</a>{' '}
|
|
104
|
+
Maecenas nisl nibh, rutrum laoreet consectetur fermentum, imperdiet quis
|
|
105
|
+
lacus. Maecenas a tristique purus. Duis porta felis nisl, ut eleifend nibh
|
|
106
|
+
ultricies sed. Pellentesque habitant morbi tristique senectus et netus et
|
|
107
|
+
malesuada fames ac turpis egestas. Donec vitae pellentesque augue.
|
|
108
|
+
</span>
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
<span>Tooltip with long text will appear on mouseIn</span>
|
|
112
|
+
</Tooltip>;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Showing tooltip on click
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
import { useState } from 'react';
|
|
119
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
120
|
+
|
|
121
|
+
const MyTooltip = () => {
|
|
122
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<Tooltip content="Simple text" isVisible={isOpen}>
|
|
126
|
+
<span onClick={() => setIsOpen(val => !val)}>
|
|
127
|
+
Tooltip will appear and disappear on click
|
|
128
|
+
</span>
|
|
129
|
+
</Tooltip>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
render(<MyTooltip />);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### Tooltip with dark background
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { Tooltip } from '@rescui/tooltip';
|
|
140
|
+
import { InfoIcon } from '@rescui/icons';
|
|
141
|
+
import { textCn } from '@rescui/typography';
|
|
142
|
+
|
|
143
|
+
<div className="dark-tile" style={{ maxWidth: 400 }}>
|
|
144
|
+
<h3 className={textCn('rs-h3')}>The drive to develop</h3>
|
|
145
|
+
<p className={textCn('rs-text-2')} style={{ marginTop: 24 }}>
|
|
146
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam atque
|
|
147
|
+
commodi cumque delectus, distinctio dolorum esse et id illo in incidunt ipsa
|
|
148
|
+
minus necessitatibus officia reiciendis reprehenderit, sed sint. Suscipit!
|
|
149
|
+
</p>
|
|
150
|
+
|
|
151
|
+
<Tooltip
|
|
152
|
+
renderBesideTrigger
|
|
153
|
+
placement="top"
|
|
154
|
+
content={
|
|
155
|
+
<span>
|
|
156
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ultrices
|
|
157
|
+
ullamcorper placerat. Etiam tincidunt ornare est, in convallis nibh
|
|
158
|
+
laoreet ut.{' '}
|
|
159
|
+
<a className={textCn('rs-link')} href="">
|
|
160
|
+
Quisque id feugiat tortor.
|
|
161
|
+
</a>{' '}
|
|
162
|
+
Maecenas nisl nibh, rutrum laoreet consectetur fermentum, imperdiet quis
|
|
163
|
+
lacus.
|
|
164
|
+
</span>
|
|
165
|
+
}
|
|
166
|
+
>
|
|
167
|
+
<InfoIcon theme="dark" style={{ marginTop: 16 }} />
|
|
168
|
+
</Tooltip>
|
|
169
|
+
</div>;
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```postcss
|
|
173
|
+
.dark-tile {
|
|
174
|
+
--dark-tile-border-width: 1px;
|
|
175
|
+
--rs-theme-dark: 1;
|
|
176
|
+
|
|
177
|
+
position: relative;
|
|
178
|
+
|
|
179
|
+
display: block;
|
|
180
|
+
|
|
181
|
+
box-sizing: border-box;
|
|
182
|
+
min-height: 0;
|
|
183
|
+
|
|
184
|
+
border: var(--dark-tile-border-width) solid var(--rs-color-white-t20);
|
|
185
|
+
border-radius: 8px;
|
|
186
|
+
|
|
187
|
+
background-color: var(--rs-color-grey-90);
|
|
188
|
+
|
|
189
|
+
padding: calc(24px - var(--dark-tile-border-width));
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### Different placements
|
|
194
|
+
|
|
195
|
+
bottom-start
|
|
196
|
+
|
|
197
|
+
bottom
|
|
198
|
+
|
|
199
|
+
bottom-end
|
|
200
|
+
|
|
201
|
+
right-start
|
|
202
|
+
|
|
203
|
+
right
|
|
204
|
+
|
|
205
|
+
right-end
|
|
206
|
+
|
|
207
|
+
left-start
|
|
208
|
+
|
|
209
|
+
left
|
|
210
|
+
|
|
211
|
+
left-end
|
|
212
|
+
|
|
213
|
+
top-start
|
|
214
|
+
|
|
215
|
+
top
|
|
216
|
+
|
|
217
|
+
top-end
|
package/llm/index.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/tooltip",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"src:main": "src/index.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"lib",
|
|
12
|
+
"llm",
|
|
12
13
|
"LICENSE.txt"
|
|
13
14
|
],
|
|
14
15
|
"publishConfig": {
|
|
@@ -27,14 +28,14 @@
|
|
|
27
28
|
"react-dom": ">=16.8.0 <20"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@rescui/colors": "^0.3.
|
|
31
|
-
"@rescui/icons": "^1.8.
|
|
31
|
+
"@rescui/colors": "^0.3.2",
|
|
32
|
+
"@rescui/icons": "^1.8.2",
|
|
32
33
|
"@rescui/scripts": "^0.5.2",
|
|
33
|
-
"@rescui/typography": "^0.27.
|
|
34
|
+
"@rescui/typography": "^0.27.2"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "rescui-scripts build"
|
|
37
38
|
},
|
|
38
39
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "d60e4f3491c7cdb9ef684d08940869914492a61b"
|
|
40
41
|
}
|