@app-studio/web 0.9.41 → 0.9.43
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/bot/Bot.d.ts +15 -0
- package/dist/bot/Cache.d.ts +13 -0
- package/dist/bot/Config.d.ts +13 -0
- package/dist/bot/ContentFetcher.d.ts +9 -0
- package/dist/bot/DocuCode.d.ts +19 -0
- package/dist/bot/FileHandler.d.ts +39 -0
- package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
- package/dist/bot/ai/GeminiConnector.d.ts +7 -0
- package/dist/bot/ai/GroqConnector.d.ts +7 -0
- package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
- package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
- package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
- package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
- package/dist/bot/ai/ai.config.d.ts +12 -0
- package/dist/bot/ai/ai.service.d.ts +36 -0
- package/dist/bot/data.d.ts +19 -0
- package/dist/bot/extractors.d.ts +8 -0
- package/dist/bot/index.d.ts +1 -0
- package/dist/bot/prompt/1-project.d.ts +1 -0
- package/dist/bot/prompt/2-response.d.ts +1 -0
- package/dist/bot/prompt/3-comment.d.ts +1 -0
- package/docs/components/Accordion.mdx +74 -121
- package/docs/components/Alert.mdx +19 -70
- package/docs/components/AspectRatio.mdx +13 -11
- package/docs/components/AudioInput.mdx +43 -0
- package/docs/components/Avatar.mdx +18 -43
- package/docs/components/Background.mdx +100 -492
- package/docs/components/Badge.mdx +45 -130
- package/docs/components/Button.mdx +76 -128
- package/docs/components/Calendar.mdx +7 -7
- package/docs/components/Card.mdx +247 -290
- package/docs/components/Carousel.mdx +94 -321
- package/docs/components/Chart.mdx +171 -26
- package/docs/components/ChatInput.mdx +327 -275
- package/docs/components/Checkbox.mdx +3 -5
- package/docs/components/ColorInput.mdx +6 -6
- package/docs/components/ColorPicker.mdx +452 -0
- package/docs/components/ComboBox.mdx +13 -13
- package/docs/components/Command.mdx +140 -188
- package/docs/components/ContextMenu.mdx +47 -171
- package/docs/components/CookieConsent.mdx +53 -0
- package/docs/components/CountryPicker.mdx +8 -8
- package/docs/components/DatePicker.mdx +3 -3
- package/docs/components/DragAndDrop.mdx +279 -463
- package/docs/components/Drawer.mdx +392 -231
- package/docs/components/DropdownMenu.mdx +37 -155
- package/docs/components/EmojiPicker.mdx +84 -0
- package/docs/components/File.mdx +130 -4
- package/docs/components/Formik.mdx +39 -39
- package/docs/components/Gradient.mdx +359 -182
- package/docs/components/Horizontal.mdx +1 -2
- package/docs/components/HoverCard.mdx +57 -125
- package/docs/components/KanbanBoard.mdx +9 -9
- package/docs/components/Link.mdx +22 -30
- package/docs/components/Loader.mdx +230 -413
- package/docs/components/Menubar.mdx +73 -69
- package/docs/components/Message.mdx +210 -525
- package/docs/components/Modal.mdx +351 -475
- package/docs/components/NavigationMenu.mdx +8 -8
- package/docs/components/OTPInput.mdx +194 -0
- package/docs/components/Pagination.mdx +451 -107
- package/docs/components/Password.mdx +8 -8
- package/docs/components/ProgressBar.mdx +460 -0
- package/docs/components/Resizable.mdx +103 -102
- package/docs/components/Select.mdx +5 -5
- package/docs/components/Separator.mdx +11 -98
- package/docs/components/ShareButton.mdx +29 -0
- package/docs/components/Sidebar.mdx +70 -131
- package/docs/components/Slider.mdx +99 -185
- package/docs/components/StatusIndicator.mdx +373 -0
- package/docs/components/Switch.mdx +3 -3
- package/docs/components/Table.mdx +25 -105
- package/docs/components/Tabs.mdx +40 -143
- package/docs/components/TagInput.mdx +17 -17
- package/docs/components/Text.mdx +3 -3
- package/docs/components/TextArea.mdx +6 -6
- package/docs/components/TextField.mdx +12 -12
- package/docs/components/Title.mdx +267 -525
- package/docs/components/Toast.mdx +65 -142
- package/docs/components/Toggle.mdx +37 -49
- package/docs/components/ToggleGroup.mdx +36 -57
- package/docs/components/Tooltip.mdx +501 -138
- package/docs/components/Uploader.mdx +205 -351
- package/package.json +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
- package/dist/components/AuthGuard/index.d.ts +0 -1
- package/docs/adk-components.md +0 -319
- package/docs/adk-quick-start.md +0 -268
|
@@ -1,191 +1,554 @@
|
|
|
1
1
|
# Tooltip
|
|
2
2
|
|
|
3
|
-
A component
|
|
3
|
+
A tooltip component for displaying contextual information on hover or focus, with customizable positioning, styling, and behavior.
|
|
4
4
|
|
|
5
5
|
### **Import**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
```tsx
|
|
7
|
+
import { Tooltip } from '@app-studio/web';
|
|
8
|
+
```
|
|
9
9
|
|
|
10
10
|
### **Default**
|
|
11
11
|
```tsx
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import { Tooltip } from '
|
|
14
|
-
import { Button } from '
|
|
13
|
+
import { Tooltip } from '@app-studio/web';
|
|
14
|
+
import { Button } from 'app-studio';
|
|
15
15
|
|
|
16
|
-
export const DefaultTooltip = () =>
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
16
|
+
export const DefaultTooltip = () => (
|
|
17
|
+
<Tooltip content="This is a tooltip">
|
|
18
|
+
<Button>Hover me</Button>
|
|
19
|
+
</Tooltip>
|
|
20
|
+
);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### **content**
|
|
24
|
+
The content to display in the tooltip.
|
|
25
|
+
|
|
26
|
+
- **Type:** `React.ReactNode`
|
|
27
|
+
- **Required:** `true`
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import { Tooltip } from '@app-studio/web';
|
|
32
|
+
import { Button, Text, Vertical } from 'app-studio';
|
|
33
|
+
|
|
34
|
+
export const TooltipContent = () => (
|
|
35
|
+
<Tooltip
|
|
36
|
+
content={
|
|
37
|
+
<Vertical gap={5}>
|
|
38
|
+
<Text fontWeight="bold">Tooltip Title</Text>
|
|
39
|
+
<Text fontSize={12}>This is detailed tooltip content</Text>
|
|
40
|
+
</Vertical>
|
|
41
|
+
}
|
|
42
|
+
>
|
|
43
|
+
<Button>Hover for details</Button>
|
|
44
|
+
</Tooltip>
|
|
45
|
+
);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### **position**
|
|
49
|
+
The preferred position of the tooltip.
|
|
50
|
+
|
|
51
|
+
- **Type:** `Position`
|
|
52
|
+
- **Default:** `'top'`
|
|
53
|
+
- **Possible Values:** `'top' | 'bottom' | 'left' | 'right'`
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import React from 'react';
|
|
57
|
+
import { Tooltip } from '@app-studio/web';
|
|
58
|
+
import { Button, Horizontal } from 'app-studio';
|
|
59
|
+
|
|
60
|
+
export const TooltipPositions = () => (
|
|
61
|
+
<Horizontal gap={15}>
|
|
62
|
+
<Tooltip content="Top tooltip" position="top">
|
|
63
|
+
<Button>Top</Button>
|
|
20
64
|
</Tooltip>
|
|
21
|
-
|
|
22
|
-
|
|
65
|
+
<Tooltip content="Bottom tooltip" position="bottom">
|
|
66
|
+
<Button>Bottom</Button>
|
|
67
|
+
</Tooltip>
|
|
68
|
+
<Tooltip content="Left tooltip" position="left">
|
|
69
|
+
<Button>Left</Button>
|
|
70
|
+
</Tooltip>
|
|
71
|
+
<Tooltip content="Right tooltip" position="right">
|
|
72
|
+
<Button>Right</Button>
|
|
73
|
+
</Tooltip>
|
|
74
|
+
</Horizontal>
|
|
75
|
+
);
|
|
23
76
|
```
|
|
24
77
|
|
|
25
|
-
### **
|
|
26
|
-
|
|
78
|
+
### **align**
|
|
79
|
+
The alignment of the tooltip relative to the trigger.
|
|
80
|
+
|
|
81
|
+
- **Type:** `Alignment`
|
|
82
|
+
- **Default:** `'center'`
|
|
83
|
+
- **Possible Values:** `'start' | 'center' | 'end'`
|
|
27
84
|
|
|
28
85
|
```tsx
|
|
29
86
|
import React from 'react';
|
|
30
|
-
import { Tooltip } from '
|
|
31
|
-
import { Button } from '
|
|
32
|
-
import { Horizontal } from '@app-studio/web';
|
|
87
|
+
import { Tooltip } from '@app-studio/web';
|
|
88
|
+
import { Button, Vertical } from 'app-studio';
|
|
33
89
|
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</Tooltip>
|
|
48
|
-
|
|
49
|
-
<Tooltip content="Tooltip on left" position="left">
|
|
50
|
-
<Button>Left</Button>
|
|
51
|
-
</Tooltip>
|
|
52
|
-
</Horizontal>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
90
|
+
export const TooltipAlignments = () => (
|
|
91
|
+
<Vertical gap={15}>
|
|
92
|
+
<Tooltip content="Start aligned" position="top" align="start">
|
|
93
|
+
<Button>Start</Button>
|
|
94
|
+
</Tooltip>
|
|
95
|
+
<Tooltip content="Center aligned" position="top" align="center">
|
|
96
|
+
<Button>Center</Button>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
<Tooltip content="End aligned" position="top" align="end">
|
|
99
|
+
<Button>End</Button>
|
|
100
|
+
</Tooltip>
|
|
101
|
+
</Vertical>
|
|
102
|
+
);
|
|
55
103
|
```
|
|
56
104
|
|
|
57
|
-
### **
|
|
58
|
-
|
|
105
|
+
### **size**
|
|
106
|
+
The size of the tooltip.
|
|
107
|
+
|
|
108
|
+
- **Type:** `Size`
|
|
109
|
+
- **Default:** `'md'`
|
|
110
|
+
- **Possible Values:** `'xs' | 'sm' | 'md' | 'lg' | 'xl'`
|
|
59
111
|
|
|
60
112
|
```tsx
|
|
61
113
|
import React from 'react';
|
|
62
|
-
import { Tooltip } from '
|
|
63
|
-
import { Button } from '
|
|
64
|
-
import { Horizontal } from '@app-studio/web';
|
|
114
|
+
import { Tooltip } from '@app-studio/web';
|
|
115
|
+
import { Button, Horizontal } from 'app-studio';
|
|
65
116
|
|
|
66
|
-
export const
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
117
|
+
export const TooltipSizes = () => (
|
|
118
|
+
<Horizontal gap={15}>
|
|
119
|
+
<Tooltip content="Extra small" size="xs">
|
|
120
|
+
<Button>XS</Button>
|
|
121
|
+
</Tooltip>
|
|
122
|
+
<Tooltip content="Small tooltip" size="sm">
|
|
123
|
+
<Button>SM</Button>
|
|
124
|
+
</Tooltip>
|
|
125
|
+
<Tooltip content="Medium tooltip" size="md">
|
|
126
|
+
<Button>MD</Button>
|
|
127
|
+
</Tooltip>
|
|
128
|
+
<Tooltip content="Large tooltip" size="lg">
|
|
129
|
+
<Button>LG</Button>
|
|
130
|
+
</Tooltip>
|
|
131
|
+
</Horizontal>
|
|
132
|
+
);
|
|
83
133
|
```
|
|
84
134
|
|
|
85
|
-
### **
|
|
86
|
-
|
|
135
|
+
### **variant**
|
|
136
|
+
The visual style variant of the tooltip.
|
|
137
|
+
|
|
138
|
+
- **Type:** `Variant`
|
|
139
|
+
- **Default:** `'default'`
|
|
140
|
+
- **Possible Values:** `'default' | 'dark' | 'light' | 'primary' | 'success' | 'error' | 'warning'`
|
|
87
141
|
|
|
88
142
|
```tsx
|
|
89
143
|
import React from 'react';
|
|
90
|
-
import { Tooltip } from '
|
|
91
|
-
import { Button } from '
|
|
92
|
-
import { Horizontal } from '@app-studio/web';
|
|
144
|
+
import { Tooltip } from '@app-studio/web';
|
|
145
|
+
import { Button, Horizontal } from 'app-studio';
|
|
93
146
|
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
147
|
+
export const TooltipVariants = () => (
|
|
148
|
+
<Horizontal gap={15}>
|
|
149
|
+
<Tooltip content="Default variant" variant="default">
|
|
150
|
+
<Button>Default</Button>
|
|
151
|
+
</Tooltip>
|
|
152
|
+
<Tooltip content="Dark variant" variant="dark">
|
|
153
|
+
<Button>Dark</Button>
|
|
154
|
+
</Tooltip>
|
|
155
|
+
<Tooltip content="Primary variant" variant="primary">
|
|
156
|
+
<Button>Primary</Button>
|
|
157
|
+
</Tooltip>
|
|
158
|
+
<Tooltip content="Success variant" variant="success">
|
|
159
|
+
<Button>Success</Button>
|
|
160
|
+
</Tooltip>
|
|
161
|
+
<Tooltip content="Error variant" variant="error">
|
|
162
|
+
<Button>Error</Button>
|
|
163
|
+
</Tooltip>
|
|
164
|
+
</Horizontal>
|
|
165
|
+
);
|
|
111
166
|
```
|
|
112
167
|
|
|
113
|
-
### **
|
|
114
|
-
|
|
168
|
+
### **openDelay**
|
|
169
|
+
Delay in milliseconds before the tooltip opens on hover.
|
|
170
|
+
|
|
171
|
+
- **Type:** `number`
|
|
172
|
+
- **Default:** `200`
|
|
115
173
|
|
|
116
174
|
```tsx
|
|
117
175
|
import React from 'react';
|
|
118
|
-
import { Tooltip } from '
|
|
119
|
-
import { Button } from '
|
|
120
|
-
import { Text } from '@app-studio/web';
|
|
121
|
-
import { Vertical } from '@app-studio/web';
|
|
176
|
+
import { Tooltip } from '@app-studio/web';
|
|
177
|
+
import { Button } from 'app-studio';
|
|
122
178
|
|
|
123
|
-
export const
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
179
|
+
export const DelayedTooltip = () => (
|
|
180
|
+
<Tooltip content="Opens after 1 second" openDelay={1000}>
|
|
181
|
+
<Button>Hover and wait</Button>
|
|
182
|
+
</Tooltip>
|
|
183
|
+
);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### **closeDelay**
|
|
187
|
+
Delay in milliseconds before the tooltip closes after hover stops.
|
|
188
|
+
|
|
189
|
+
- **Type:** `number`
|
|
190
|
+
- **Default:** `200`
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import React from 'react';
|
|
194
|
+
import { Tooltip } from '@app-studio/web';
|
|
195
|
+
import { Button } from 'app-studio';
|
|
196
|
+
|
|
197
|
+
export const CloseDelayTooltip = () => (
|
|
198
|
+
<Tooltip content="Stays open longer" closeDelay={1000}>
|
|
199
|
+
<Button>Hover me</Button>
|
|
200
|
+
</Tooltip>
|
|
201
|
+
);
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### **showArrow**
|
|
205
|
+
Whether to show an arrow pointing to the trigger.
|
|
206
|
+
|
|
207
|
+
- **Type:** `boolean`
|
|
208
|
+
- **Default:** `true`
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import React from 'react';
|
|
212
|
+
import { Tooltip } from '@app-studio/web';
|
|
213
|
+
import { Button, Horizontal } from 'app-studio';
|
|
214
|
+
|
|
215
|
+
export const TooltipArrows = () => (
|
|
216
|
+
<Horizontal gap={15}>
|
|
217
|
+
<Tooltip content="With arrow" showArrow>
|
|
218
|
+
<Button>With Arrow</Button>
|
|
219
|
+
</Tooltip>
|
|
220
|
+
<Tooltip content="Without arrow" showArrow={false}>
|
|
221
|
+
<Button>No Arrow</Button>
|
|
222
|
+
</Tooltip>
|
|
223
|
+
</Horizontal>
|
|
224
|
+
);
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### **defaultOpen**
|
|
228
|
+
Whether the tooltip is initially open.
|
|
229
|
+
|
|
230
|
+
- **Type:** `boolean`
|
|
231
|
+
- **Default:** `false`
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
import React from 'react';
|
|
235
|
+
import { Tooltip } from '@app-studio/web';
|
|
236
|
+
import { Button } from 'app-studio';
|
|
237
|
+
|
|
238
|
+
export const DefaultOpenTooltip = () => (
|
|
239
|
+
<Tooltip content="Initially visible" defaultOpen>
|
|
240
|
+
<Button>Default Open</Button>
|
|
241
|
+
</Tooltip>
|
|
242
|
+
);
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### **isDisabled**
|
|
246
|
+
Whether the tooltip is disabled.
|
|
247
|
+
|
|
248
|
+
- **Type:** `boolean`
|
|
249
|
+
- **Default:** `false`
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import React from 'react';
|
|
253
|
+
import { Tooltip } from '@app-studio/web';
|
|
254
|
+
import { Button } from 'app-studio';
|
|
255
|
+
|
|
256
|
+
export const DisabledTooltip = () => (
|
|
257
|
+
<Tooltip content="This won't show" isDisabled>
|
|
258
|
+
<Button>Disabled Tooltip</Button>
|
|
259
|
+
</Tooltip>
|
|
260
|
+
);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### **views**
|
|
264
|
+
Custom styles for different parts of the tooltip.
|
|
265
|
+
|
|
266
|
+
- **Type:** `TooltipStyles`
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import React from 'react';
|
|
270
|
+
import { Tooltip } from '@app-studio/web';
|
|
271
|
+
import { Button } from 'app-studio';
|
|
272
|
+
|
|
273
|
+
export const StyledTooltip = () => (
|
|
274
|
+
<Tooltip
|
|
275
|
+
content="Custom styled tooltip"
|
|
276
|
+
views={{
|
|
277
|
+
container: {
|
|
278
|
+
backgroundColor: '#3b82f6',
|
|
279
|
+
color: '#ffffff',
|
|
280
|
+
borderRadius: 8,
|
|
281
|
+
padding: 12,
|
|
282
|
+
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
283
|
+
},
|
|
284
|
+
arrow: {
|
|
285
|
+
fill: '#3b82f6',
|
|
131
286
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
<Button>Custom Style</Button>
|
|
290
|
+
</Tooltip>
|
|
291
|
+
);
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### **Icon Tooltips**
|
|
295
|
+
Tooltips on icons for additional information.
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
import React from 'react';
|
|
299
|
+
import { Tooltip } from '@app-studio/web';
|
|
300
|
+
import { InfoIcon } from '@app-studio/web';
|
|
301
|
+
import { Horizontal, Text } from 'app-studio';
|
|
302
|
+
|
|
303
|
+
export const IconTooltips = () => (
|
|
304
|
+
<Horizontal gap={10} alignItems="center">
|
|
305
|
+
<Text>Username</Text>
|
|
306
|
+
<Tooltip content="Your unique identifier">
|
|
307
|
+
<InfoIcon widthHeight={16} />
|
|
144
308
|
</Tooltip>
|
|
145
|
-
|
|
146
|
-
|
|
309
|
+
</Horizontal>
|
|
310
|
+
);
|
|
147
311
|
```
|
|
148
312
|
|
|
149
|
-
### **
|
|
150
|
-
|
|
313
|
+
### **Form Field Tooltips**
|
|
314
|
+
Tooltips for form field help text.
|
|
151
315
|
|
|
152
316
|
```tsx
|
|
153
317
|
import React from 'react';
|
|
154
|
-
import { Tooltip } from '
|
|
155
|
-
import {
|
|
156
|
-
import { Text } from '
|
|
318
|
+
import { Tooltip } from '@app-studio/web';
|
|
319
|
+
import { TextField } from '@app-studio/web';
|
|
320
|
+
import { Vertical, Horizontal, Text } from 'app-studio';
|
|
321
|
+
import { InfoIcon } from '@app-studio/web';
|
|
157
322
|
|
|
158
|
-
export const
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
323
|
+
export const FormFieldTooltips = () => (
|
|
324
|
+
<Vertical gap={15}>
|
|
325
|
+
<Vertical gap={5}>
|
|
326
|
+
<Horizontal gap={5} alignItems="center">
|
|
327
|
+
<Text>Password</Text>
|
|
328
|
+
<Tooltip
|
|
329
|
+
content="Must be at least 8 characters with uppercase, lowercase, and numbers"
|
|
330
|
+
position="right"
|
|
331
|
+
>
|
|
332
|
+
<InfoIcon widthHeight={14} />
|
|
333
|
+
</Tooltip>
|
|
334
|
+
</Horizontal>
|
|
335
|
+
<TextField type="password" />
|
|
336
|
+
</Vertical>
|
|
337
|
+
</Vertical>
|
|
338
|
+
);
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### **Action Tooltips**
|
|
342
|
+
Tooltips for action buttons.
|
|
343
|
+
|
|
344
|
+
```tsx
|
|
345
|
+
import React from 'react';
|
|
346
|
+
import { Tooltip } from '@app-studio/web';
|
|
347
|
+
import { Button, Horizontal } from 'app-studio';
|
|
348
|
+
import { EditIcon, DeleteIcon, ShareIcon } from '@app-studio/web';
|
|
349
|
+
|
|
350
|
+
export const ActionTooltips = () => (
|
|
351
|
+
<Horizontal gap={10}>
|
|
352
|
+
<Tooltip content="Edit">
|
|
353
|
+
<Button isIconRounded icon={<EditIcon widthHeight={16} />} />
|
|
167
354
|
</Tooltip>
|
|
168
|
-
|
|
169
|
-
}
|
|
355
|
+
<Tooltip content="Delete">
|
|
356
|
+
<Button isIconRounded icon={<DeleteIcon widthHeight={16} />} />
|
|
357
|
+
</Tooltip>
|
|
358
|
+
<Tooltip content="Share">
|
|
359
|
+
<Button isIconRounded icon={<ShareIcon widthHeight={16} />} />
|
|
360
|
+
</Tooltip>
|
|
361
|
+
</Horizontal>
|
|
362
|
+
);
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### **Rich Content Tooltips**
|
|
366
|
+
Tooltips with rich formatted content.
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
import React from 'react';
|
|
370
|
+
import { Tooltip } from '@app-studio/web';
|
|
371
|
+
import { Button, Vertical, Text, Horizontal } from 'app-studio';
|
|
372
|
+
|
|
373
|
+
export const RichContentTooltip = () => (
|
|
374
|
+
<Tooltip
|
|
375
|
+
content={
|
|
376
|
+
<Vertical gap={10}>
|
|
377
|
+
<Text fontSize={14} fontWeight="bold">Keyboard Shortcuts</Text>
|
|
378
|
+
<Vertical gap={5}>
|
|
379
|
+
<Horizontal gap={10}>
|
|
380
|
+
<Text fontSize={12} fontWeight="bold">Ctrl+S</Text>
|
|
381
|
+
<Text fontSize={12}>Save</Text>
|
|
382
|
+
</Horizontal>
|
|
383
|
+
<Horizontal gap={10}>
|
|
384
|
+
<Text fontSize={12} fontWeight="bold">Ctrl+Z</Text>
|
|
385
|
+
<Text fontSize={12}>Undo</Text>
|
|
386
|
+
</Horizontal>
|
|
387
|
+
<Horizontal gap={10}>
|
|
388
|
+
<Text fontSize={12} fontWeight="bold">Ctrl+Y</Text>
|
|
389
|
+
<Text fontSize={12}>Redo</Text>
|
|
390
|
+
</Horizontal>
|
|
391
|
+
</Vertical>
|
|
392
|
+
</Vertical>
|
|
393
|
+
}
|
|
394
|
+
size="lg"
|
|
395
|
+
>
|
|
396
|
+
<Button>Shortcuts</Button>
|
|
397
|
+
</Tooltip>
|
|
398
|
+
);
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### **Status Tooltips**
|
|
402
|
+
Tooltips showing status information.
|
|
403
|
+
|
|
404
|
+
```tsx
|
|
405
|
+
import React from 'react';
|
|
406
|
+
import { Tooltip } from '@app-studio/web';
|
|
407
|
+
import { StatusIndicator } from '@app-studio/web';
|
|
408
|
+
import { Vertical, Text } from 'app-studio';
|
|
409
|
+
|
|
410
|
+
export const StatusTooltip = () => (
|
|
411
|
+
<Tooltip
|
|
412
|
+
content={
|
|
413
|
+
<Vertical gap={5}>
|
|
414
|
+
<Text fontSize={12} fontWeight="bold">Server Status</Text>
|
|
415
|
+
<Text fontSize={12}>Last checked: 2 minutes ago</Text>
|
|
416
|
+
<Text fontSize={12}>Uptime: 99.9%</Text>
|
|
417
|
+
</Vertical>
|
|
418
|
+
}
|
|
419
|
+
>
|
|
420
|
+
<StatusIndicator status="active" label="Online" />
|
|
421
|
+
</Tooltip>
|
|
422
|
+
);
|
|
170
423
|
```
|
|
171
424
|
|
|
172
|
-
### **
|
|
173
|
-
Tooltips
|
|
425
|
+
### **Truncated Text Tooltips**
|
|
426
|
+
Tooltips for truncated text.
|
|
174
427
|
|
|
175
428
|
```tsx
|
|
176
429
|
import React from 'react';
|
|
177
|
-
import { Tooltip } from '
|
|
178
|
-
import {
|
|
179
|
-
import { Icon } from '../../Icon/Icon';
|
|
430
|
+
import { Tooltip } from '@app-studio/web';
|
|
431
|
+
import { Text } from 'app-studio';
|
|
180
432
|
|
|
181
|
-
export const
|
|
433
|
+
export const TruncatedTextTooltip = () => {
|
|
434
|
+
const longText = "This is a very long text that will be truncated in the UI but shown in full in the tooltip";
|
|
435
|
+
|
|
182
436
|
return (
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
437
|
+
<Tooltip content={longText}>
|
|
438
|
+
<Text
|
|
439
|
+
maxWidth={200}
|
|
440
|
+
overflow="hidden"
|
|
441
|
+
textOverflow="ellipsis"
|
|
442
|
+
whiteSpace="nowrap"
|
|
443
|
+
>
|
|
444
|
+
{longText}
|
|
445
|
+
</Text>
|
|
446
|
+
</Tooltip>
|
|
189
447
|
);
|
|
190
448
|
};
|
|
191
449
|
```
|
|
450
|
+
|
|
451
|
+
### **Disabled Element Tooltips**
|
|
452
|
+
Tooltips on disabled elements.
|
|
453
|
+
|
|
454
|
+
```tsx
|
|
455
|
+
import React from 'react';
|
|
456
|
+
import { Tooltip } from '@app-studio/web';
|
|
457
|
+
import { Button } from 'app-studio';
|
|
458
|
+
|
|
459
|
+
export const DisabledElementTooltip = () => (
|
|
460
|
+
<Tooltip content="This action is not available">
|
|
461
|
+
<span>
|
|
462
|
+
<Button isDisabled>Disabled Action</Button>
|
|
463
|
+
</span>
|
|
464
|
+
</Tooltip>
|
|
465
|
+
);
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### **Interactive Tooltips**
|
|
469
|
+
Tooltips with interactive content.
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
import React from 'react';
|
|
473
|
+
import { Tooltip } from '@app-studio/web';
|
|
474
|
+
import { Button, Vertical, Text } from 'app-studio';
|
|
475
|
+
|
|
476
|
+
export const InteractiveTooltip = () => (
|
|
477
|
+
<Tooltip
|
|
478
|
+
content={
|
|
479
|
+
<Vertical gap={10}>
|
|
480
|
+
<Text fontSize={14}>Are you sure?</Text>
|
|
481
|
+
<Button size="sm" onClick={() => console.log('Confirmed')}>
|
|
482
|
+
Confirm
|
|
483
|
+
</Button>
|
|
484
|
+
</Vertical>
|
|
485
|
+
}
|
|
486
|
+
closeDelay={0}
|
|
487
|
+
>
|
|
488
|
+
<Button>Delete</Button>
|
|
489
|
+
</Tooltip>
|
|
490
|
+
);
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### **Complete Example**
|
|
494
|
+
A comprehensive tooltip showcase.
|
|
495
|
+
|
|
496
|
+
```tsx
|
|
497
|
+
import React from 'react';
|
|
498
|
+
import { Tooltip } from '@app-studio/web';
|
|
499
|
+
import { Button, Vertical, Horizontal, Text, Card } from 'app-studio';
|
|
500
|
+
|
|
501
|
+
export const CompleteTooltipExample = () => (
|
|
502
|
+
<Card padding={30}>
|
|
503
|
+
<Vertical gap={30}>
|
|
504
|
+
<Vertical gap={10}>
|
|
505
|
+
<Text fontSize={18} fontWeight="bold">Tooltip Positions</Text>
|
|
506
|
+
<Horizontal gap={15}>
|
|
507
|
+
{['top', 'bottom', 'left', 'right'].map((position) => (
|
|
508
|
+
<Tooltip
|
|
509
|
+
key={position}
|
|
510
|
+
content={`${position} tooltip`}
|
|
511
|
+
position={position as any}
|
|
512
|
+
>
|
|
513
|
+
<Button>{position}</Button>
|
|
514
|
+
</Tooltip>
|
|
515
|
+
))}
|
|
516
|
+
</Horizontal>
|
|
517
|
+
</Vertical>
|
|
518
|
+
|
|
519
|
+
<Vertical gap={10}>
|
|
520
|
+
<Text fontSize={18} fontWeight="bold">Tooltip Variants</Text>
|
|
521
|
+
<Horizontal gap={15}>
|
|
522
|
+
{['default', 'primary', 'success', 'error'].map((variant) => (
|
|
523
|
+
<Tooltip
|
|
524
|
+
key={variant}
|
|
525
|
+
content={`${variant} variant`}
|
|
526
|
+
variant={variant as any}
|
|
527
|
+
>
|
|
528
|
+
<Button>{variant}</Button>
|
|
529
|
+
</Tooltip>
|
|
530
|
+
))}
|
|
531
|
+
</Horizontal>
|
|
532
|
+
</Vertical>
|
|
533
|
+
|
|
534
|
+
<Vertical gap={10}>
|
|
535
|
+
<Text fontSize={18} fontWeight="bold">Rich Content</Text>
|
|
536
|
+
<Tooltip
|
|
537
|
+
content={
|
|
538
|
+
<Vertical gap={8}>
|
|
539
|
+
<Text fontSize={14} fontWeight="bold">User Information</Text>
|
|
540
|
+
<Text fontSize={12}>Name: John Doe</Text>
|
|
541
|
+
<Text fontSize={12}>Email: john@example.com</Text>
|
|
542
|
+
<Text fontSize={12}>Role: Administrator</Text>
|
|
543
|
+
</Vertical>
|
|
544
|
+
}
|
|
545
|
+
size="lg"
|
|
546
|
+
>
|
|
547
|
+
<Button>View Details</Button>
|
|
548
|
+
</Tooltip>
|
|
549
|
+
</Vertical>
|
|
550
|
+
</Vertical>
|
|
551
|
+
</Card>
|
|
552
|
+
);
|
|
553
|
+
```
|
|
554
|
+
|