@rescui/tooltip 0.10.13 → 0.11.1-RUI-293-Update-menu-component-7a032357e.20
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/css-vars-utils.d.ts +3 -3
- package/lib/index.css +24 -24
- package/lib/index.d.ts +7 -8
- package/lib/index.js +2 -2
- package/lib/tooltip.d.ts +68 -68
- package/lib/tooltip.p.module.css.js +7 -7
- package/lib/use-tooltip-state.d.ts +7 -7
- package/llm/components/tooltip.md +217 -0
- package/llm/index.md +2 -0
- package/package.json +7 -6
package/README.md
CHANGED
package/lib/css-vars-utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const extractPrimaryColors: (styles: CSSStyleDeclaration) => Record<string, string>;
|
|
2
|
-
/** Check out `@rescui/colors/src/public-api.p.css` file */
|
|
3
|
-
export declare const extractThemeFromCss: (styles: CSSStyleDeclaration) => "dark" | "light";
|
|
1
|
+
export declare const extractPrimaryColors: (styles: CSSStyleDeclaration) => Record<string, string>;
|
|
2
|
+
/** Check out `@rescui/colors/src/public-api.p.css` file */
|
|
3
|
+
export declare const extractThemeFromCss: (styles: CSSStyleDeclaration) => "dark" | "light";
|
package/lib/index.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tooltip_1p1ole3_5{
|
|
2
2
|
position:relative;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._closing_1p1ole3_9{
|
|
5
5
|
pointer-events:none;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._content_1p1ole3_13{
|
|
8
8
|
--rs-theme-dark:1;
|
|
9
9
|
--_rs-tooltip-border-width:1px;
|
|
10
10
|
|
|
@@ -73,36 +73,36 @@
|
|
|
73
73
|
color:#FFFFFF;
|
|
74
74
|
background-color:#303033;
|
|
75
75
|
|
|
76
|
-
transition:opacity 300ms, transform 300ms;
|
|
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_1p1ole3_13,
|
|
80
|
+
[data-popper-placement='bottom-end'] ._content_1p1ole3_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_1p1ole3_13,
|
|
84
|
+
[data-popper-placement='bottom-start'] ._content_1p1ole3_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_1p1ole3_13,
|
|
88
|
+
[data-popper-placement='right-end'] ._content_1p1ole3_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_1p1ole3_13,
|
|
92
|
+
[data-popper-placement='right-start'] ._content_1p1ole3_13{
|
|
93
93
|
margin-top:0;
|
|
94
94
|
}
|
|
95
|
-
.
|
|
95
|
+
._initial_1p1ole3_55 ._content_1p1ole3_13{
|
|
96
96
|
transition:none;
|
|
97
97
|
}
|
|
98
|
-
.
|
|
98
|
+
._closing_1p1ole3_9 ._content_1p1ole3_13{
|
|
99
99
|
transition-duration:200ms, 200ms;
|
|
100
100
|
}
|
|
101
|
-
.
|
|
102
|
-
.
|
|
101
|
+
._initial_1p1ole3_55 ._content_1p1ole3_13,
|
|
102
|
+
._closing_1p1ole3_9 ._content_1p1ole3_13{
|
|
103
103
|
opacity:0;
|
|
104
104
|
}
|
|
105
|
-
.
|
|
105
|
+
._outerThemeLight_1p1ole3_69 ._content_1p1ole3_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_1p1ole3_82 ._content_1p1ole3_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_1p1ole3_55[data-popper-placement^='top'] ._content_1p1ole3_13, ._closing_1p1ole3_9[data-popper-placement^='top'] ._content_1p1ole3_13{
|
|
128
128
|
transform:translate(0, 10px);
|
|
129
129
|
}
|
|
130
|
-
.
|
|
130
|
+
._initial_1p1ole3_55[data-popper-placement^='right'] ._content_1p1ole3_13, ._closing_1p1ole3_9[data-popper-placement^='right'] ._content_1p1ole3_13{
|
|
131
131
|
transform:translate(-10px, 0);
|
|
132
132
|
}
|
|
133
|
-
.
|
|
133
|
+
._initial_1p1ole3_55[data-popper-placement^='bottom'] ._content_1p1ole3_13, ._closing_1p1ole3_9[data-popper-placement^='bottom'] ._content_1p1ole3_13{
|
|
134
134
|
transform:translate(0, -10px);
|
|
135
135
|
}
|
|
136
|
-
.
|
|
136
|
+
._initial_1p1ole3_55[data-popper-placement^='left'] ._content_1p1ole3_13, ._closing_1p1ole3_9[data-popper-placement^='left'] ._content_1p1ole3_13{
|
|
137
137
|
transform:translate(10px, 0);
|
|
138
138
|
}
|
|
139
|
-
.
|
|
140
|
-
.
|
|
139
|
+
._trigger_1p1ole3_114:focus-visible,
|
|
140
|
+
._trigger_1p1ole3_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;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export {
|
|
8
|
-
export type { TooltipProps, TooltipPlacement } from './tooltip';
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use named import instead
|
|
3
|
+
*/
|
|
4
|
+
declare const DefaultTooltip: import("react").FC<import("./tooltip").TooltipProps>;
|
|
5
|
+
export default DefaultTooltip;
|
|
6
|
+
export { Tooltip } from './tooltip';
|
|
7
|
+
export type { TooltipProps, TooltipPlacement } from './tooltip';
|
package/lib/index.js
CHANGED
package/lib/tooltip.d.ts
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StrictModifiers } from '@popperjs/core/lib/types';
|
|
3
|
-
import type { Placement } from '@popperjs/core/lib/enums';
|
|
4
|
-
interface TriggerTargetRequiredProps {
|
|
5
|
-
ref: React.Ref<HTMLElement>;
|
|
6
|
-
}
|
|
7
|
-
interface TriggerTargetAdditionalProps {
|
|
8
|
-
onBlur: (...args: unknown[]) => void;
|
|
9
|
-
tabIndex: number;
|
|
10
|
-
onMouseEnter: (...args: unknown[]) => void;
|
|
11
|
-
onMouseLeave: (...args: unknown[]) => void;
|
|
12
|
-
onFocus: (...args: unknown[]) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
targetProps: TriggerTargetProps;
|
|
17
|
-
}) => React.ReactNode;
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export interface TooltipProps {
|
|
21
|
-
/**
|
|
22
|
-
* Target node or `({targetProps}) => node` function
|
|
23
|
-
* @type (arg: { targetProps: TriggerTargetProps; }) => ReactNode | ReactNode
|
|
24
|
-
*/
|
|
25
|
-
children: TooltipChildren;
|
|
26
|
-
/**
|
|
27
|
-
* Wrapper component type if children is not a function
|
|
28
|
-
*/
|
|
29
|
-
targetComponent?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Tooltip content
|
|
32
|
-
*/
|
|
33
|
-
content?: React.ReactNode;
|
|
34
|
-
className?: string;
|
|
35
|
-
/**
|
|
36
|
-
* "External" state control
|
|
37
|
-
*/
|
|
38
|
-
isVisible?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Pooper.js [modifiers](https://popper.js.org/docs/v2/modifiers/) config
|
|
41
|
-
*/
|
|
42
|
-
modifiers?: StrictModifiers[];
|
|
43
|
-
/**
|
|
44
|
-
* Please use only `auto`, `top-end`, `right`, `left`, `right-start` or `left-start` to be compliant with styleguide
|
|
45
|
-
*/
|
|
46
|
-
placement?: TooltipPlacement;
|
|
47
|
-
/**
|
|
48
|
-
* When no space is available on the preferred placement, the tooltip will test
|
|
49
|
-
* the ones provided in the list, and use the first useful one.
|
|
50
|
-
* See [docs](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements).
|
|
51
|
-
*/
|
|
52
|
-
fallbackPlacements?: Placement[];
|
|
53
|
-
/**
|
|
54
|
-
* Disable timeout before hide tooltip after mouse left target,
|
|
55
|
-
* use with cation, it can make impossible to click on links inside tooltip
|
|
56
|
-
*/
|
|
57
|
-
disableHideDelay?: boolean;
|
|
58
|
-
/** increase offset from the target */
|
|
59
|
-
sparse?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* If set to true, the tooltip will be rendered adjacent to its triggering element.
|
|
62
|
-
* If false or undefined, the tooltip will render at the end of the `document.body` element.
|
|
63
|
-
* Should be used when the tooltip content contains interactive elements (e.g. links).
|
|
64
|
-
*/
|
|
65
|
-
renderBesideTrigger?: boolean;
|
|
66
|
-
}
|
|
67
|
-
export declare const Tooltip: React.FC<TooltipProps>;
|
|
68
|
-
export default Tooltip;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StrictModifiers } from '@popperjs/core/lib/types';
|
|
3
|
+
import type { Placement } from '@popperjs/core/lib/enums';
|
|
4
|
+
interface TriggerTargetRequiredProps {
|
|
5
|
+
ref: React.Ref<HTMLElement>;
|
|
6
|
+
}
|
|
7
|
+
interface TriggerTargetAdditionalProps {
|
|
8
|
+
onBlur: (...args: unknown[]) => void;
|
|
9
|
+
tabIndex: number;
|
|
10
|
+
onMouseEnter: (...args: unknown[]) => void;
|
|
11
|
+
onMouseLeave: (...args: unknown[]) => void;
|
|
12
|
+
onFocus: (...args: unknown[]) => void;
|
|
13
|
+
}
|
|
14
|
+
type TriggerTargetProps = TriggerTargetRequiredProps | (TriggerTargetRequiredProps & TriggerTargetAdditionalProps);
|
|
15
|
+
type ChildrenFunc = (arg: {
|
|
16
|
+
targetProps: TriggerTargetProps;
|
|
17
|
+
}) => React.ReactNode;
|
|
18
|
+
export type TooltipChildren = ChildrenFunc | React.ReactNode;
|
|
19
|
+
export type TooltipPlacement = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
|
20
|
+
export interface TooltipProps {
|
|
21
|
+
/**
|
|
22
|
+
* Target node or `({targetProps}) => node` function
|
|
23
|
+
* @type (arg: { targetProps: TriggerTargetProps; }) => ReactNode | ReactNode
|
|
24
|
+
*/
|
|
25
|
+
children: TooltipChildren;
|
|
26
|
+
/**
|
|
27
|
+
* Wrapper component type if children is not a function
|
|
28
|
+
*/
|
|
29
|
+
targetComponent?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Tooltip content
|
|
32
|
+
*/
|
|
33
|
+
content?: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* "External" state control
|
|
37
|
+
*/
|
|
38
|
+
isVisible?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Pooper.js [modifiers](https://popper.js.org/docs/v2/modifiers/) config
|
|
41
|
+
*/
|
|
42
|
+
modifiers?: StrictModifiers[];
|
|
43
|
+
/**
|
|
44
|
+
* Please use only `auto`, `top-end`, `right`, `left`, `right-start` or `left-start` to be compliant with styleguide
|
|
45
|
+
*/
|
|
46
|
+
placement?: TooltipPlacement;
|
|
47
|
+
/**
|
|
48
|
+
* When no space is available on the preferred placement, the tooltip will test
|
|
49
|
+
* the ones provided in the list, and use the first useful one.
|
|
50
|
+
* See [docs](https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements).
|
|
51
|
+
*/
|
|
52
|
+
fallbackPlacements?: Placement[];
|
|
53
|
+
/**
|
|
54
|
+
* Disable timeout before hide tooltip after mouse left target,
|
|
55
|
+
* use with cation, it can make impossible to click on links inside tooltip
|
|
56
|
+
*/
|
|
57
|
+
disableHideDelay?: boolean;
|
|
58
|
+
/** increase offset from the target */
|
|
59
|
+
sparse?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* If set to true, the tooltip will be rendered adjacent to its triggering element.
|
|
62
|
+
* If false or undefined, the tooltip will render at the end of the `document.body` element.
|
|
63
|
+
* Should be used when the tooltip content contains interactive elements (e.g. links).
|
|
64
|
+
*/
|
|
65
|
+
renderBesideTrigger?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
68
|
+
export default Tooltip;
|
|
@@ -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_1p1ole3_5",
|
|
3
|
+
"closing": "_closing_1p1ole3_9",
|
|
4
|
+
"content": "_content_1p1ole3_13",
|
|
5
|
+
"initial": "_initial_1p1ole3_55",
|
|
6
|
+
"outerThemeLight": "_outerThemeLight_1p1ole3_69",
|
|
7
|
+
"outerThemeDark": "_outerThemeDark_1p1ole3_82",
|
|
8
|
+
"trigger": "_trigger_1p1ole3_114"
|
|
9
9
|
};
|
|
10
10
|
export { styles as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare enum TOOLTIP_STATES {
|
|
2
|
-
OPENING = "OPENING",
|
|
3
|
-
OPEN = "OPEN",
|
|
4
|
-
CLOSING = "CLOSING",
|
|
5
|
-
CLOSE = "CLOSE"
|
|
6
|
-
}
|
|
7
|
-
export declare function useTooltipState(isOpen: boolean): [() => void, TOOLTIP_STATES];
|
|
1
|
+
export declare enum TOOLTIP_STATES {
|
|
2
|
+
OPENING = "OPENING",
|
|
3
|
+
OPEN = "OPEN",
|
|
4
|
+
CLOSING = "CLOSING",
|
|
5
|
+
CLOSE = "CLOSE"
|
|
6
|
+
}
|
|
7
|
+
export declare function useTooltipState(isOpen: boolean): [() => void, TOOLTIP_STATES];
|
|
@@ -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.
|
|
3
|
+
"version": "0.11.1-RUI-293-Update-menu-component-7a032357e.20+7a032357e",
|
|
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": "
|
|
31
|
-
"@rescui/icons": "
|
|
32
|
-
"@rescui/scripts": "
|
|
33
|
-
"@rescui/typography": "
|
|
31
|
+
"@rescui/colors": "0.3.1-RUI-293-Update-menu-component-7a032357e.55+7a032357e",
|
|
32
|
+
"@rescui/icons": "1.7.7-RUI-293-Update-menu-component-7a032357e.20+7a032357e",
|
|
33
|
+
"@rescui/scripts": "0.5.2",
|
|
34
|
+
"@rescui/typography": "0.27.1-RUI-293-Update-menu-component-7a032357e.20+7a032357e"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "rescui-scripts build"
|
|
37
38
|
},
|
|
38
39
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "7a032357e8f31abbf69e18aa6b7ef2d75e40f42e"
|
|
40
41
|
}
|