@farm-investimentos/front-mfe-components-vue3 1.3.0 → 1.4.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/dist/front-mfe-components.common.js +388 -1109
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +388 -1109
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Tooltip/Tooltip.scss +195 -22
- package/src/components/Tooltip/Tooltip.stories.js +264 -80
- package/src/components/Tooltip/Tooltip.vue +407 -122
- package/src/components/Tooltip/__tests__/Tooltip.spec.js +192 -9
- package/src/components/Tooltip/docs/Tooltip.md +287 -0
- package/src/components/Tooltip/index.ts +17 -2
- package/src/components/Tooltip/types.ts +51 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm-investimentos/front-mfe-components-vue3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"webpack": "5.94.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "7.
|
|
46
|
-
"@babel/generator": "7.
|
|
45
|
+
"@babel/core": "^7.22.0",
|
|
46
|
+
"@babel/generator": "^7.22.0",
|
|
47
47
|
"@farm-investimentos/front-mfe-libs-ts": "3.0.5",
|
|
48
48
|
"@storybook/addon-essentials": "^8.2.9",
|
|
49
49
|
"@storybook/addon-interactions": "^8.2.9",
|
|
@@ -1,41 +1,214 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* CSS simplificado para Tooltip - Abordagem simples e direta
|
|
3
|
+
* SEMPRE usa position: fixed via JavaScript
|
|
4
|
+
*/
|
|
3
5
|
|
|
6
|
+
/* Container principal */
|
|
7
|
+
.tooltip-container {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
position: relative;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Activator */
|
|
13
|
+
.tooltip-activator {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* COMPATIBILIDADE: Classes antigas mantidas para outros componentes
|
|
19
|
+
* que fazem @extend .farm-tooltip__popup
|
|
20
|
+
*/
|
|
4
21
|
.farm-tooltip {
|
|
5
22
|
display: inline-block;
|
|
6
23
|
position: relative;
|
|
24
|
+
}
|
|
7
25
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
26
|
+
.farm-tooltip__activator {
|
|
27
|
+
display: inline-block;
|
|
11
28
|
}
|
|
12
29
|
|
|
13
30
|
.farm-tooltip__popup {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
/* Estilos base mantidos para compatibilidade */
|
|
32
|
+
background-color: #333333;
|
|
33
|
+
color: #f5f5f5;
|
|
34
|
+
border-radius: 5px;
|
|
35
|
+
font-family: 'Manrope', sans-serif;
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
padding: 16px;
|
|
39
|
+
position: fixed;
|
|
40
|
+
z-index: 10001;
|
|
41
|
+
transform: translateZ(0);
|
|
42
|
+
pointer-events: auto;
|
|
43
|
+
|
|
44
|
+
/* Estados */
|
|
45
|
+
opacity: 0;
|
|
46
|
+
visibility: hidden;
|
|
47
|
+
transition: opacity 0.3s linear, visibility 0.3s linear;
|
|
48
|
+
|
|
49
|
+
/* Variantes */
|
|
50
|
+
&--visible {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
visibility: visible;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--fluid {
|
|
56
|
+
width: auto;
|
|
57
|
+
max-width: 300px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Header */
|
|
61
|
+
.farm-tooltip__header {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
align-items: center;
|
|
65
|
+
margin-bottom: 8px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.farm-tooltip__title {
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
margin-right: 16px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.farm-tooltip__content {
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.farm-tooltip__close {
|
|
79
|
+
width: 16px;
|
|
80
|
+
height: 16px;
|
|
81
|
+
line-height: 16px;
|
|
82
|
+
text-align: center;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
color: #f5f5f5;
|
|
19
86
|
}
|
|
20
87
|
}
|
|
21
88
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
position: absolute;
|
|
27
|
-
width: 160px;
|
|
28
|
-
contain: content;
|
|
29
|
-
color: white;
|
|
89
|
+
/* Estilos globais para tooltip criado dinamicamente */
|
|
90
|
+
.tooltip-popup {
|
|
91
|
+
background-color: #333333;
|
|
92
|
+
color: #f5f5f5;
|
|
30
93
|
border-radius: 5px;
|
|
31
|
-
font-family: 'Manrope', sans-serif
|
|
94
|
+
font-family: 'Manrope', sans-serif;
|
|
32
95
|
font-size: 12px;
|
|
33
|
-
font-weight:
|
|
34
|
-
padding:
|
|
35
|
-
|
|
96
|
+
font-weight: 500;
|
|
97
|
+
padding: 16px;
|
|
98
|
+
position: fixed;
|
|
99
|
+
z-index: 10001;
|
|
100
|
+
transform: translateZ(0);
|
|
101
|
+
pointer-events: auto;
|
|
102
|
+
|
|
103
|
+
/* Estados */
|
|
104
|
+
opacity: 0;
|
|
105
|
+
visibility: hidden;
|
|
106
|
+
transition: opacity 0.3s linear, visibility 0.3s linear;
|
|
36
107
|
|
|
37
108
|
&--visible {
|
|
38
109
|
opacity: 1;
|
|
39
110
|
visibility: visible;
|
|
40
111
|
}
|
|
112
|
+
|
|
113
|
+
/* Variantes */
|
|
114
|
+
&--dark {
|
|
115
|
+
background-color: #333333;
|
|
116
|
+
color: #f5f5f5;
|
|
117
|
+
|
|
118
|
+
.tooltip-arrow {
|
|
119
|
+
border-color: #333333 transparent transparent transparent !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.tooltip-popup--bottom-left,
|
|
123
|
+
&.tooltip-popup--bottom-center,
|
|
124
|
+
&.tooltip-popup--bottom-right {
|
|
125
|
+
.tooltip-arrow {
|
|
126
|
+
border-color: transparent transparent #333333 transparent !important;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--light {
|
|
132
|
+
background-color: #ffffff;
|
|
133
|
+
color: #333333;
|
|
134
|
+
border: 1px solid #e0e0e0;
|
|
135
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
136
|
+
|
|
137
|
+
.tooltip-arrow {
|
|
138
|
+
border-color: #ffffff transparent transparent transparent !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&.tooltip-popup--bottom-left,
|
|
142
|
+
&.tooltip-popup--bottom-center,
|
|
143
|
+
&.tooltip-popup--bottom-right {
|
|
144
|
+
.tooltip-arrow {
|
|
145
|
+
border-color: transparent transparent #ffffff transparent !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Tamanhos */
|
|
151
|
+
&--sm {
|
|
152
|
+
font-size: 11px;
|
|
153
|
+
padding: 12px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&--md {
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
padding: 16px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&--lg {
|
|
162
|
+
font-size: 14px;
|
|
163
|
+
padding: 20px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Header */
|
|
167
|
+
.tooltip-header {
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: space-between;
|
|
170
|
+
align-items: center;
|
|
171
|
+
margin-bottom: 8px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.tooltip-title {
|
|
175
|
+
font-weight: 600;
|
|
176
|
+
font-size: 13px;
|
|
177
|
+
margin-right: 16px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.tooltip-content {
|
|
181
|
+
font-weight: 500;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.tooltip-close {
|
|
185
|
+
width: 16px;
|
|
186
|
+
height: 16px;
|
|
187
|
+
line-height: 16px;
|
|
188
|
+
text-align: center;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
font-size: 16px;
|
|
191
|
+
color: inherit;
|
|
192
|
+
transition: opacity 0.2s ease;
|
|
193
|
+
|
|
194
|
+
&:hover {
|
|
195
|
+
opacity: 0.7;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.tooltip-arrow {
|
|
200
|
+
position: absolute;
|
|
201
|
+
width: 0;
|
|
202
|
+
height: 0;
|
|
203
|
+
border-style: solid;
|
|
204
|
+
z-index: inherit;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Posicionamento específico */
|
|
209
|
+
&--has-title {
|
|
210
|
+
.tooltip-content {
|
|
211
|
+
margin-top: 4px;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
41
214
|
}
|
|
@@ -1,98 +1,282 @@
|
|
|
1
|
-
|
|
2
|
-
import baseThemeColors from '../../configurations/_theme-colors-base.module.scss';
|
|
3
|
-
const colors = Object.keys(baseThemeColors);
|
|
1
|
+
import Tooltip from './Tooltip.vue';
|
|
4
2
|
|
|
5
3
|
export default {
|
|
6
|
-
title: '
|
|
7
|
-
|
|
4
|
+
title: 'Display/Tooltip',
|
|
5
|
+
component: Tooltip,
|
|
8
6
|
parameters: {
|
|
9
7
|
docs: {
|
|
10
8
|
description: {
|
|
11
9
|
component: `Tooltip<br />
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
selector: <em>Tooltip</em><br />
|
|
11
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
12
|
+
`,
|
|
15
13
|
},
|
|
16
14
|
},
|
|
17
|
-
design: {
|
|
18
|
-
type: 'figma',
|
|
19
|
-
url: 'https://www.figma.com/file/p62YDSTfWg0Mcnf5APfdvI/%E2%9C%8D-Design-System-%7C-v2?node-id=3779%3A6131',
|
|
20
|
-
},
|
|
21
15
|
viewMode: 'docs',
|
|
22
16
|
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
placement: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: [
|
|
21
|
+
'top-left',
|
|
22
|
+
'top-center',
|
|
23
|
+
'top-right',
|
|
24
|
+
'bottom-left',
|
|
25
|
+
'bottom-center',
|
|
26
|
+
'bottom-right',
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
variant: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: ['dark'],
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: 'select',
|
|
35
|
+
options: ['sm', 'md', 'lg'],
|
|
36
|
+
},
|
|
37
|
+
trigger: {
|
|
38
|
+
control: 'select',
|
|
39
|
+
options: ['hover', 'click', 'manual'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
23
42
|
};
|
|
24
43
|
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
:color="color"
|
|
36
|
-
style="margin-right: 4px"
|
|
37
|
-
>
|
|
38
|
-
<span>
|
|
39
|
-
this is the tooltip for {{ color }}
|
|
40
|
-
</span>
|
|
41
|
-
<template v-slot:activator="{ on, attrs }">
|
|
42
|
-
<farm-bodytext :color="color">{{ color }}</farm-bodytext>
|
|
44
|
+
export const Primary = {
|
|
45
|
+
render: () => ({
|
|
46
|
+
components: { Tooltip },
|
|
47
|
+
template: `
|
|
48
|
+
<div style="padding-left: 80px; padding-top: 80px;">
|
|
49
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
50
|
+
<span>Hover over the icon</span>
|
|
51
|
+
<Tooltip placement="top-center">
|
|
52
|
+
<template #activator>
|
|
53
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: #666; color: white; border-radius: 50%; font-size: 10px; cursor: help;">?</span>
|
|
43
54
|
</template>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
This is a simple tooltip
|
|
56
|
+
</Tooltip>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
`,
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const AllPositions = {
|
|
64
|
+
render: () => ({
|
|
65
|
+
components: { Tooltip },
|
|
66
|
+
template: `
|
|
67
|
+
<div style="padding: 100px; display: flex; flex-direction: column; align-items: center; gap: 50px;">
|
|
68
|
+
<div style="display: flex; gap: 30px; margin-bottom: 50px;">
|
|
69
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
70
|
+
<p style="margin-bottom: 10px;">Top Left</p>
|
|
71
|
+
<Tooltip placement="top-left">
|
|
72
|
+
<template #activator>
|
|
73
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
74
|
+
</template>
|
|
75
|
+
Top-Left Position
|
|
76
|
+
</Tooltip>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
80
|
+
<p style="margin-bottom: 10px;">Top Center</p>
|
|
81
|
+
<Tooltip placement="top-center">
|
|
82
|
+
<template #activator>
|
|
83
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
84
|
+
</template>
|
|
85
|
+
Top-Center Position (Default)
|
|
86
|
+
</Tooltip>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
90
|
+
<p style="margin-bottom: 10px;">Top Right</p>
|
|
91
|
+
<Tooltip placement="top-right">
|
|
92
|
+
<template #activator>
|
|
93
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
94
|
+
</template>
|
|
95
|
+
Top-Right Position
|
|
96
|
+
</Tooltip>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div style="display: flex; gap: 30px;">
|
|
101
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
102
|
+
<p style="margin-bottom: 10px;">Bottom Left</p>
|
|
103
|
+
<Tooltip placement="bottom-left">
|
|
104
|
+
<template #activator>
|
|
105
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
106
|
+
</template>
|
|
107
|
+
Bottom-Left Position
|
|
108
|
+
</Tooltip>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
112
|
+
<p style="margin-bottom: 10px;">Bottom Center</p>
|
|
113
|
+
<Tooltip placement="bottom-center">
|
|
114
|
+
<template #activator>
|
|
115
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
116
|
+
</template>
|
|
117
|
+
Bottom-Center Position
|
|
118
|
+
</Tooltip>
|
|
119
|
+
</div>
|
|
47
120
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
121
|
+
<div style="display: flex; flex-direction: column; align-items: center;">
|
|
122
|
+
<p style="margin-bottom: 10px;">Bottom Right</p>
|
|
123
|
+
<Tooltip placement="bottom-right">
|
|
124
|
+
<template #activator>
|
|
125
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
126
|
+
</template>
|
|
127
|
+
Bottom-Right Position
|
|
128
|
+
</Tooltip>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
}),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const ControlledTooltip = {
|
|
137
|
+
render: () => ({
|
|
138
|
+
components: { Tooltip },
|
|
139
|
+
data() {
|
|
140
|
+
return {
|
|
141
|
+
showTooltip: false,
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
template: `
|
|
145
|
+
<div style="padding: 80px;">
|
|
146
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
147
|
+
<span>Click to open:</span>
|
|
148
|
+
<Tooltip v-model="showTooltip" placement="top-right">
|
|
149
|
+
<template #activator>
|
|
150
|
+
<span
|
|
151
|
+
@click="showTooltip = !showTooltip"
|
|
152
|
+
style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #007bff; color: white; border-radius: 50%; font-size: 11px; cursor: pointer;"
|
|
153
|
+
>?</span>
|
|
56
154
|
</template>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
155
|
+
<template #title>Controlled Tooltip</template>
|
|
156
|
+
This tooltip is controlled by v-model
|
|
157
|
+
</Tooltip>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
`,
|
|
161
|
+
}),
|
|
162
|
+
};
|
|
60
163
|
|
|
61
|
-
export const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
some <em>sample</em> text<br />
|
|
72
|
-
some <em>sample</em> text<br />
|
|
73
|
-
some <em>sample</em> text<br />
|
|
74
|
-
some <em>sample</em> text<br />
|
|
75
|
-
some <em>sample</em> text<br />
|
|
76
|
-
some <em>sample</em> text<br />
|
|
77
|
-
some <em>sample</em> text<br />
|
|
78
|
-
<template v-slot:activator="{ on, attrs }">
|
|
79
|
-
<farm-btn @click="show = !show">
|
|
80
|
-
toggle me
|
|
81
|
-
</farm-btn>
|
|
164
|
+
export const FluidTooltip = {
|
|
165
|
+
render: () => ({
|
|
166
|
+
components: { Tooltip },
|
|
167
|
+
template: `
|
|
168
|
+
<div style="padding-left: 80px; padding-top: 80px;">
|
|
169
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
170
|
+
<span>Fluid width tooltip</span>
|
|
171
|
+
<Tooltip placement="top-center" :fluid="true">
|
|
172
|
+
<template #activator>
|
|
173
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: #666; color: white; border-radius: 50%; font-size: 10px; cursor: help;">?</span>
|
|
82
174
|
</template>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
175
|
+
This is a fluid tooltip that will grow based on its content.
|
|
176
|
+
It contains a longer text to demonstrate how it expands horizontally.
|
|
177
|
+
</Tooltip>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
`,
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
|
|
86
184
|
|
|
87
|
-
export const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
185
|
+
export const Sizes = {
|
|
186
|
+
render: () => ({
|
|
187
|
+
components: { Tooltip },
|
|
188
|
+
template: `
|
|
189
|
+
<div style="padding: 80px;">
|
|
190
|
+
<div style="display: flex; gap: 30px; align-items: center;">
|
|
191
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
192
|
+
<span>Small:</span>
|
|
193
|
+
<Tooltip placement="top-center" size="sm">
|
|
194
|
+
<template #activator>
|
|
195
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: #666; color: white; border-radius: 50%; font-size: 10px; cursor: help;">?</span>
|
|
196
|
+
</template>
|
|
197
|
+
Small tooltip
|
|
198
|
+
</Tooltip>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
202
|
+
<span>Medium:</span>
|
|
203
|
+
<Tooltip placement="top-center" size="md">
|
|
204
|
+
<template #activator>
|
|
205
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
206
|
+
</template>
|
|
207
|
+
Medium tooltip (default)
|
|
208
|
+
</Tooltip>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
212
|
+
<span>Large:</span>
|
|
213
|
+
<Tooltip placement="top-center" size="lg">
|
|
214
|
+
<template #activator>
|
|
215
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: #666; color: white; border-radius: 50%; font-size: 12px; cursor: help;">?</span>
|
|
216
|
+
</template>
|
|
217
|
+
Large tooltip
|
|
218
|
+
</Tooltip>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
`,
|
|
223
|
+
}),
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const WithCustomMaxWidth = {
|
|
227
|
+
render: () => ({
|
|
228
|
+
components: { Tooltip },
|
|
229
|
+
template: `
|
|
230
|
+
<div style="padding: 80px;">
|
|
231
|
+
<div style="display: flex; gap: 30px; align-items: center;">
|
|
232
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
233
|
+
<span>Default width:</span>
|
|
234
|
+
<Tooltip placement="top-center">
|
|
235
|
+
<template #activator>
|
|
236
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #666; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
237
|
+
</template>
|
|
238
|
+
This is a tooltip with default width that can be quite long and will wrap naturally
|
|
239
|
+
</Tooltip>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
243
|
+
<span>Custom max-width (200px):</span>
|
|
244
|
+
<Tooltip placement="top-center" max-width="200px">
|
|
245
|
+
<template #activator>
|
|
246
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #007bff; color: white; border-radius: 50%; font-size: 11px; cursor: help;">?</span>
|
|
247
|
+
</template>
|
|
248
|
+
This is a tooltip with custom max-width of 200px that will wrap when it exceeds that width
|
|
249
|
+
</Tooltip>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
`,
|
|
254
|
+
}),
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const ComplexContent = {
|
|
258
|
+
render: () => ({
|
|
259
|
+
components: { Tooltip },
|
|
260
|
+
template: `
|
|
261
|
+
<div style="padding: 80px;">
|
|
262
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
263
|
+
<span>Complex tooltip with title:</span>
|
|
264
|
+
<Tooltip placement="top-center" :fluid="true">
|
|
265
|
+
<template #activator>
|
|
266
|
+
<span style="display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; background: #28a745; color: white; border-radius: 50%; font-size: 11px; cursor: help;">i</span>
|
|
267
|
+
</template>
|
|
268
|
+
<template #title>Investment Information</template>
|
|
269
|
+
<div>
|
|
270
|
+
<p style="margin: 0 0 8px 0;">Investment details:</p>
|
|
271
|
+
<ul style="margin: 0; padding-left: 16px;">
|
|
272
|
+
<li>Minimum amount: R$ 1,000.00</li>
|
|
273
|
+
<li>Maximum amount: R$ 100,000.00</li>
|
|
274
|
+
<li>Processing time: 2-3 business days</li>
|
|
275
|
+
</ul>
|
|
276
|
+
</div>
|
|
277
|
+
</Tooltip>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
`,
|
|
281
|
+
}),
|
|
282
|
+
};
|