@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,571 +1,256 @@
|
|
|
1
|
-
|
|
1
|
+
# Message
|
|
2
|
+
|
|
3
|
+
Displays various types of messages with customizable content, icons, actions, and closing behavior.
|
|
2
4
|
|
|
5
|
+
### **Import**
|
|
3
6
|
```tsx
|
|
4
7
|
import { Message } from '@app-studio/web';
|
|
5
8
|
```
|
|
6
9
|
|
|
7
10
|
### **Default**
|
|
8
|
-
|
|
9
|
-
It uses the isOpen and onClose properties to display the message.
|
|
10
|
-
|
|
11
|
-
```tsx
|
|
12
|
-
import { Button } from '../Button/Button';
|
|
13
|
-
import { useState } from 'react';
|
|
14
|
-
|
|
15
|
-
const [show, setShow] = useState(false);
|
|
16
|
-
|
|
17
|
-
<>
|
|
18
|
-
<Button onClick={() => setShow(true)} isAuto>
|
|
19
|
-
Open Message
|
|
20
|
-
</Button>
|
|
21
|
-
<Message.Overlay isOpen={show} onClose={() => setShow(false)}>
|
|
22
|
-
<Message.Container>
|
|
23
|
-
<Message.Header>Title</Message.Header>
|
|
24
|
-
<Message.Body>
|
|
25
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
26
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
27
|
-
nisl consectetur et.
|
|
28
|
-
</Message.Body>
|
|
29
|
-
<Message.Footer>
|
|
30
|
-
<Button onClick={() => setShow(false)}>Cancel</Button>
|
|
31
|
-
</Message.Footer>
|
|
32
|
-
</Message.Container>
|
|
33
|
-
</Message.Overlay>
|
|
34
|
-
</>;
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## **Message Overlay**
|
|
38
|
-
|
|
39
|
-
It represents the overlay or backdrop that appears behind the message content when the message is displayed.
|
|
40
|
-
|
|
41
|
-
### **Props**
|
|
42
|
-
|
|
43
|
-
| Prop | Type | Description | Default |
|
|
44
|
-
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
45
|
-
| isOpen | boolean | Whether the message overlay is open. | false |
|
|
46
|
-
| onClose | function | Callback function to close the message. | |
|
|
47
|
-
| position | Position | Positions the message overlay ('top', 'left', 'right', 'bottom', 'center'). | 'center' |
|
|
48
|
-
| blur | number | Adds a blur effect on the message overlay. | |
|
|
49
|
-
| isClosePrevented | boolean | Prevents the user from closing the message when clicking outside of it. | false |
|
|
50
|
-
| styles | CSSProperties | Optional custom styles for the MessageOverlay. | |
|
|
51
|
-
| className | string | Optional className for the MessageOverlay container. | |
|
|
52
|
-
|
|
53
|
-
### **FullScreen**
|
|
54
|
-
|
|
55
|
-
“**is*fullScreen***” property changes the width and height of the message so that it fits the entire screen.
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import { Button } from '../Button/Button';
|
|
59
|
-
import { useState } from 'react';
|
|
60
|
-
|
|
61
|
-
const [show, setShow] = useState(false);
|
|
62
|
-
|
|
63
|
-
<>
|
|
64
|
-
<Button onClick={() => setShow(true)} isAuto>
|
|
65
|
-
Full Screen
|
|
66
|
-
</Button>
|
|
67
|
-
<Message.Overlay isOpen={show} onClose={() => setShow(false)}>
|
|
68
|
-
<Message.Container isFullScreen>
|
|
69
|
-
<Message.Header>Title</Message.Header>
|
|
70
|
-
<Message.Body>
|
|
71
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
72
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
73
|
-
nisl consectetur et.
|
|
74
|
-
</Message.Body>
|
|
75
|
-
<Message.Footer>
|
|
76
|
-
<Button onClick={() => setShow(false)}>Cancel</Button>
|
|
77
|
-
</Message.Footer>
|
|
78
|
-
</Message.Container>
|
|
79
|
-
</Message.Overlay>
|
|
80
|
-
</>;
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### **Position**
|
|
84
|
-
|
|
85
|
-
“**_position_**” places the message in the specified direction. It has a default positioning of “center”.
|
|
86
|
-
|
|
87
11
|
```tsx
|
|
88
|
-
import
|
|
89
|
-
import { Button } from '
|
|
90
|
-
import {
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{showBottom && (
|
|
108
|
-
<Message.Overlay isOpen={showBottom} onClose={() => setShowBottom(false)} position="bottom">
|
|
109
|
-
<Message.Container>
|
|
110
|
-
<Message.Header>Title</Message.Header>
|
|
111
|
-
<Message.Body>
|
|
112
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
113
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
114
|
-
nisl consectetur et.
|
|
115
|
-
</Message.Body>
|
|
116
|
-
<Message.Footer>
|
|
117
|
-
<Button onClick={() => setShowBottom(false)}>Cancel</Button>
|
|
118
|
-
</Message.Footer>
|
|
119
|
-
</Message.Container>
|
|
120
|
-
</Message.Overlay>
|
|
121
|
-
)}
|
|
122
|
-
{showTop && (
|
|
123
|
-
<Message.Overlay isOpen={showTop} onClose={() => setShowTop(false)} position="top">
|
|
124
|
-
<Message.Container>
|
|
125
|
-
<Message.Header>Title</Message.Header>
|
|
126
|
-
<Message.Body>
|
|
127
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
128
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
129
|
-
nisl consectetur et.
|
|
130
|
-
</Message.Body>
|
|
131
|
-
<Message.Footer>
|
|
132
|
-
<Button onClick={() => setShowTop(false)}>Cancel</Button>
|
|
133
|
-
</Message.Footer>
|
|
134
|
-
</Message.Container>
|
|
135
|
-
</Message.Overlay>
|
|
136
|
-
)}
|
|
137
|
-
{showLeft && (
|
|
138
|
-
<Message.Overlay isOpen={showLeft} onClose={() => setShowLeft(false)} position="left">
|
|
139
|
-
<Message.Container>
|
|
140
|
-
<Message.Header>Title</Message.Header>
|
|
141
|
-
<Message.Body>
|
|
142
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
143
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
144
|
-
nisl consectetur et.
|
|
145
|
-
</Message.Body>
|
|
146
|
-
<Message.Footer>
|
|
147
|
-
<Button onClick={() => setShowLeft(false)}>Cancel</Button>
|
|
148
|
-
</Message.Footer>
|
|
149
|
-
</Message.Container>
|
|
150
|
-
</Message.Overlay>
|
|
151
|
-
)}
|
|
152
|
-
{showRight && (
|
|
153
|
-
<Message.Overlay isOpen={showRight} onClose={() => setShowRight(false)} position="right">
|
|
154
|
-
<Message.Container>
|
|
155
|
-
<Message.Header>Title</Message.Header>
|
|
156
|
-
<Message.Body>
|
|
157
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
158
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
159
|
-
nisl consectetur et.
|
|
160
|
-
</Message.Body>
|
|
161
|
-
<Message.Footer>
|
|
162
|
-
<Button onClick={() => setShowRight(false)}>Cancel</Button>
|
|
163
|
-
</Message.Footer>
|
|
164
|
-
</Message.Container>
|
|
165
|
-
</Message.Overlay>
|
|
166
|
-
)}
|
|
167
|
-
{showCenter && (
|
|
168
|
-
<Message.Overlay isOpen={showCenter} onClose={() => setShowCenter(false)} position="center">
|
|
169
|
-
<Message.Container>
|
|
170
|
-
<Message.Header>Title</Message.Header>
|
|
171
|
-
<Message.Body>
|
|
172
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
173
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
174
|
-
nisl consectetur et.
|
|
175
|
-
</Message.Body>
|
|
176
|
-
<Message.Footer>
|
|
177
|
-
<Button onClick={() => setShowCenter(false)}>Cancel</Button>
|
|
178
|
-
</Message.Footer>
|
|
179
|
-
</Message.Container>
|
|
180
|
-
</Message.Overlay>
|
|
181
|
-
)}
|
|
182
|
-
</>;
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### **Blur**
|
|
186
|
-
|
|
187
|
-
“**_blur_**” adds a blur effect on the message overlay.
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
import { useState } from 'react';
|
|
191
|
-
import { Button } from '../Button/Button';
|
|
192
|
-
|
|
193
|
-
const [show, setShow] = useState(false);
|
|
194
|
-
|
|
195
|
-
<>
|
|
196
|
-
<Button onClick={() => setShow(true)}>Blur Overlay</Button>
|
|
197
|
-
<Message.Overlay isOpen={show} onClose={() => setShow(false)} blur={10}>
|
|
198
|
-
<Message.Container>
|
|
199
|
-
<Message.Header>Title</Message.Header>
|
|
200
|
-
<Message.Body>
|
|
201
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
202
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
203
|
-
nisl consectetur et.
|
|
204
|
-
</Message.Body>
|
|
205
|
-
<Message.Footer>
|
|
206
|
-
<Button onClick={() => setShow(false)}>Cancel</Button>
|
|
207
|
-
</Message.Footer>
|
|
208
|
-
</Message.Container>
|
|
209
|
-
</Message.Overlay>
|
|
210
|
-
</>;
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### **Prevent Close**
|
|
214
|
-
|
|
215
|
-
“**_isClosePrevented_**” prevents the user from closing the message when clicking outside of it.
|
|
216
|
-
|
|
217
|
-
```tsx
|
|
218
|
-
import { useState } from 'react';
|
|
219
|
-
import { Button } from '../Button/Button';
|
|
220
|
-
|
|
221
|
-
const [show, setShow] = useState(false);
|
|
222
|
-
|
|
223
|
-
<>
|
|
224
|
-
<Button onClick={() => setShow(true)}>Blur Overlay</Button>
|
|
225
|
-
<Message.Overlay isOpen={show} onClose={() => setShow(false)} isClosePrevented>
|
|
226
|
-
<Message.Container>
|
|
227
|
-
<Message.Header>Title</Message.Header>
|
|
228
|
-
<Message.Body>
|
|
229
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
|
|
230
|
-
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
|
|
231
|
-
nisl consectetur et.
|
|
232
|
-
</Message.Body>
|
|
233
|
-
<Message.Footer>
|
|
234
|
-
<Button onClick={() => setShow(false)}>Cancel</Button>
|
|
235
|
-
</Message.Footer>
|
|
236
|
-
</Message.Container>
|
|
237
|
-
</Message.Overlay>
|
|
238
|
-
</>;
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## **Message Container**
|
|
242
|
-
|
|
243
|
-
It represents the main container or wrapper that holds all the content and components of a message.
|
|
244
|
-
|
|
245
|
-
### **Props**
|
|
246
|
-
| Prop | Type | Description | Default |
|
|
247
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
248
|
-
| isFullScreen | boolean | Changes the width and height of the message so that it fits the entire screen. | false |
|
|
249
|
-
| variant | 'sharp' \| 'rounded' | Gives a sharp or rounded edges to the message container. | 'rounded' |
|
|
250
|
-
| shadow | object | Adds a shadow effect on the message container. | |
|
|
251
|
-
| styles | CSSProperties | Optional custom styles for the MessageContainer. | |
|
|
252
|
-
| className | string | Optional className for the MessageContainer. | |
|
|
253
|
-
|
|
254
|
-
### **Shapes**
|
|
255
|
-
|
|
256
|
-
“**_shape_**” gives a sharp or rounded edges to the message container.
|
|
257
|
-
|
|
258
|
-
```tsx
|
|
259
|
-
import { useState } from 'react';
|
|
260
|
-
import { Button } from '../Button/Button';
|
|
261
|
-
import { Text } from '@app-studio/web';
|
|
262
|
-
import { Horizontal } from '../Layout/Horizontal/Horizontal';
|
|
263
|
-
|
|
264
|
-
const [showSharp, setShowSharp] = useState(false);
|
|
265
|
-
const [showRounded, setShowRounded] = useState(false);
|
|
266
|
-
|
|
267
|
-
<>
|
|
268
|
-
<Horizontal gap={10}>
|
|
269
|
-
<Button onClick={() => setShowSharp(true)}>Sharp</Button>
|
|
270
|
-
<Button onClick={() => setShowRounded(true)}>Rounded</Button>
|
|
271
|
-
</Horizontal>
|
|
272
|
-
|
|
273
|
-
{showSharp && (
|
|
274
|
-
<Message.Overlay isOpen={showSharp} onClose={() => setShowSharp(false)}>
|
|
275
|
-
<Message.Container variant="sharp">
|
|
276
|
-
<Message.Body>
|
|
277
|
-
<Text maxLines={2}>
|
|
278
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
|
|
279
|
-
quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
|
|
280
|
-
scelerisque nisl consectetur et.
|
|
281
|
-
</Text>
|
|
282
|
-
</Message.Body>
|
|
283
|
-
</Message.Container>
|
|
284
|
-
</Message.Overlay>
|
|
285
|
-
)}
|
|
286
|
-
{showRounded && (
|
|
287
|
-
<Message.Overlay isOpen={showRounded} onClose={() => setShowRounded(false)}>
|
|
288
|
-
<Message.Container variant="rounded">
|
|
289
|
-
<Message.Body>
|
|
290
|
-
<Text maxLines={2}>
|
|
291
|
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
|
|
292
|
-
quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
|
|
293
|
-
scelerisque nisl consectetur et.
|
|
294
|
-
</Text>
|
|
295
|
-
</Message.Body>
|
|
296
|
-
</Message.Container>
|
|
297
|
-
</Message.Overlay>
|
|
298
|
-
)}
|
|
299
|
-
</>;
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Button } from '@app-studio/web';
|
|
14
|
+
import { showMessage } from '@app-studio/web';
|
|
15
|
+
// This is a functional component named 'DefaultDemo' that renders a Button component from the '../../Button/Button' path.
|
|
16
|
+
export const DefaultDemo = () => {
|
|
17
|
+
return (
|
|
18
|
+
<Button
|
|
19
|
+
onClick={() =>
|
|
20
|
+
showMessage(
|
|
21
|
+
'success',
|
|
22
|
+
'Scheduled: Catch up',
|
|
23
|
+
'Friday, February 10, 2023 at 5:57 PM'
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
Show Toast
|
|
28
|
+
</Button>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
300
31
|
```
|
|
301
32
|
|
|
302
|
-
### **
|
|
33
|
+
### **subtitle**
|
|
34
|
+
The secondary text content of the message.
|
|
303
35
|
|
|
304
|
-
|
|
36
|
+
- **Type:** `string`
|
|
37
|
+
- **Default:** `undefined`
|
|
38
|
+
- **Possible Values:** ``
|
|
305
39
|
|
|
306
40
|
```tsx
|
|
307
|
-
import
|
|
308
|
-
import { Button } from '
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
)}
|
|
328
|
-
</>;
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import { Button } from '@app-studio/web';
|
|
43
|
+
|
|
44
|
+
import { showMessage } from '@app-studio/web';
|
|
45
|
+
|
|
46
|
+
export const SubtitleDemo = () => {
|
|
47
|
+
return (
|
|
48
|
+
<Button
|
|
49
|
+
onClick={() =>
|
|
50
|
+
showMessage(
|
|
51
|
+
'error',
|
|
52
|
+
'Error Message',
|
|
53
|
+
'An error occurred while processing your request.'
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
>
|
|
57
|
+
Show Toast
|
|
58
|
+
</Button>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
329
61
|
```
|
|
330
62
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
It represents the header section of a message, which typically contains a title or heading and optionally other elements such as a close button or additional controls.
|
|
63
|
+
### **variant**
|
|
64
|
+
The type or category of the message, influencing its styling.
|
|
334
65
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
66
|
+
- **Type:** `MessageType`
|
|
67
|
+
- **Default:** `undefined`
|
|
68
|
+
- **Possible Values:** `info, warning, error, success`
|
|
338
69
|
|
|
339
70
|
```tsx
|
|
340
|
-
import
|
|
341
|
-
import { Button } from '
|
|
342
|
-
import { Horizontal } from '
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
</
|
|
362
|
-
|
|
363
|
-
</
|
|
364
|
-
)
|
|
365
|
-
|
|
366
|
-
<Message.Overlay isOpen={showWithout} onClose={() => setShowWithout(false)}>
|
|
367
|
-
<Message.Container>
|
|
368
|
-
<Message.Header buttonPosition="none"> Without</Message.Header>
|
|
369
|
-
<Message.Body>Cras mattis consectetur purus sit amet fermentum.</Message.Body>
|
|
370
|
-
<Message.Footer>
|
|
371
|
-
<Button onClick={() => setShowWithout(false)}>Cancel</Button>
|
|
372
|
-
</Message.Footer>
|
|
373
|
-
</Message.Container>
|
|
374
|
-
</Message.Overlay>
|
|
375
|
-
)}
|
|
376
|
-
{showLeft && (
|
|
377
|
-
<Message.Overlay isOpen={showLeft} onClose={() => setShowLeft(false)}>
|
|
378
|
-
<Message.Container>
|
|
379
|
-
<Message.Header buttonPosition="left">Left</Message.Header>
|
|
380
|
-
<Message.Body>Cras mattis consectetur purus sit amet fermentum.</Message.Body>
|
|
381
|
-
<Message.Footer>
|
|
382
|
-
<Button onClick={() => setShowLeft(false)}>Cancel</Button>
|
|
383
|
-
</Message.Footer>
|
|
384
|
-
</Message.Container>
|
|
385
|
-
</Message.Overlay>
|
|
386
|
-
)}
|
|
387
|
-
</>;
|
|
71
|
+
import React from 'react';
|
|
72
|
+
import { Button } from '@app-studio/web';
|
|
73
|
+
import { Horizontal } from 'app-studio';
|
|
74
|
+
import { showMessage } from '@app-studio/web';
|
|
75
|
+
import { MessageType } from '@app-studio/web';
|
|
76
|
+
|
|
77
|
+
export const VariantDemo = () => {
|
|
78
|
+
return (
|
|
79
|
+
<Horizontal gap={10}>
|
|
80
|
+
{['info', 'error', 'warning', 'success'].map((variant, index) => (
|
|
81
|
+
<Button
|
|
82
|
+
key={index}
|
|
83
|
+
onClick={() =>
|
|
84
|
+
showMessage(
|
|
85
|
+
variant as MessageType,
|
|
86
|
+
`${variant.toUpperCase()} toast here!`
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
isAuto
|
|
90
|
+
>
|
|
91
|
+
Show {variant}
|
|
92
|
+
</Button>
|
|
93
|
+
))}
|
|
94
|
+
</Horizontal>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
388
97
|
```
|
|
389
98
|
|
|
390
|
-
|
|
99
|
+
### **title**
|
|
100
|
+
The main title or heading of the message.
|
|
391
101
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
A vertical scroll is displayed, if the content height exceed the body height.
|
|
102
|
+
- **Type:** `string`
|
|
103
|
+
- **Default:** `undefined`
|
|
104
|
+
- **Possible Values:** ``
|
|
397
105
|
|
|
398
106
|
```tsx
|
|
399
|
-
import
|
|
400
|
-
import { Button } from '
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
</Text>
|
|
414
|
-
</Message.Header>
|
|
415
|
-
<Message.Body height="200px">
|
|
416
|
-
Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis
|
|
417
|
-
consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur
|
|
418
|
-
purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit
|
|
419
|
-
amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet Cras
|
|
420
|
-
mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis
|
|
421
|
-
consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur
|
|
422
|
-
purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit
|
|
423
|
-
amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet
|
|
424
|
-
fermentum.Cras mattis consectetur purus sit amet fermentum.
|
|
425
|
-
</Message.Body>
|
|
426
|
-
<Message.Footer>
|
|
427
|
-
<Button onClick={() => setShow(false)}>Cancel</Button>
|
|
428
|
-
</Message.Footer>
|
|
429
|
-
</Message.Container>
|
|
430
|
-
</Message.Overlay>
|
|
431
|
-
)}
|
|
432
|
-
</>;
|
|
107
|
+
import React from 'react';
|
|
108
|
+
import { Button } from '@app-studio/web';
|
|
109
|
+
|
|
110
|
+
import { showMessage } from '@app-studio/web';
|
|
111
|
+
|
|
112
|
+
export const TitleDemo = () => {
|
|
113
|
+
return (
|
|
114
|
+
<Button
|
|
115
|
+
onClick={() => showMessage('info', 'Here is some important information.')}
|
|
116
|
+
>
|
|
117
|
+
Show Toast
|
|
118
|
+
</Button>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
433
121
|
```
|
|
434
122
|
|
|
435
|
-
|
|
123
|
+
### **isClosable**
|
|
124
|
+
Determines if the message can be manually closed by the user.
|
|
436
125
|
|
|
437
|
-
|
|
126
|
+
- **Type:** `boolean`
|
|
127
|
+
- **Default:** `false`
|
|
128
|
+
- **Possible Values:** `true, false`
|
|
438
129
|
|
|
439
130
|
```tsx
|
|
440
|
-
import
|
|
441
|
-
import { Button } from '
|
|
442
|
-
import {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
</
|
|
464
|
-
</
|
|
465
|
-
|
|
466
|
-
)
|
|
467
|
-
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
## **Types**
|
|
471
|
-
|
|
472
|
-
```tsx
|
|
473
|
-
type Position = 'top' | 'left' | 'right' | 'bottom' | 'center';
|
|
131
|
+
import React from 'react';
|
|
132
|
+
import { Button } from '@app-studio/web';
|
|
133
|
+
import { Horizontal } from 'app-studio';
|
|
134
|
+
|
|
135
|
+
import { showMessage } from '@app-studio/web';
|
|
136
|
+
|
|
137
|
+
export const IsClosableDemo = () => {
|
|
138
|
+
return (
|
|
139
|
+
<>
|
|
140
|
+
<Horizontal gap={10} position="relative">
|
|
141
|
+
<Button
|
|
142
|
+
onClick={() =>
|
|
143
|
+
showMessage(
|
|
144
|
+
'success',
|
|
145
|
+
'Scheduled: Catch up',
|
|
146
|
+
'Friday, February 10, 2023 at 5:57 PM',
|
|
147
|
+
{
|
|
148
|
+
isClosable: true,
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
>
|
|
153
|
+
Close Button
|
|
154
|
+
</Button>
|
|
155
|
+
</Horizontal>
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
474
159
|
```
|
|
475
160
|
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
```
|
|
161
|
+
### **action**
|
|
162
|
+
A callback function to execute when the action button is clicked.
|
|
479
163
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
164
|
+
- **Type:** `Function`
|
|
165
|
+
- **Default:** `undefined`
|
|
166
|
+
- **Possible Values:** ``
|
|
483
167
|
|
|
484
168
|
```tsx
|
|
485
|
-
|
|
169
|
+
import React from 'react';
|
|
170
|
+
import { Button } from '@app-studio/web';
|
|
171
|
+
import { showMessage } from '@app-studio/web';
|
|
172
|
+
// Defines the `ActionDemo` functional component that encapsulates the button interaction logic.
|
|
173
|
+
export const ActionDemo = () => {
|
|
174
|
+
return (
|
|
175
|
+
<Button
|
|
176
|
+
onClick={() =>
|
|
177
|
+
showMessage(
|
|
178
|
+
'success',
|
|
179
|
+
'Scheduled: Catch up',
|
|
180
|
+
'Friday, February 10, 2023 at 5:57 PM'
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
isAuto
|
|
184
|
+
>
|
|
185
|
+
Add Calendar
|
|
186
|
+
</Button>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
486
189
|
```
|
|
487
190
|
|
|
488
|
-
|
|
191
|
+
### **showIcon**
|
|
192
|
+
Determines if an icon corresponding to the message variant should be displayed.
|
|
489
193
|
|
|
490
|
-
|
|
194
|
+
- **Type:** `boolean`
|
|
195
|
+
- **Default:** `false`
|
|
196
|
+
- **Possible Values:** `true, false`
|
|
491
197
|
|
|
492
198
|
```tsx
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
199
|
+
import React from 'react';
|
|
200
|
+
import { Button } from '@app-studio/web';
|
|
201
|
+
|
|
202
|
+
import { showMessage } from '@app-studio/web';
|
|
203
|
+
|
|
204
|
+
export const ShowIconDemo = () => {
|
|
205
|
+
return (
|
|
206
|
+
<Button
|
|
207
|
+
onClick={() =>
|
|
208
|
+
showMessage(
|
|
209
|
+
'warning',
|
|
210
|
+
'Scheduled: Catch up',
|
|
211
|
+
'Friday, February 10, 2023 at 5:57 PM',
|
|
212
|
+
{
|
|
213
|
+
showIcon: true,
|
|
214
|
+
}
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
>
|
|
218
|
+
Add Calendar
|
|
219
|
+
</Button>
|
|
220
|
+
);
|
|
499
221
|
};
|
|
500
222
|
```
|
|
501
223
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
```tsx
|
|
505
|
-
const ContainerShapes: Record<Shape, CSSProperties> = {
|
|
506
|
-
sharp: { borderRadius: 0 },
|
|
507
|
-
rounded: { borderRadius: 4 },
|
|
508
|
-
};
|
|
509
|
-
```
|
|
224
|
+
### **timeout**
|
|
225
|
+
The duration in milliseconds after which the message automatically hides.
|
|
510
226
|
|
|
511
|
-
|
|
227
|
+
- **Type:** `number`
|
|
228
|
+
- **Default:** `3000`
|
|
229
|
+
- **Possible Values:** ``
|
|
512
230
|
|
|
513
231
|
```tsx
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
232
|
+
import React from 'react';
|
|
233
|
+
import { Button } from '@app-studio/web';
|
|
234
|
+
|
|
235
|
+
import { showMessage } from '@app-studio/web';
|
|
236
|
+
|
|
237
|
+
export const TimeoutDemo = () => {
|
|
238
|
+
return (
|
|
239
|
+
<Button
|
|
240
|
+
onClick={() =>
|
|
241
|
+
showMessage(
|
|
242
|
+
'info',
|
|
243
|
+
'Info Message',
|
|
244
|
+
'Here is some important information.',
|
|
245
|
+
{
|
|
246
|
+
timeout: 1000,
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
>
|
|
251
|
+
Add Calendar
|
|
252
|
+
</Button>
|
|
253
|
+
);
|
|
520
254
|
};
|
|
521
255
|
```
|
|
522
256
|
|
|
523
|
-
</file_content>
|
|
524
|
-
|
|
525
|
-
Try again with fewer/more precise SEARCH blocks.
|
|
526
|
-
(If you run into this error two times in a row, you may use the write_to_file tool as a fallback.)
|
|
527
|
-
</error><environment_details>
|
|
528
|
-
# VSCode Visible Files
|
|
529
|
-
public/files/media/Message.mdx
|
|
530
|
-
|
|
531
|
-
# VSCode Open Tabs
|
|
532
|
-
src/components/Form/CountryPicker/CountryPicker/CountryPicker.view.tsx
|
|
533
|
-
src/components/DragAndDrop/DragAndDrop.tsx
|
|
534
|
-
public/files/media/DragAndDrop.mdx
|
|
535
|
-
public/files/media/File.mdx
|
|
536
|
-
public/files/media/Form.mdx
|
|
537
|
-
public/files/media/Formik.mdx
|
|
538
|
-
public/files/media/Icon.mdx
|
|
539
|
-
public/files/media/Uploader.mdx
|
|
540
|
-
public/files/media/Alert.mdx
|
|
541
|
-
public/files/media/AspectRatio.mdx
|
|
542
|
-
public/files/media/Avatar.mdx
|
|
543
|
-
public/files/media/Badge.mdx
|
|
544
|
-
public/files/media/Button.mdx
|
|
545
|
-
public/files/media/Center.mdx
|
|
546
|
-
public/files/media/Checkbox.mdx
|
|
547
|
-
public/files/media/ComboBox.mdx
|
|
548
|
-
public/files/media/CountryPicker.mdx
|
|
549
|
-
public/files/media/DatePicker.mdx
|
|
550
|
-
public/files/media/Horizontal.mdx
|
|
551
|
-
public/files/media/Label.mdx
|
|
552
|
-
public/files/media/Link.mdx
|
|
553
|
-
public/files/media/Loader.mdx
|
|
554
|
-
public/files/media/Message.mdx
|
|
555
|
-
src/components/Button/Button/Button.view.tsx
|
|
556
|
-
src/utils/componentsPageImports.tsx
|
|
557
|
-
src/components/Uploader/Uploader.tsx
|
|
558
|
-
src/components/Uploader/Uploader.props.ts
|
|
559
|
-
src/pages/upload.page.tsx
|
|
560
|
-
src/components/index.tsx
|
|
561
|
-
src/components/Text/Text.tsx
|
|
562
|
-
src/components/Text/Text/Text.view.tsx
|
|
563
|
-
package.json
|
|
564
|
-
src/components/Button/examples/effect.tsx
|
|
565
|
-
|
|
566
|
-
# Current Time
|
|
567
|
-
22/03/2025 9:02:50 PM (Africa/Dar_es_Salaam, UTC+3:00)
|
|
568
|
-
|
|
569
|
-
# Current Mode
|
|
570
|
-
ACT MODE
|
|
571
|
-
</environment_details>
|