@slotted/react 0.1.0-beta.42 → 0.1.0-beta.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/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
- package/dist/app-shell.js +1 -1
- package/dist/attachment-TZykYNu5.js +300 -0
- package/dist/attachment.js +2 -2
- package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
- package/dist/avatar-group.js +1 -1
- package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
- package/dist/command-palette.js +1 -1
- package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
- package/dist/data-list.js +1 -1
- package/dist/detail-panel-Cke3ZFU3.js +342 -0
- package/dist/detail-panel.js +2 -2
- package/dist/docs/action-bar.examples.md +768 -0
- package/dist/docs/action-bar.json +74 -50
- package/dist/docs/action-bar.md +49 -311
- package/dist/docs/app-shell.examples.md +1221 -64
- package/dist/docs/app-shell.json +92 -60
- package/dist/docs/app-shell.md +92 -57
- package/dist/docs/attachment.examples.md +689 -0
- package/dist/docs/attachment.json +69 -37
- package/dist/docs/attachment.md +44 -203
- package/dist/docs/avatar-group.json +111 -23
- package/dist/docs/avatar-group.md +487 -28
- package/dist/docs/button-group.json +98 -2
- package/dist/docs/button-group.md +411 -8
- package/dist/docs/calendar.examples.md +512 -0
- package/dist/docs/calendar.json +72 -24
- package/dist/docs/calendar.md +18 -147
- package/dist/docs/carousel.examples.md +868 -0
- package/dist/docs/carousel.json +58 -50
- package/dist/docs/carousel.md +66 -300
- package/dist/docs/cascader.examples.md +1269 -0
- package/dist/docs/cascader.json +72 -16
- package/dist/docs/cascader.md +78 -154
- package/dist/docs/chart.examples.md +734 -24
- package/dist/docs/chart.json +93 -13
- package/dist/docs/chart.md +28 -7
- package/dist/docs/clock.json +71 -15
- package/dist/docs/clock.md +326 -21
- package/dist/docs/code-block.json +79 -55
- package/dist/docs/code-block.md +417 -74
- package/dist/docs/color-picker.json +60 -12
- package/dist/docs/color-picker.md +245 -22
- package/dist/docs/column-manager.examples.md +764 -0
- package/dist/docs/column-manager.json +68 -12
- package/dist/docs/column-manager.md +44 -203
- package/dist/docs/command-palette.examples.md +747 -0
- package/dist/docs/command-palette.json +48 -24
- package/dist/docs/command-palette.md +60 -339
- package/dist/docs/currency-field.examples.md +355 -73
- package/dist/docs/currency-field.json +96 -64
- package/dist/docs/currency-field.md +57 -50
- package/dist/docs/dashboard-grid.examples.md +629 -0
- package/dist/docs/dashboard-grid.json +64 -16
- package/dist/docs/dashboard-grid.md +34 -152
- package/dist/docs/data-list.examples.md +1556 -0
- package/dist/docs/data-list.json +58 -18
- package/dist/docs/data-list.md +139 -224
- package/dist/docs/date-field.examples.md +543 -0
- package/dist/docs/date-field.json +64 -24
- package/dist/docs/date-field.md +22 -168
- package/dist/docs/datetime-field.examples.md +699 -0
- package/dist/docs/datetime-field.json +79 -31
- package/dist/docs/datetime-field.md +24 -269
- package/dist/docs/datetime-range-picker.examples.md +682 -0
- package/dist/docs/datetime-range-picker.json +117 -61
- package/dist/docs/datetime-range-picker.md +59 -224
- package/dist/docs/description-list.examples.md +652 -0
- package/dist/docs/description-list.json +49 -25
- package/dist/docs/description-list.md +33 -188
- package/dist/docs/detail-panel.examples.md +1177 -0
- package/dist/docs/detail-panel.json +69 -53
- package/dist/docs/detail-panel.md +114 -324
- package/dist/docs/entity-picker.examples.md +1037 -0
- package/dist/docs/entity-picker.json +66 -18
- package/dist/docs/entity-picker.md +56 -246
- package/dist/docs/event-calendar.examples.md +749 -49
- package/dist/docs/event-calendar.json +46 -22
- package/dist/docs/event-calendar.md +81 -11
- package/dist/docs/field-group.examples.md +554 -0
- package/dist/docs/field-group.json +98 -34
- package/dist/docs/field-group.md +55 -133
- package/dist/docs/filter-bar.examples.md +772 -0
- package/dist/docs/filter-bar.json +41 -25
- package/dist/docs/filter-bar.md +42 -246
- package/dist/docs/form.examples.md +579 -0
- package/dist/docs/form.json +87 -39
- package/dist/docs/form.md +53 -177
- package/dist/docs/fullscreen.examples.md +558 -0
- package/dist/docs/fullscreen.json +58 -18
- package/dist/docs/fullscreen.md +50 -169
- package/dist/docs/highlight.json +57 -25
- package/dist/docs/highlight.md +402 -50
- package/dist/docs/icon.json +85 -5
- package/dist/docs/icon.md +401 -10
- package/dist/docs/image.examples.md +670 -0
- package/dist/docs/image.json +44 -28
- package/dist/docs/image.md +24 -176
- package/dist/docs/import-export-center.examples.md +1280 -0
- package/dist/docs/import-export-center.json +67 -27
- package/dist/docs/import-export-center.md +121 -226
- package/dist/docs/list-item.examples.md +769 -0
- package/dist/docs/list-item.json +110 -38
- package/dist/docs/list-item.md +84 -201
- package/dist/docs/listbox.examples.md +858 -0
- package/dist/docs/listbox.json +76 -28
- package/dist/docs/listbox.md +41 -263
- package/dist/docs/markdown.json +79 -55
- package/dist/docs/markdown.md +581 -85
- package/dist/docs/media-viewer.examples.md +1038 -0
- package/dist/docs/media-viewer.json +70 -15
- package/dist/docs/media-viewer.md +84 -135
- package/dist/docs/message-scroller.examples.md +1193 -0
- package/dist/docs/message-scroller.json +41 -17
- package/dist/docs/message-scroller.md +80 -134
- package/dist/docs/message.examples.md +944 -0
- package/dist/docs/message.json +64 -16
- package/dist/docs/message.md +34 -326
- package/dist/docs/meter.json +58 -26
- package/dist/docs/meter.md +312 -32
- package/dist/docs/navigation-menu.examples.md +1107 -0
- package/dist/docs/navigation-menu.json +57 -41
- package/dist/docs/navigation-menu.md +105 -298
- package/dist/docs/notification-center.examples.md +1045 -0
- package/dist/docs/notification-center.json +71 -15
- package/dist/docs/notification-center.md +76 -266
- package/dist/docs/otp-input.examples.md +490 -0
- package/dist/docs/otp-input.json +65 -25
- package/dist/docs/otp-input.md +20 -191
- package/dist/docs/page-header.examples.md +1041 -0
- package/dist/docs/page-header.json +75 -43
- package/dist/docs/page-header.md +79 -291
- package/dist/docs/page.examples.md +633 -0
- package/dist/docs/page.json +48 -16
- package/dist/docs/page.md +62 -129
- package/dist/docs/prompt-composer.examples.md +630 -0
- package/dist/docs/prompt-composer.json +66 -18
- package/dist/docs/prompt-composer.md +35 -161
- package/dist/docs/prose.json +69 -37
- package/dist/docs/prose.md +393 -75
- package/dist/docs/rating.examples.md +525 -0
- package/dist/docs/rating.json +92 -28
- package/dist/docs/rating.md +27 -241
- package/dist/docs/saved-views.examples.md +1108 -0
- package/dist/docs/saved-views.json +53 -21
- package/dist/docs/saved-views.md +86 -171
- package/dist/docs/scroll-area.examples.md +837 -0
- package/dist/docs/scroll-area.json +64 -24
- package/dist/docs/scroll-area.md +57 -140
- package/dist/docs/section.examples.md +676 -0
- package/dist/docs/section.json +68 -20
- package/dist/docs/section.md +39 -162
- package/dist/docs/segmented-control.examples.md +480 -0
- package/dist/docs/segmented-control.json +76 -28
- package/dist/docs/segmented-control.md +20 -191
- package/dist/docs/side-navigation.examples.md +1468 -0
- package/dist/docs/side-navigation.json +53 -53
- package/dist/docs/side-navigation.md +79 -354
- package/dist/docs/slider.examples.md +505 -0
- package/dist/docs/slider.json +91 -51
- package/dist/docs/slider.md +47 -212
- package/dist/docs/sparkline.json +60 -36
- package/dist/docs/sparkline.md +447 -71
- package/dist/docs/split-button.examples.md +509 -0
- package/dist/docs/split-button.json +73 -41
- package/dist/docs/split-button.md +64 -194
- package/dist/docs/splitter.examples.md +921 -0
- package/dist/docs/splitter.json +94 -46
- package/dist/docs/splitter.md +75 -182
- package/dist/docs/stat-card.examples.md +725 -0
- package/dist/docs/stat-card.json +89 -41
- package/dist/docs/stat-card.md +55 -227
- package/dist/docs/status-indicator.json +80 -32
- package/dist/docs/status-indicator.md +409 -65
- package/dist/docs/stepper.json +53 -21
- package/dist/docs/stepper.md +369 -48
- package/dist/docs/table-of-contents.examples.md +550 -0
- package/dist/docs/table-of-contents.json +60 -28
- package/dist/docs/table-of-contents.md +70 -205
- package/dist/docs/tags-input.examples.md +541 -0
- package/dist/docs/tags-input.json +64 -16
- package/dist/docs/tags-input.md +15 -262
- package/dist/docs/time-field.examples.md +587 -0
- package/dist/docs/time-field.json +69 -29
- package/dist/docs/time-field.md +21 -223
- package/dist/docs/time-picker.json +117 -53
- package/dist/docs/time-picker.md +499 -54
- package/dist/docs/time-range-picker.examples.md +750 -0
- package/dist/docs/time-range-picker.json +139 -75
- package/dist/docs/time-range-picker.md +63 -225
- package/dist/docs/timeline.examples.md +617 -0
- package/dist/docs/timeline.json +44 -28
- package/dist/docs/timeline.md +34 -208
- package/dist/docs/toolbar.json +56 -16
- package/dist/docs/toolbar.md +357 -63
- package/dist/docs/top-navigation.examples.md +1206 -140
- package/dist/docs/top-navigation.json +49 -33
- package/dist/docs/top-navigation.md +87 -36
- package/dist/docs/tour.examples.md +960 -0
- package/dist/docs/tour.json +57 -25
- package/dist/docs/tour.md +60 -244
- package/dist/docs/transfer.examples.md +631 -0
- package/dist/docs/transfer.json +80 -16
- package/dist/docs/transfer.md +41 -170
- package/dist/docs/typography.json +96 -0
- package/dist/docs/typography.md +352 -4
- package/dist/docs/upload.examples.md +555 -53
- package/dist/docs/upload.json +62 -30
- package/dist/docs/upload.md +46 -11
- package/dist/docs/wizard.examples.md +1389 -0
- package/dist/docs/wizard.json +89 -49
- package/dist/docs/wizard.md +122 -263
- package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +58 -58
- package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
- package/dist/media-viewer.js +2 -2
- package/dist/message-P91bEGyV.js +455 -0
- package/dist/message.js +2 -2
- package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
- package/dist/page-header.js +1 -1
- package/dist/section-CVTQdWBl.js +216 -0
- package/dist/section.js +2 -2
- package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
- package/dist/side-navigation.js +1 -1
- package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
- package/dist/stat-card.js +1 -1
- package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
- package/dist/stepper.js +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
- package/dist/timeline.js +1 -1
- package/dist/top-navigation-YSEQzBhD.js +744 -0
- package/dist/top-navigation.js +2 -2
- package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
- package/dist/transfer.js +1 -1
- package/dist/types/attachment/attachment-parts.d.ts +24 -11
- package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
- package/dist/types/attachment/attachment.d.ts +3 -3
- package/dist/types/attachment/attachment.d.ts.map +1 -1
- package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/command-palette/command-palette.d.ts.map +1 -1
- package/dist/types/data-list/data-list.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
- package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
- package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
- package/dist/types/media-viewer/index.d.ts +2 -2
- package/dist/types/media-viewer/index.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
- package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
- package/dist/types/message/message-parts.d.ts +7 -0
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.d.ts.map +1 -1
- package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
- package/dist/types/section/section-parts.d.ts +16 -8
- package/dist/types/section/section-parts.d.ts.map +1 -1
- package/dist/types/section/section.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper-parts.d.ts +11 -2
- package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper.d.ts.map +1 -1
- package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
- package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
- package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
- package/dist/wizard.js +1 -1
- package/package.json +6 -6
- package/dist/attachment-MqczA38F.js +0 -292
- package/dist/detail-panel-EImAtksY.js +0 -327
- package/dist/message-D1Dd6Y2k.js +0 -452
- package/dist/section-D_qOfdxR.js +0 -213
- package/dist/top-navigation-D8IHPOmm.js +0 -744
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
<!-- index: ./index.md -->
|
|
2
|
+
# message
|
|
3
|
+
|
|
4
|
+
`data-ui="message"` · Chat message with author, bubble and actions.
|
|
5
|
+
|
|
6
|
+
## Examples
|
|
7
|
+
|
|
8
|
+
### Playground
|
|
9
|
+
|
|
10
|
+
One row with its side, layout, action visibility and status on the controls. Switch status to failed, read or streaming and watch the article’s own states and the receipt follow.
|
|
11
|
+
|
|
12
|
+
Excerpt — not a complete module
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
<Message align="start" status="read">
|
|
16
|
+
<MessageBody>
|
|
17
|
+
<Bubble>
|
|
18
|
+
<BubbleContent>Tuesday's payout came back with error R03.</BubbleContent>
|
|
19
|
+
</Bubble>
|
|
20
|
+
</MessageBody>
|
|
21
|
+
</Message>;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Two sides, asked once
|
|
25
|
+
|
|
26
|
+
align lives on the row. A bubble in an end row paints the accent’s fill by itself; a bubble in a start row the secondary tint. Nothing is repeated on the bubble.
|
|
27
|
+
|
|
28
|
+
Excerpt — not a complete module
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Message align="end">
|
|
32
|
+
<MessageBody>
|
|
33
|
+
<Bubble>
|
|
34
|
+
<BubbleContent>Great. I will resend as soon as it arrives.</BubbleContent>
|
|
35
|
+
</Bubble>
|
|
36
|
+
</MessageBody>
|
|
37
|
+
</Message>;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### The avatar at the foot of the words
|
|
41
|
+
|
|
42
|
+
The avatar sits on the line of the last bubble, not of the footer under it, and moves to the end side with the row. It is the avatar family’s small step, so it follows the density.
|
|
43
|
+
|
|
44
|
+
Excerpt — not a complete module
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<Message>
|
|
48
|
+
<MessageAvatar>
|
|
49
|
+
<Avatar name="Marta Silva" size="sm" />
|
|
50
|
+
</MessageAvatar>
|
|
51
|
+
<MessageBody>
|
|
52
|
+
<Bubble>
|
|
53
|
+
<BubbleContent>It arrives this afternoon.</BubbleContent>
|
|
54
|
+
</Bubble>
|
|
55
|
+
</MessageBody>
|
|
56
|
+
</Message>;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### A run from one sender
|
|
60
|
+
|
|
61
|
+
Three rows, one avatar on the last. The rows stand two pixels apart and the corners facing each other on the sender’s side draw in to four; the earlier rows keep the avatar column without an empty slot.
|
|
62
|
+
|
|
63
|
+
Excerpt — not a complete module
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
<MessageGroup>
|
|
67
|
+
<Message>
|
|
68
|
+
<MessageBody>
|
|
69
|
+
<Bubble>
|
|
70
|
+
<BubbleContent>Tuesday's payout came back with error R03.</BubbleContent>
|
|
71
|
+
</Bubble>
|
|
72
|
+
</MessageBody>
|
|
73
|
+
</Message>
|
|
74
|
+
<Message>
|
|
75
|
+
<MessageAvatar>
|
|
76
|
+
<Avatar name="Marta Silva" size="sm" />
|
|
77
|
+
</MessageAvatar>
|
|
78
|
+
<MessageBody>
|
|
79
|
+
<Bubble>
|
|
80
|
+
<BubbleContent>It arrives this afternoon.</BubbleContent>
|
|
81
|
+
</Bubble>
|
|
82
|
+
</MessageBody>
|
|
83
|
+
</Message>
|
|
84
|
+
</MessageGroup>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Who spoke, and when
|
|
88
|
+
|
|
89
|
+
The header sets the name on the inset of the words, so the name stands over the first letter it names. The dot between name and hour is drawn by the stylesheet and never read aloud.
|
|
90
|
+
|
|
91
|
+
Excerpt — not a complete module
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<MessageHeader>
|
|
95
|
+
<MessageAuthor>Marta Silva</MessageAuthor>
|
|
96
|
+
<MessageTime dateTime="2026-09-30T09:38">09:38</MessageTime>
|
|
97
|
+
</MessageHeader>;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Where a message is in its delivery
|
|
101
|
+
|
|
102
|
+
Inside the bubble the hour and the mark ride at the end of the last line: a breathing clock while sending, one tick, two ticks, and two ticks in full ink once read. A message that did not go says so in a word under it, with the retry control beside it.
|
|
103
|
+
|
|
104
|
+
Excerpt — not a complete module
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<Message align="end" status="read">
|
|
108
|
+
<MessageBody>
|
|
109
|
+
<Bubble>
|
|
110
|
+
<BubbleContent>
|
|
111
|
+
And I mark the invoice as paid only after the credit.
|
|
112
|
+
<BubbleMeta>
|
|
113
|
+
<MessageTime dateTime="2026-09-30T09:41">09:41</MessageTime>
|
|
114
|
+
<MessageReceipt />
|
|
115
|
+
</BubbleMeta>
|
|
116
|
+
</BubbleContent>
|
|
117
|
+
</Bubble>
|
|
118
|
+
</MessageBody>
|
|
119
|
+
</Message>;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Actions the row reveals
|
|
123
|
+
|
|
124
|
+
With actionsVisibility="hover" the toolbar keeps its room and appears under the pointer and on focus anywhere in the row; on a screen that cannot hover it is always painted. Tab into the row to see it arrive.
|
|
125
|
+
|
|
126
|
+
Excerpt — not a complete module
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
<MessageFooter>
|
|
130
|
+
<MessageActions>
|
|
131
|
+
<IconButton aria-label="Copy reply" variant="ghost" size="sm">
|
|
132
|
+
<Icon>
|
|
133
|
+
<Glyph name="copy" />
|
|
134
|
+
</Icon>
|
|
135
|
+
</IconButton>
|
|
136
|
+
</MessageActions>
|
|
137
|
+
</MessageFooter>;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### What a reply is doing before it has words
|
|
141
|
+
|
|
142
|
+
Steps done carry a tick and step back into the muted ink; the current one carries the shared ring and a band of light across its words. Under reduced motion the band stops and the words stand in the plain ink.
|
|
143
|
+
|
|
144
|
+
Example
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { Glyph, Icon } from '@slotted/react/icon';
|
|
148
|
+
import { Message, MessageActivity, MessageActivityStep, MessageBody } from '@slotted/react/message';
|
|
149
|
+
import { Stack } from '@slotted/react/stack';
|
|
150
|
+
|
|
151
|
+
export default function MessageActivityExample() {
|
|
152
|
+
return (
|
|
153
|
+
<Stack gap={4}>
|
|
154
|
+
<Message status="streaming">
|
|
155
|
+
<MessageBody>
|
|
156
|
+
<MessageActivity>
|
|
157
|
+
<MessageActivityStep
|
|
158
|
+
status="complete"
|
|
159
|
+
icon={
|
|
160
|
+
<Icon>
|
|
161
|
+
<Glyph name="file-text" />
|
|
162
|
+
</Icon>
|
|
163
|
+
}
|
|
164
|
+
>
|
|
165
|
+
Read the payout log for 28 September
|
|
166
|
+
</MessageActivityStep>
|
|
167
|
+
<MessageActivityStep
|
|
168
|
+
status="complete"
|
|
169
|
+
icon={
|
|
170
|
+
<Icon>
|
|
171
|
+
<Glyph name="file-spreadsheet" />
|
|
172
|
+
</Icon>
|
|
173
|
+
}
|
|
174
|
+
>
|
|
175
|
+
Matched 126 payouts to the bank file
|
|
176
|
+
</MessageActivityStep>
|
|
177
|
+
<MessageActivityStep
|
|
178
|
+
status="current"
|
|
179
|
+
icon={
|
|
180
|
+
<Icon>
|
|
181
|
+
<Glyph name="search" />
|
|
182
|
+
</Icon>
|
|
183
|
+
}
|
|
184
|
+
>
|
|
185
|
+
Looking for the cause of error R03
|
|
186
|
+
</MessageActivityStep>
|
|
187
|
+
<MessageActivityStep
|
|
188
|
+
status="pending"
|
|
189
|
+
icon={
|
|
190
|
+
<Icon>
|
|
191
|
+
<Glyph name="pencil" />
|
|
192
|
+
</Icon>
|
|
193
|
+
}
|
|
194
|
+
>
|
|
195
|
+
Drafting the reply
|
|
196
|
+
</MessageActivityStep>
|
|
197
|
+
</MessageActivity>
|
|
198
|
+
</MessageBody>
|
|
199
|
+
</Message>
|
|
200
|
+
<Message>
|
|
201
|
+
<MessageBody>
|
|
202
|
+
<MessageActivity variant="plain">
|
|
203
|
+
<MessageActivityStep status="complete">
|
|
204
|
+
Checked the carrier calendar
|
|
205
|
+
</MessageActivityStep>
|
|
206
|
+
<MessageActivityStep>Comparing the three pickup windows</MessageActivityStep>
|
|
207
|
+
</MessageActivity>
|
|
208
|
+
</MessageBody>
|
|
209
|
+
</Message>
|
|
210
|
+
<Message>
|
|
211
|
+
<MessageBody>
|
|
212
|
+
<MessageActivity shimmer={false}>
|
|
213
|
+
<MessageActivityStep>Waiting for the bank to confirm the credit</MessageActivityStep>
|
|
214
|
+
</MessageActivity>
|
|
215
|
+
</MessageBody>
|
|
216
|
+
</Message>
|
|
217
|
+
</Stack>
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Versions of one reply
|
|
223
|
+
|
|
224
|
+
The pager draws with two or more versions and stops at both ends. ArrowLeft and ArrowRight page from either control, mirrored in a right-to-left page; the label is a polite live region.
|
|
225
|
+
|
|
226
|
+
Excerpt — not a complete module
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
<Message versionCount={3} version={version} onVersionChange={setVersion}>
|
|
230
|
+
<MessageBody>
|
|
231
|
+
<Bubble>
|
|
232
|
+
<BubbleContent>{drafts[version]}</BubbleContent>
|
|
233
|
+
</Bubble>
|
|
234
|
+
<MessageFooter>
|
|
235
|
+
<MessageVersions />
|
|
236
|
+
</MessageFooter>
|
|
237
|
+
</MessageBody>
|
|
238
|
+
</Message>;
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### A comment thread
|
|
242
|
+
|
|
243
|
+
layout="thread" sets every row at the start with the avatar at the top, the name inline, the words unframed and a band under the pointer; the actions float at the row’s top end on a raised plate.
|
|
244
|
+
|
|
245
|
+
Excerpt — not a complete module
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
<Message layout="thread">
|
|
249
|
+
<MessageAvatar>
|
|
250
|
+
<Avatar name="Emily Parker" />
|
|
251
|
+
</MessageAvatar>
|
|
252
|
+
<MessageBody>
|
|
253
|
+
<MessageHeader>
|
|
254
|
+
<MessageAuthor>Emily Parker</MessageAuthor>
|
|
255
|
+
<MessageTime dateTime="2026-09-30T09:12">4 minutes ago</MessageTime>
|
|
256
|
+
</MessageHeader>
|
|
257
|
+
<Bubble>
|
|
258
|
+
<BubbleContent>Can we name the SSO owner before the review?</BubbleContent>
|
|
259
|
+
</Bubble>
|
|
260
|
+
</MessageBody>
|
|
261
|
+
</Message>;
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Playground
|
|
265
|
+
|
|
266
|
+
One bubble with its variant, tone and clamp on the controls. A bubble outside a row takes the provider’s painting; inside one it takes the row’s side.
|
|
267
|
+
|
|
268
|
+
Excerpt — not a complete module
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
<Bubble variant="soft" tone="secondary">
|
|
272
|
+
<BubbleContent>The destination account does not exist at the bank.</BubbleContent>
|
|
273
|
+
</Bubble>;
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Four paintings
|
|
277
|
+
|
|
278
|
+
solid is the tone’s fill, soft its tint with a rim that shows only in high contrast, outline its edge on the page, plain no box at all — the unframed answer that takes the whole row.
|
|
279
|
+
|
|
280
|
+
Excerpt — not a complete module
|
|
281
|
+
|
|
282
|
+
```tsx
|
|
283
|
+
<Bubble variant="solid" tone="accent">
|
|
284
|
+
…
|
|
285
|
+
</Bubble>;
|
|
286
|
+
<Bubble variant="soft">…</Bubble>;
|
|
287
|
+
<Bubble variant="outline">…</Bubble>;
|
|
288
|
+
<Bubble variant="plain">…</Bubble>;
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Six tones
|
|
292
|
+
|
|
293
|
+
accent and secondary write in the page’s ink; info, success, warning and danger in their own, because there the color of the words is the point — and the words say it too.
|
|
294
|
+
|
|
295
|
+
Excerpt — not a complete module
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
<Bubble tone="danger">
|
|
299
|
+
<BubbleContent>Step 5 failed and the worker did not come back.</BubbleContent>
|
|
300
|
+
</Bubble>;
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Quick replies and links
|
|
304
|
+
|
|
305
|
+
render turns the surface itself into a button or an a, and it keeps the painting, the hover, a distinct press and the focus ring. A link keeps middle-click and its destination.
|
|
306
|
+
|
|
307
|
+
Example
|
|
308
|
+
|
|
309
|
+
```tsx
|
|
310
|
+
import { Bubble, BubbleContent } from '@slotted/react/message';
|
|
311
|
+
import { Inline } from '@slotted/react/inline';
|
|
312
|
+
import { Stack } from '@slotted/react/stack';
|
|
313
|
+
import { Text } from '@slotted/react/typography';
|
|
314
|
+
import { useState } from 'react';
|
|
315
|
+
|
|
316
|
+
export default function MessageInteractiveExample() {
|
|
317
|
+
const [choice, setChoice] = useState('No reply chosen yet.');
|
|
318
|
+
|
|
319
|
+
return (
|
|
320
|
+
<Stack gap={3}>
|
|
321
|
+
<Text size="sm" tone="muted">
|
|
322
|
+
{choice}
|
|
323
|
+
</Text>
|
|
324
|
+
<Inline gap={2}>
|
|
325
|
+
<Bubble variant="outline" tone="accent">
|
|
326
|
+
<BubbleContent
|
|
327
|
+
render={(props) => (
|
|
328
|
+
<button
|
|
329
|
+
type="button"
|
|
330
|
+
{...props}
|
|
331
|
+
onClick={() => {
|
|
332
|
+
setChoice('Chosen: resend both payouts now.');
|
|
333
|
+
}}
|
|
334
|
+
/>
|
|
335
|
+
)}
|
|
336
|
+
>
|
|
337
|
+
Resend both payouts now
|
|
338
|
+
</BubbleContent>
|
|
339
|
+
</Bubble>
|
|
340
|
+
<Bubble variant="outline" tone="accent">
|
|
341
|
+
<BubbleContent
|
|
342
|
+
render={(props) => (
|
|
343
|
+
<button
|
|
344
|
+
type="button"
|
|
345
|
+
{...props}
|
|
346
|
+
onClick={() => {
|
|
347
|
+
setChoice('Chosen: wait for the bank statement.');
|
|
348
|
+
}}
|
|
349
|
+
/>
|
|
350
|
+
)}
|
|
351
|
+
>
|
|
352
|
+
Wait for the statement
|
|
353
|
+
</BubbleContent>
|
|
354
|
+
</Bubble>
|
|
355
|
+
</Inline>
|
|
356
|
+
<Bubble>
|
|
357
|
+
<BubbleContent render={(props) => <a href="#payout-7731" {...props} />}>
|
|
358
|
+
Open payout 7731
|
|
359
|
+
</BubbleContent>
|
|
360
|
+
</Bubble>
|
|
361
|
+
</Stack>
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Replying to a message
|
|
367
|
+
|
|
368
|
+
The quote heads the surface in a block tinted with the surface’s own ink, author over up to three lines. With onJump it is a button that asks the scroller to take the reader to the quoted message.
|
|
369
|
+
|
|
370
|
+
Example
|
|
371
|
+
|
|
372
|
+
```tsx
|
|
373
|
+
import { Bubble, BubbleContent, BubbleQuote, Message, MessageBody } from '@slotted/react/message';
|
|
374
|
+
import { Stack } from '@slotted/react/stack';
|
|
375
|
+
import { Text } from '@slotted/react/typography';
|
|
376
|
+
import { useState } from 'react';
|
|
377
|
+
|
|
378
|
+
export default function MessageQuoteExample() {
|
|
379
|
+
const [jumped, setJumped] = useState(false);
|
|
380
|
+
|
|
381
|
+
return (
|
|
382
|
+
<Stack gap={4}>
|
|
383
|
+
<Message align="end">
|
|
384
|
+
<MessageBody>
|
|
385
|
+
<Bubble>
|
|
386
|
+
<BubbleContent>
|
|
387
|
+
<BubbleQuote
|
|
388
|
+
author="Marta Silva"
|
|
389
|
+
onJump={() => {
|
|
390
|
+
setJumped(true);
|
|
391
|
+
}}
|
|
392
|
+
>
|
|
393
|
+
The destination account does not exist at the bank.
|
|
394
|
+
</BubbleQuote>
|
|
395
|
+
Send me the IBAN when it arrives.
|
|
396
|
+
</BubbleContent>
|
|
397
|
+
</Bubble>
|
|
398
|
+
</MessageBody>
|
|
399
|
+
</Message>
|
|
400
|
+
<Text size="sm" tone="muted">
|
|
401
|
+
{jumped ? 'The scroller would now show the quoted message.' : 'Press the quote to jump.'}
|
|
402
|
+
</Text>
|
|
403
|
+
<Message>
|
|
404
|
+
<MessageBody>
|
|
405
|
+
<Bubble>
|
|
406
|
+
<BubbleContent>
|
|
407
|
+
<BubbleQuote author="You">Send me the IBAN when it arrives.</BubbleQuote>
|
|
408
|
+
It arrives this afternoon.
|
|
409
|
+
</BubbleContent>
|
|
410
|
+
</Bubble>
|
|
411
|
+
</MessageBody>
|
|
412
|
+
</Message>
|
|
413
|
+
</Stack>
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### A long reply, clamped
|
|
419
|
+
|
|
420
|
+
maxLines shows the first lines and draws “Show more” only while the text overflows. The whole text stays in the DOM for copying and finding in the page; the chevron turns as it opens.
|
|
421
|
+
|
|
422
|
+
Example
|
|
423
|
+
|
|
424
|
+
```tsx
|
|
425
|
+
import { Bubble, BubbleContent } from '@slotted/react/message';
|
|
426
|
+
import { Stack } from '@slotted/react/stack';
|
|
427
|
+
import { useState } from 'react';
|
|
428
|
+
|
|
429
|
+
const REPORT =
|
|
430
|
+
'Payout 7731 was returned by the bank with error R03. The IBAN on file does not match any account, ' +
|
|
431
|
+
'so the credit never reached supplier 3310. Finance resubmitted the payout on 29 September after ' +
|
|
432
|
+
'confirming the new IBAN by phone, and the bank accepted the file at 16:20. The credit is expected ' +
|
|
433
|
+
'on the next business day. Invoice 5502 stays open until the credit appears on the statement.';
|
|
434
|
+
|
|
435
|
+
export default function MessageClampExample() {
|
|
436
|
+
const [open, setOpen] = useState(true);
|
|
437
|
+
|
|
438
|
+
return (
|
|
439
|
+
<Stack gap={4}>
|
|
440
|
+
<Bubble maxLines={3}>
|
|
441
|
+
<BubbleContent>{REPORT}</BubbleContent>
|
|
442
|
+
</Bubble>
|
|
443
|
+
<Bubble
|
|
444
|
+
maxLines={3}
|
|
445
|
+
revealed={open}
|
|
446
|
+
onRevealedChange={(next) => {
|
|
447
|
+
setOpen(next);
|
|
448
|
+
}}
|
|
449
|
+
>
|
|
450
|
+
<BubbleContent>{REPORT}</BubbleContent>
|
|
451
|
+
</Bubble>
|
|
452
|
+
</Stack>
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### A reply while it streams
|
|
458
|
+
|
|
459
|
+
Words arrive in bursts. BubbleStream splits each arrival into words, and a burst enters as a wave of at most 320 ms, each word out of a blur; nothing is held back from the DOM. The dot breathes after the last word. The row is aria-busy, so the words are not read as they land. Under reduced motion every word lands settled and the dot stands lit.
|
|
460
|
+
|
|
461
|
+
Example
|
|
462
|
+
|
|
463
|
+
```tsx
|
|
464
|
+
import { Button } from '@slotted/react/button';
|
|
465
|
+
import { Inline } from '@slotted/react/inline';
|
|
466
|
+
import {
|
|
467
|
+
Bubble,
|
|
468
|
+
BubbleCaret,
|
|
469
|
+
BubbleContent,
|
|
470
|
+
BubbleStream,
|
|
471
|
+
BubbleTyping,
|
|
472
|
+
Message,
|
|
473
|
+
MessageBody,
|
|
474
|
+
} from '@slotted/react/message';
|
|
475
|
+
import { Stack } from '@slotted/react/stack';
|
|
476
|
+
import { useEffect, useState } from 'react';
|
|
477
|
+
|
|
478
|
+
const ARRIVALS = [
|
|
479
|
+
'Payout 7731',
|
|
480
|
+
'Payout 7731 was returned by the bank',
|
|
481
|
+
'Payout 7731 was returned by the bank with error R03, which means that no account matches',
|
|
482
|
+
'Payout 7731 was returned by the bank with error R03, which means that no account matches the IBAN on file. Send the new IBAN to finance to resubmit the payout.',
|
|
483
|
+
];
|
|
484
|
+
|
|
485
|
+
export default function MessageStreamingExample() {
|
|
486
|
+
const [received, setReceived] = useState(1);
|
|
487
|
+
|
|
488
|
+
useEffect(() => {
|
|
489
|
+
if (received >= ARRIVALS.length) return;
|
|
490
|
+
|
|
491
|
+
const timer = setTimeout(() => {
|
|
492
|
+
setReceived(received + 1);
|
|
493
|
+
}, 900);
|
|
494
|
+
|
|
495
|
+
return () => {
|
|
496
|
+
clearTimeout(timer);
|
|
497
|
+
};
|
|
498
|
+
}, [received]);
|
|
499
|
+
|
|
500
|
+
const done = received >= ARRIVALS.length;
|
|
501
|
+
|
|
502
|
+
function handleReplay() {
|
|
503
|
+
setReceived(1);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return (
|
|
507
|
+
<Stack gap={4}>
|
|
508
|
+
<Message>
|
|
509
|
+
<MessageBody>
|
|
510
|
+
<Bubble>
|
|
511
|
+
<BubbleContent>
|
|
512
|
+
<BubbleTyping aria-label="Marta is typing" />
|
|
513
|
+
</BubbleContent>
|
|
514
|
+
</Bubble>
|
|
515
|
+
</MessageBody>
|
|
516
|
+
</Message>
|
|
517
|
+
<Message status={done ? undefined : 'streaming'}>
|
|
518
|
+
<MessageBody>
|
|
519
|
+
<Bubble>
|
|
520
|
+
<BubbleContent>
|
|
521
|
+
<BubbleStream text={ARRIVALS[received - 1] ?? ''} />
|
|
522
|
+
{done ? null : <BubbleCaret />}
|
|
523
|
+
</BubbleContent>
|
|
524
|
+
</Bubble>
|
|
525
|
+
</MessageBody>
|
|
526
|
+
</Message>
|
|
527
|
+
<Inline>
|
|
528
|
+
<Button variant="outline" size="sm" onClick={handleReplay}>
|
|
529
|
+
Replay
|
|
530
|
+
</Button>
|
|
531
|
+
</Inline>
|
|
532
|
+
</Stack>
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Someone is writing
|
|
538
|
+
|
|
539
|
+
Three dots rise and brighten in a wave in the writer’s bubble, which trails two circles of its own fill and edge and arrives rising from them. It is one image named for assistive technology.
|
|
540
|
+
|
|
541
|
+
Excerpt — not a complete module
|
|
542
|
+
|
|
543
|
+
```tsx
|
|
544
|
+
<Bubble>
|
|
545
|
+
<BubbleContent>
|
|
546
|
+
<BubbleTyping aria-label="Marta is typing" />
|
|
547
|
+
</BubbleContent>
|
|
548
|
+
</Bubble>;
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### Reactions
|
|
552
|
+
|
|
553
|
+
The pill straddles the lower edge on the side away from the sender and rises into the surface by half its inset, clear of the words. The reader’s own reaction takes the accent’s tint and edge; a disabled one stays legible.
|
|
554
|
+
|
|
555
|
+
Example
|
|
556
|
+
|
|
557
|
+
```tsx
|
|
558
|
+
import {
|
|
559
|
+
Bubble,
|
|
560
|
+
BubbleContent,
|
|
561
|
+
BubbleReaction,
|
|
562
|
+
BubbleReactions,
|
|
563
|
+
Message,
|
|
564
|
+
MessageBody,
|
|
565
|
+
} from '@slotted/react/message';
|
|
566
|
+
import { useState } from 'react';
|
|
567
|
+
|
|
568
|
+
export default function MessageReactionsExample() {
|
|
569
|
+
const [confirmed, setConfirmed] = useState(true);
|
|
570
|
+
|
|
571
|
+
return (
|
|
572
|
+
<Message>
|
|
573
|
+
<MessageBody>
|
|
574
|
+
<Bubble>
|
|
575
|
+
<BubbleContent>The warehouse confirmed the new pickup window for Friday.</BubbleContent>
|
|
576
|
+
<BubbleReactions>
|
|
577
|
+
<BubbleReaction
|
|
578
|
+
count={confirmed ? 4 : 3}
|
|
579
|
+
pressed={confirmed}
|
|
580
|
+
onPressedChange={(next) => {
|
|
581
|
+
setConfirmed(next);
|
|
582
|
+
}}
|
|
583
|
+
>
|
|
584
|
+
Confirmed
|
|
585
|
+
</BubbleReaction>
|
|
586
|
+
<BubbleReaction count={1}>Needs review</BubbleReaction>
|
|
587
|
+
<BubbleReaction count={2} disabled>
|
|
588
|
+
Duplicate
|
|
589
|
+
</BubbleReaction>
|
|
590
|
+
</BubbleReactions>
|
|
591
|
+
</Bubble>
|
|
592
|
+
</MessageBody>
|
|
593
|
+
</Message>
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### Content nobody chose
|
|
599
|
+
|
|
600
|
+
A URL of a hundred characters breaks where it must instead of pushing the bubble past its share; an Arabic line in an English thread reads from its own side; a two-letter reply is still a bubble, not a pill.
|
|
601
|
+
|
|
602
|
+
Excerpt — not a complete module
|
|
603
|
+
|
|
604
|
+
```tsx
|
|
605
|
+
<Bubble>
|
|
606
|
+
<BubbleContent>{text}</BubbleContent>
|
|
607
|
+
</Bubble>;
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
### conversation.tsx
|
|
611
|
+
|
|
612
|
+
Example
|
|
613
|
+
|
|
614
|
+
```tsx
|
|
615
|
+
import { Avatar } from '@slotted/react/avatar';
|
|
616
|
+
import {
|
|
617
|
+
Bubble,
|
|
618
|
+
BubbleContent,
|
|
619
|
+
BubbleMeta,
|
|
620
|
+
Message,
|
|
621
|
+
MessageAvatar,
|
|
622
|
+
MessageBody,
|
|
623
|
+
MessageGroup,
|
|
624
|
+
MessageReceipt,
|
|
625
|
+
MessageTime,
|
|
626
|
+
} from '@slotted/react/message';
|
|
627
|
+
import { Stack } from '@slotted/react/stack';
|
|
628
|
+
|
|
629
|
+
export default function MessageConversationExample() {
|
|
630
|
+
return (
|
|
631
|
+
<Stack gap={4}>
|
|
632
|
+
<MessageGroup>
|
|
633
|
+
<Message>
|
|
634
|
+
<MessageBody>
|
|
635
|
+
<Bubble>
|
|
636
|
+
<BubbleContent>Tuesday's payout came back with error R03.</BubbleContent>
|
|
637
|
+
</Bubble>
|
|
638
|
+
</MessageBody>
|
|
639
|
+
</Message>
|
|
640
|
+
<Message>
|
|
641
|
+
<MessageBody>
|
|
642
|
+
<Bubble>
|
|
643
|
+
<BubbleContent>The destination account does not exist at the bank.</BubbleContent>
|
|
644
|
+
</Bubble>
|
|
645
|
+
</MessageBody>
|
|
646
|
+
</Message>
|
|
647
|
+
<Message>
|
|
648
|
+
<MessageAvatar>
|
|
649
|
+
<Avatar name="Marta Silva" size="sm" />
|
|
650
|
+
</MessageAvatar>
|
|
651
|
+
<MessageBody>
|
|
652
|
+
<Bubble>
|
|
653
|
+
<BubbleContent>Send me the new IBAN and I will resubmit it today.</BubbleContent>
|
|
654
|
+
</Bubble>
|
|
655
|
+
</MessageBody>
|
|
656
|
+
</Message>
|
|
657
|
+
</MessageGroup>
|
|
658
|
+
<Message align="end" status="read">
|
|
659
|
+
<MessageBody>
|
|
660
|
+
<Bubble>
|
|
661
|
+
<BubbleContent>
|
|
662
|
+
Understood. The finance team will send it before noon.
|
|
663
|
+
<BubbleMeta>
|
|
664
|
+
<MessageTime dateTime="2026-09-30T09:41">09:41</MessageTime>
|
|
665
|
+
<MessageReceipt />
|
|
666
|
+
</BubbleMeta>
|
|
667
|
+
</BubbleContent>
|
|
668
|
+
</Bubble>
|
|
669
|
+
</MessageBody>
|
|
670
|
+
</Message>
|
|
671
|
+
</Stack>
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### delivery.tsx
|
|
677
|
+
|
|
678
|
+
Example
|
|
679
|
+
|
|
680
|
+
```tsx
|
|
681
|
+
import {
|
|
682
|
+
Bubble,
|
|
683
|
+
BubbleContent,
|
|
684
|
+
BubbleMeta,
|
|
685
|
+
BubbleRetry,
|
|
686
|
+
Message,
|
|
687
|
+
MessageBody,
|
|
688
|
+
MessageFooter,
|
|
689
|
+
MessageReceipt,
|
|
690
|
+
MessageTime,
|
|
691
|
+
} from '@slotted/react/message';
|
|
692
|
+
import { Stack } from '@slotted/react/stack';
|
|
693
|
+
import { useState } from 'react';
|
|
694
|
+
|
|
695
|
+
export default function MessageDeliveryExample() {
|
|
696
|
+
const [failed, setFailed] = useState(true);
|
|
697
|
+
|
|
698
|
+
return (
|
|
699
|
+
<Stack gap={4}>
|
|
700
|
+
<Message align="end" status="sending">
|
|
701
|
+
<MessageBody>
|
|
702
|
+
<Bubble>
|
|
703
|
+
<BubbleContent>
|
|
704
|
+
Sending: the credit note for invoice 5502.
|
|
705
|
+
<BubbleMeta>
|
|
706
|
+
<MessageTime dateTime="2026-09-30T10:02">10:02</MessageTime>
|
|
707
|
+
<MessageReceipt />
|
|
708
|
+
</BubbleMeta>
|
|
709
|
+
</BubbleContent>
|
|
710
|
+
</Bubble>
|
|
711
|
+
</MessageBody>
|
|
712
|
+
</Message>
|
|
713
|
+
<Message align="end" status="sent">
|
|
714
|
+
<MessageBody>
|
|
715
|
+
<Bubble>
|
|
716
|
+
<BubbleContent>
|
|
717
|
+
Sent: the refund for order 4821 is approved.
|
|
718
|
+
<BubbleMeta>
|
|
719
|
+
<MessageTime dateTime="2026-09-30T10:03">10:03</MessageTime>
|
|
720
|
+
<MessageReceipt />
|
|
721
|
+
</BubbleMeta>
|
|
722
|
+
</BubbleContent>
|
|
723
|
+
</Bubble>
|
|
724
|
+
</MessageBody>
|
|
725
|
+
</Message>
|
|
726
|
+
<Message align="end" status="delivered">
|
|
727
|
+
<MessageBody>
|
|
728
|
+
<Bubble>
|
|
729
|
+
<BubbleContent>
|
|
730
|
+
Delivered: the shipment label is attached.
|
|
731
|
+
<BubbleMeta>
|
|
732
|
+
<MessageTime dateTime="2026-09-30T10:04">10:04</MessageTime>
|
|
733
|
+
<MessageReceipt />
|
|
734
|
+
</BubbleMeta>
|
|
735
|
+
</BubbleContent>
|
|
736
|
+
</Bubble>
|
|
737
|
+
</MessageBody>
|
|
738
|
+
</Message>
|
|
739
|
+
<Message align="end" status="read">
|
|
740
|
+
<MessageBody>
|
|
741
|
+
<Bubble>
|
|
742
|
+
<BubbleContent>
|
|
743
|
+
Read: the payout is back on the bank file.
|
|
744
|
+
<BubbleMeta>
|
|
745
|
+
<MessageTime dateTime="2026-09-30T10:05">10:05</MessageTime>
|
|
746
|
+
<MessageReceipt />
|
|
747
|
+
</BubbleMeta>
|
|
748
|
+
</BubbleContent>
|
|
749
|
+
</Bubble>
|
|
750
|
+
</MessageBody>
|
|
751
|
+
</Message>
|
|
752
|
+
<Message
|
|
753
|
+
align="end"
|
|
754
|
+
status={failed ? 'failed' : 'sending'}
|
|
755
|
+
onRetry={() => {
|
|
756
|
+
setFailed(false);
|
|
757
|
+
}}
|
|
758
|
+
>
|
|
759
|
+
<MessageBody>
|
|
760
|
+
<Bubble>
|
|
761
|
+
<BubbleContent>The new IBAN for supplier 3310 is ready.</BubbleContent>
|
|
762
|
+
<BubbleRetry />
|
|
763
|
+
</Bubble>
|
|
764
|
+
<MessageFooter>
|
|
765
|
+
<MessageReceipt />
|
|
766
|
+
</MessageFooter>
|
|
767
|
+
</MessageBody>
|
|
768
|
+
</Message>
|
|
769
|
+
</Stack>
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
### footer.tsx
|
|
775
|
+
|
|
776
|
+
Example
|
|
777
|
+
|
|
778
|
+
```tsx
|
|
779
|
+
import { IconButton } from '@slotted/react/button';
|
|
780
|
+
import { Glyph } from '@slotted/react/icon';
|
|
781
|
+
import {
|
|
782
|
+
Bubble,
|
|
783
|
+
BubbleContent,
|
|
784
|
+
Message,
|
|
785
|
+
MessageActions,
|
|
786
|
+
MessageBody,
|
|
787
|
+
MessageFooter,
|
|
788
|
+
MessageVersions,
|
|
789
|
+
} from '@slotted/react/message';
|
|
790
|
+
import { Stack } from '@slotted/react/stack';
|
|
791
|
+
import { useState } from 'react';
|
|
792
|
+
|
|
793
|
+
const DRAFTS = [
|
|
794
|
+
'The payout failed because the destination account does not exist at the bank.',
|
|
795
|
+
'The bank returned the payout with error R03: no account matches the IBAN on file.',
|
|
796
|
+
'Payout 7731 was returned. The IBAN on file does not match any account at the bank.',
|
|
797
|
+
];
|
|
798
|
+
|
|
799
|
+
export default function MessageFooterExample() {
|
|
800
|
+
const [version, setVersion] = useState(0);
|
|
801
|
+
|
|
802
|
+
return (
|
|
803
|
+
<Stack gap={4}>
|
|
804
|
+
<Message
|
|
805
|
+
actionsVisibility="always"
|
|
806
|
+
version={version}
|
|
807
|
+
versionCount={DRAFTS.length}
|
|
808
|
+
onVersionChange={(next) => {
|
|
809
|
+
setVersion(next);
|
|
810
|
+
}}
|
|
811
|
+
>
|
|
812
|
+
<MessageBody>
|
|
813
|
+
<Bubble>
|
|
814
|
+
<BubbleContent>{DRAFTS[version]}</BubbleContent>
|
|
815
|
+
</Bubble>
|
|
816
|
+
<MessageFooter>
|
|
817
|
+
<MessageVersions />
|
|
818
|
+
<MessageActions>
|
|
819
|
+
<IconButton aria-label="Copy reply" variant="ghost" size="sm">
|
|
820
|
+
<Glyph name="copy" />
|
|
821
|
+
</IconButton>
|
|
822
|
+
<IconButton aria-label="Regenerate reply" variant="ghost" size="sm">
|
|
823
|
+
<Glyph name="rotate-cw" />
|
|
824
|
+
</IconButton>
|
|
825
|
+
</MessageActions>
|
|
826
|
+
</MessageFooter>
|
|
827
|
+
</MessageBody>
|
|
828
|
+
</Message>
|
|
829
|
+
<Message actionsVisibility="hover">
|
|
830
|
+
<MessageBody>
|
|
831
|
+
<Bubble>
|
|
832
|
+
<BubbleContent>Hover the message or tab into it to reveal its actions.</BubbleContent>
|
|
833
|
+
</Bubble>
|
|
834
|
+
<MessageFooter>
|
|
835
|
+
<MessageActions>
|
|
836
|
+
<IconButton aria-label="Copy reply" variant="ghost" size="sm">
|
|
837
|
+
<Glyph name="copy" />
|
|
838
|
+
</IconButton>
|
|
839
|
+
</MessageActions>
|
|
840
|
+
</MessageFooter>
|
|
841
|
+
</MessageBody>
|
|
842
|
+
</Message>
|
|
843
|
+
</Stack>
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
### painting.tsx
|
|
849
|
+
|
|
850
|
+
Example
|
|
851
|
+
|
|
852
|
+
```tsx
|
|
853
|
+
import { Bubble, BubbleContent } from '@slotted/react/message';
|
|
854
|
+
import { Stack } from '@slotted/react/stack';
|
|
855
|
+
|
|
856
|
+
export default function MessagePaintingExample() {
|
|
857
|
+
return (
|
|
858
|
+
<Stack gap={3}>
|
|
859
|
+
<Bubble variant="solid" tone="accent">
|
|
860
|
+
<BubbleContent>Solid accent: order 4821 is ready to ship.</BubbleContent>
|
|
861
|
+
</Bubble>
|
|
862
|
+
<Bubble variant="soft" tone="secondary">
|
|
863
|
+
<BubbleContent>Soft secondary: the carrier confirmed pickup at 14:00.</BubbleContent>
|
|
864
|
+
</Bubble>
|
|
865
|
+
<Bubble variant="outline" tone="info">
|
|
866
|
+
<BubbleContent>Outline info: the customs form was attached to the shipment.</BubbleContent>
|
|
867
|
+
</Bubble>
|
|
868
|
+
<Bubble variant="plain" tone="success">
|
|
869
|
+
<BubbleContent>Plain success: payout 7731 settled with the bank.</BubbleContent>
|
|
870
|
+
</Bubble>
|
|
871
|
+
<Bubble variant="soft" tone="warning">
|
|
872
|
+
<BubbleContent>
|
|
873
|
+
Soft warning: stock for SKU 2208 falls below its reorder point.
|
|
874
|
+
</BubbleContent>
|
|
875
|
+
</Bubble>
|
|
876
|
+
<Bubble variant="solid" tone="danger">
|
|
877
|
+
<BubbleContent>Solid danger: step 5 failed and the worker did not come back.</BubbleContent>
|
|
878
|
+
</Bubble>
|
|
879
|
+
</Stack>
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
### thread.tsx
|
|
885
|
+
|
|
886
|
+
Example
|
|
887
|
+
|
|
888
|
+
```tsx
|
|
889
|
+
import { Avatar } from '@slotted/react/avatar';
|
|
890
|
+
import {
|
|
891
|
+
Bubble,
|
|
892
|
+
BubbleContent,
|
|
893
|
+
BubbleReaction,
|
|
894
|
+
BubbleReactions,
|
|
895
|
+
Message,
|
|
896
|
+
MessageAuthor,
|
|
897
|
+
MessageAvatar,
|
|
898
|
+
MessageBody,
|
|
899
|
+
MessageDefaultsProvider,
|
|
900
|
+
MessageHeader,
|
|
901
|
+
MessageTime,
|
|
902
|
+
} from '@slotted/react/message';
|
|
903
|
+
import { Stack } from '@slotted/react/stack';
|
|
904
|
+
|
|
905
|
+
export default function MessageThreadExample() {
|
|
906
|
+
return (
|
|
907
|
+
<MessageDefaultsProvider layout="thread">
|
|
908
|
+
<Stack gap={4}>
|
|
909
|
+
<Message>
|
|
910
|
+
<MessageAvatar>
|
|
911
|
+
<Avatar name="Emily Parker" />
|
|
912
|
+
</MessageAvatar>
|
|
913
|
+
<MessageBody>
|
|
914
|
+
<MessageHeader>
|
|
915
|
+
<MessageAuthor>Emily Parker</MessageAuthor>
|
|
916
|
+
<MessageTime dateTime="2026-09-30T09:12">4 minutes ago</MessageTime>
|
|
917
|
+
</MessageHeader>
|
|
918
|
+
<Bubble>
|
|
919
|
+
<BubbleContent>Can we name the SSO owner before the vendor review?</BubbleContent>
|
|
920
|
+
<BubbleReactions>
|
|
921
|
+
<BubbleReaction count={3}>Agree</BubbleReaction>
|
|
922
|
+
</BubbleReactions>
|
|
923
|
+
</Bubble>
|
|
924
|
+
</MessageBody>
|
|
925
|
+
</Message>
|
|
926
|
+
<Message>
|
|
927
|
+
<MessageAvatar>
|
|
928
|
+
<Avatar name="Tomas Berg" />
|
|
929
|
+
</MessageAvatar>
|
|
930
|
+
<MessageBody>
|
|
931
|
+
<MessageHeader>
|
|
932
|
+
<MessageAuthor>Tomas Berg</MessageAuthor>
|
|
933
|
+
<MessageTime dateTime="2026-09-30T09:15">1 minute ago</MessageTime>
|
|
934
|
+
</MessageHeader>
|
|
935
|
+
<Bubble>
|
|
936
|
+
<BubbleContent>Marta Silva owns it. I will add her to the review.</BubbleContent>
|
|
937
|
+
</Bubble>
|
|
938
|
+
</MessageBody>
|
|
939
|
+
</Message>
|
|
940
|
+
</Stack>
|
|
941
|
+
</MessageDefaultsProvider>
|
|
942
|
+
);
|
|
943
|
+
}
|
|
944
|
+
```
|