astryx-dracula 0.5.0 → 0.5.1
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/astryx.integration.mjs +1 -1
- package/icons.mjs +17 -17
- package/icons.tsx +61 -62
- package/package.json +120 -120
- package/shared/auth-chrome-config.ts +6 -6
- package/shared/auth-chrome.tsx +143 -144
- package/shared/auth-copy.ts +14 -14
- package/shared/chaptered-doc-config.ts +48 -51
- package/shared/chaptered-doc.tsx +268 -289
- package/shared/chart-hues.ts +10 -10
- package/shared/chart-labels.tsx +31 -30
- package/shared/chart-legend.tsx +55 -56
- package/shared/chart-panel-style.ts +3 -3
- package/shared/data-bar.tsx +97 -102
- package/shared/format-money.ts +1 -1
- package/shared/gallery-image.ts +6 -6
- package/shared/login-demo.ts +1 -1
- package/shared/metric-card.tsx +101 -105
- package/shared/metric-delta.tsx +28 -27
- package/shared/order-desk.tsx +205 -216
- package/shared/revenue-chart.tsx +145 -165
- package/shared/scene-castle.tsx +206 -291
- package/shared/scene-frame.tsx +33 -32
- package/shared/scene-hues.ts +17 -17
- package/shared/scene-tile.tsx +88 -92
- package/shared/settings-data.ts +125 -125
- package/shared/settings-rows.tsx +142 -157
- package/shared/sparkline.tsx +75 -88
- package/shared/sso-icons.tsx +10 -22
- package/shared/stars.tsx +16 -25
- package/templates/ai-chat-landing.template.mjs +4 -4
- package/templates/ai-chat-landing.tsx +449 -458
- package/templates/ai-chat.template.mjs +4 -4
- package/templates/ai-chat.tsx +538 -609
- package/templates/blank.template.mjs +4 -4
- package/templates/blank.tsx +14 -12
- package/templates/centered-hero.template.mjs +4 -4
- package/templates/centered-hero.tsx +52 -67
- package/templates/classic-gallery.template.mjs +4 -4
- package/templates/classic-gallery.tsx +92 -101
- package/templates/contact-form.template.mjs +4 -4
- package/templates/contact-form.tsx +243 -280
- package/templates/dashboard-portfolio.template.mjs +4 -4
- package/templates/dashboard-portfolio.tsx +713 -546
- package/templates/dashboard.template.mjs +4 -4
- package/templates/dashboard.tsx +592 -565
- package/templates/detail-page.template.mjs +4 -4
- package/templates/detail-page.tsx +537 -594
- package/templates/documentation-design.template.mjs +4 -4
- package/templates/documentation-design.tsx +227 -241
- package/templates/documentation-technical.template.mjs +4 -4
- package/templates/documentation-technical.tsx +232 -237
- package/templates/documentation.template.mjs +4 -4
- package/templates/documentation.tsx +263 -277
- package/templates/editor.template.mjs +4 -4
- package/templates/editor.tsx +839 -874
- package/templates/file-explorer.template.mjs +4 -4
- package/templates/file-explorer.tsx +562 -588
- package/templates/form-two-column.template.mjs +4 -4
- package/templates/form-two-column.tsx +187 -208
- package/templates/gallery-hero.template.mjs +4 -4
- package/templates/gallery-hero.tsx +89 -112
- package/templates/ide.template.mjs +4 -4
- package/templates/ide.tsx +400 -451
- package/templates/incident-console.template.mjs +4 -4
- package/templates/incident-console.tsx +549 -573
- package/templates/kanban-board.template.mjs +4 -4
- package/templates/kanban-board.tsx +660 -680
- package/templates/library.template.mjs +4 -4
- package/templates/library.tsx +405 -428
- package/templates/login-card.template.mjs +4 -4
- package/templates/login-card.tsx +59 -70
- package/templates/login-split.template.mjs +4 -4
- package/templates/login-split.tsx +188 -192
- package/templates/login-sso.template.mjs +4 -4
- package/templates/login-sso.tsx +253 -256
- package/templates/login.template.mjs +4 -4
- package/templates/login.tsx +49 -47
- package/templates/messaging-shell.template.mjs +4 -4
- package/templates/messaging-shell.tsx +550 -572
- package/templates/mixed-gallery.template.mjs +4 -4
- package/templates/mixed-gallery.tsx +56 -56
- package/templates/payment-form.template.mjs +4 -4
- package/templates/payment-form.tsx +877 -988
- package/templates/product-detail.template.mjs +4 -4
- package/templates/product-detail.tsx +252 -270
- package/templates/product-gallery.template.mjs +4 -4
- package/templates/product-gallery.tsx +122 -135
- package/templates/product-tour.template.mjs +4 -4
- package/templates/product-tour.tsx +733 -768
- package/templates/settings-dialog.template.mjs +4 -4
- package/templates/settings-dialog.tsx +684 -715
- package/templates/settings-sidebar.template.mjs +4 -4
- package/templates/settings-sidebar.tsx +758 -805
- package/templates/settings.template.mjs +4 -4
- package/templates/settings.tsx +291 -302
- package/templates/shell-nav.template.mjs +4 -4
- package/templates/shell-nav.tsx +212 -217
- package/templates/shell-side-nav.template.mjs +4 -4
- package/templates/shell-side-nav.tsx +128 -155
- package/templates/shell-top-nav.template.mjs +4 -4
- package/templates/shell-top-nav.tsx +178 -201
- package/templates/side-gallery.template.mjs +4 -4
- package/templates/side-gallery.tsx +81 -88
- package/templates/table-grouped.template.mjs +4 -4
- package/templates/table-grouped.tsx +996 -1051
- package/templates/table-page-chart.template.mjs +4 -4
- package/templates/table-page-chart.tsx +396 -396
- package/templates/table-page-heatmap-status.template.mjs +4 -4
- package/templates/table-page-heatmap-status.tsx +479 -510
- package/templates/table-page-shoe-store-heatmap.template.mjs +4 -4
- package/templates/table-page-shoe-store-heatmap.tsx +744 -744
- package/templates/table-page.template.mjs +4 -4
- package/templates/table-page.tsx +392 -403
- package/templates/table.template.mjs +4 -4
- package/templates/table.tsx +88 -91
- package/templates/tech-report.template.mjs +4 -4
- package/templates/tech-report.tsx +1312 -1302
- package/templates/theme-showcase.template.mjs +4 -4
- package/templates/theme-showcase.tsx +863 -949
- package/tokens.css +340 -343
|
@@ -6,57 +6,55 @@
|
|
|
6
6
|
* Messaging Shell — Slack-style column frame for team messaging tools. Frame (desktop, left to right): (Frame/responsive/container: see XLE header above.)
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { Avatar, AvatarStatusDot } from "@astryxdesign/core/Avatar";
|
|
10
|
+
import { Badge } from "@astryxdesign/core/Badge";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from
|
|
20
|
-
import {
|
|
12
|
+
ChatComposer,
|
|
13
|
+
ChatLayout,
|
|
14
|
+
ChatMessage,
|
|
15
|
+
ChatMessageBubble,
|
|
16
|
+
ChatMessageList,
|
|
17
|
+
ChatMessageMetadata,
|
|
18
|
+
ChatSystemMessage,
|
|
19
|
+
} from "@astryxdesign/core/Chat";
|
|
20
|
+
import { Divider } from "@astryxdesign/core/Divider";
|
|
21
|
+
import { EmptyState } from "@astryxdesign/core/EmptyState";
|
|
22
|
+
import { useMediaQuery } from "@astryxdesign/core/hooks";
|
|
23
|
+
import { Icon } from "@astryxdesign/core/Icon";
|
|
24
|
+
import { IconButton } from "@astryxdesign/core/IconButton";
|
|
21
25
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from
|
|
30
|
-
import {
|
|
31
|
-
import {StatusDot} from
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
36
|
-
import {Timestamp} from '@astryxdesign/core/Timestamp';
|
|
37
|
-
import {EmptyState} from '@astryxdesign/core/EmptyState';
|
|
38
|
-
import {Icon} from '@astryxdesign/core/Icon';
|
|
39
|
-
import {IconButton} from '@astryxdesign/core/IconButton';
|
|
40
|
-
import {useMediaQuery} from '@astryxdesign/core/hooks';
|
|
41
|
-
|
|
26
|
+
HStack,
|
|
27
|
+
Layout,
|
|
28
|
+
LayoutContent,
|
|
29
|
+
LayoutPanel,
|
|
30
|
+
Stack,
|
|
31
|
+
StackItem,
|
|
32
|
+
VStack,
|
|
33
|
+
} from "@astryxdesign/core/Layout";
|
|
34
|
+
import { List, ListItem } from "@astryxdesign/core/List";
|
|
35
|
+
import { StatusDot } from "@astryxdesign/core/StatusDot";
|
|
36
|
+
import { Heading, Text } from "@astryxdesign/core/Text";
|
|
37
|
+
import { TextInput } from "@astryxdesign/core/TextInput";
|
|
38
|
+
import { Timestamp } from "@astryxdesign/core/Timestamp";
|
|
42
39
|
// ============= ICONS (verified lucide-react exports) =============
|
|
43
40
|
// Bell ← BellIcon, Bookmark ← BookmarkIcon, MessagesSquare ← ChatBubbleLeftRightIcon,
|
|
44
41
|
// Settings ← Cog6ToothIcon, Hash ← HashtagIcon, House ← HomeIcon, Inbox ← InboxIcon,
|
|
45
42
|
// Search ← MagnifyingGlassIcon, SquarePen ← PencilSquareIcon, Users ← UserGroupIcon,
|
|
46
43
|
// X ← XMarkIcon.
|
|
47
44
|
import {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} from
|
|
45
|
+
Bell,
|
|
46
|
+
Bookmark,
|
|
47
|
+
Hash,
|
|
48
|
+
House,
|
|
49
|
+
Inbox,
|
|
50
|
+
MessagesSquare,
|
|
51
|
+
Search,
|
|
52
|
+
Settings,
|
|
53
|
+
SquarePen,
|
|
54
|
+
Users,
|
|
55
|
+
X,
|
|
56
|
+
} from "lucide-react";
|
|
57
|
+
import { type CSSProperties, type ReactNode, useState } from "react";
|
|
60
58
|
|
|
61
59
|
// ---------------------------------------------------------------------------
|
|
62
60
|
// Styles — semantic tokens only. Layout/Stack own their padding via props,
|
|
@@ -66,360 +64,350 @@ import {
|
|
|
66
64
|
|
|
67
65
|
// Fill the window: Layout height="fill" is height:100%, which only resolves
|
|
68
66
|
// against a definite height — the host's <html>/<body> don't set one.
|
|
69
|
-
const rootStyle: CSSProperties = {height:
|
|
67
|
+
const rootStyle: CSSProperties = { height: "100dvh", width: "100%" };
|
|
70
68
|
// Workspace rail: full height, centered, ring-safe vertical padding.
|
|
71
69
|
const railStyle: CSSProperties = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
height: "100%",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
paddingTop: "var(--spacing-3)",
|
|
73
|
+
paddingBottom: "var(--spacing-3)",
|
|
76
74
|
};
|
|
77
75
|
// Sidebar frame: full height, scrolls internally.
|
|
78
|
-
const sidebarStyle: CSSProperties = {height:
|
|
76
|
+
const sidebarStyle: CSSProperties = { height: "100%", minHeight: 0 };
|
|
79
77
|
const sidebarHeaderStyle: CSSProperties = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
paddingInline: "var(--spacing-3)",
|
|
80
|
+
paddingBlock: "var(--spacing-3)",
|
|
83
81
|
};
|
|
84
82
|
const sidebarSearchStyle: CSSProperties = {
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
paddingInline: "var(--spacing-3)",
|
|
84
|
+
paddingBottom: "var(--spacing-2)",
|
|
87
85
|
};
|
|
88
86
|
// Block-start only: the inline (8px) and bottom (12px) edges already clear.
|
|
89
87
|
// INLINE is a content gutter matching sidebarHeader/sidebarSearch (12px);
|
|
90
88
|
// BLOCK-START is a 4px ring budget (offset 2 + thickness 2). Not redundant.
|
|
91
89
|
const sidebarScrollStyle: CSSProperties = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
minHeight: 0,
|
|
91
|
+
overflowY: "auto",
|
|
92
|
+
paddingInline: "var(--spacing-3)",
|
|
93
|
+
paddingBlockStart: "var(--spacing-1)",
|
|
94
|
+
paddingBottom: "var(--spacing-3)",
|
|
97
95
|
};
|
|
98
96
|
// DM section gap: List is the row container, so the gap rides on the second
|
|
99
97
|
// List's own margin instead of a wrapper element.
|
|
100
|
-
const sectionGapStyle: CSSProperties = {marginTop:
|
|
98
|
+
const sectionGapStyle: CSSProperties = { marginTop: "var(--spacing-4)" };
|
|
101
99
|
// Stream column: full height, scrolls internally.
|
|
102
|
-
const streamColumnStyle: CSSProperties = {height:
|
|
100
|
+
const streamColumnStyle: CSSProperties = { height: "100%", minHeight: 0 };
|
|
103
101
|
const streamHeaderStyle: CSSProperties = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
paddingInline: "var(--spacing-4)",
|
|
104
|
+
paddingBlock: "var(--spacing-3)",
|
|
107
105
|
};
|
|
108
106
|
// Truncation floor: the topic StackItem must shrink before the header does.
|
|
109
|
-
const streamTopicStyle: CSSProperties = {minWidth: 0};
|
|
107
|
+
const streamTopicStyle: CSSProperties = { minWidth: 0 };
|
|
110
108
|
const chatAreaStyle: CSSProperties = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
minHeight: 0,
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
114
112
|
};
|
|
115
|
-
const chatFillStyle: CSSProperties = {flex: 1, minHeight: 0};
|
|
113
|
+
const chatFillStyle: CSSProperties = { flex: 1, minHeight: 0 };
|
|
116
114
|
// Thread column: full height, scrolls internally.
|
|
117
|
-
const threadColumnStyle: CSSProperties = {height:
|
|
115
|
+
const threadColumnStyle: CSSProperties = { height: "100%", minHeight: 0 };
|
|
118
116
|
const threadHeaderStyle: CSSProperties = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
alignItems: "center",
|
|
118
|
+
paddingInline: "var(--spacing-3)",
|
|
119
|
+
paddingBlock: "var(--spacing-3)",
|
|
122
120
|
};
|
|
123
121
|
const threadScrollStyle: CSSProperties = {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
minHeight: 0,
|
|
123
|
+
overflowY: "auto",
|
|
124
|
+
paddingInline: "var(--spacing-3)",
|
|
125
|
+
paddingBlock: "var(--spacing-3)",
|
|
128
126
|
};
|
|
129
|
-
const threadComposerStyle: CSSProperties = {padding:
|
|
127
|
+
const threadComposerStyle: CSSProperties = { padding: "var(--spacing-3)" };
|
|
130
128
|
|
|
131
129
|
// ---------------------------------------------------------------------------
|
|
132
130
|
// Deterministic fixtures — fixed ISO timestamps, stable ordering.
|
|
133
131
|
// ---------------------------------------------------------------------------
|
|
134
132
|
|
|
135
|
-
type Presence =
|
|
133
|
+
type Presence = "online" | "busy" | "offline";
|
|
136
134
|
|
|
137
135
|
interface User {
|
|
138
|
-
|
|
136
|
+
name: string;
|
|
139
137
|
}
|
|
140
138
|
|
|
141
139
|
const USERS: Record<string, User> = {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
mira: { name: "Mira Chen" },
|
|
141
|
+
devon: { name: "Devon Park" },
|
|
142
|
+
sasha: { name: "Sasha Ortiz" },
|
|
143
|
+
you: { name: "Riley Quinn" },
|
|
146
144
|
};
|
|
147
145
|
|
|
148
146
|
interface Channel {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
topic: string;
|
|
150
|
+
unread: number;
|
|
153
151
|
}
|
|
154
152
|
|
|
155
153
|
const CHANNELS: Channel[] = [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
154
|
+
{
|
|
155
|
+
id: "design-systems",
|
|
156
|
+
name: "design-systems",
|
|
157
|
+
topic: "Component APIs, tokens, and release coordination",
|
|
158
|
+
unread: 0,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "frontend-guild",
|
|
162
|
+
name: "frontend-guild",
|
|
163
|
+
topic: "Cross-team frontend practices",
|
|
164
|
+
unread: 4,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "releases",
|
|
168
|
+
name: "releases",
|
|
169
|
+
topic: "Release announcements and rollbacks",
|
|
170
|
+
unread: 12,
|
|
171
|
+
},
|
|
172
|
+
{ id: "random", name: "random", topic: "Everything else", unread: 0 },
|
|
175
173
|
];
|
|
176
174
|
|
|
177
175
|
interface DirectMessage {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
id: string;
|
|
177
|
+
userId: string;
|
|
178
|
+
presence: Presence;
|
|
179
|
+
unread: number;
|
|
182
180
|
}
|
|
183
181
|
|
|
184
182
|
const DIRECT_MESSAGES: DirectMessage[] = [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
{ id: "dm-mira", userId: "mira", presence: "online", unread: 0 },
|
|
184
|
+
{ id: "dm-devon", userId: "devon", presence: "busy", unread: 2 },
|
|
185
|
+
{ id: "dm-sasha", userId: "sasha", presence: "offline", unread: 0 },
|
|
188
186
|
];
|
|
189
187
|
|
|
190
188
|
// AvatarStatusDot supports success | neutral | error (no warning): busy stays
|
|
191
189
|
// error (do-not-disturb), never warning. One config — variant and label travel
|
|
192
190
|
// together, so the dot and its accessible name can't disagree.
|
|
193
|
-
const PRESENCE: Record<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
online: {variant: 'success', label: 'Online'},
|
|
198
|
-
busy: {variant: 'error', label: 'Busy'},
|
|
199
|
-
offline: {variant: 'neutral', label: 'Offline'},
|
|
191
|
+
const PRESENCE: Record<Presence, { variant: "success" | "error" | "neutral"; label: string }> = {
|
|
192
|
+
online: { variant: "success", label: "Online" },
|
|
193
|
+
busy: { variant: "error", label: "Busy" },
|
|
194
|
+
offline: { variant: "neutral", label: "Offline" },
|
|
200
195
|
};
|
|
201
196
|
|
|
202
197
|
/** One bubble's copy. Ids key the bubble; its position only sets the grouping. */
|
|
203
198
|
interface StreamBubble {
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
id: string;
|
|
200
|
+
text: string;
|
|
206
201
|
}
|
|
207
202
|
|
|
208
203
|
/** One message group: consecutive bubbles from the same sender. */
|
|
209
204
|
interface StreamMessage {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
id: string;
|
|
206
|
+
userId: string;
|
|
207
|
+
time: string;
|
|
208
|
+
bubbles: StreamBubble[];
|
|
214
209
|
}
|
|
215
210
|
|
|
216
211
|
const MESSAGES_BY_CHANNEL: Record<string, StreamMessage[]> = {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
212
|
+
"design-systems": [
|
|
213
|
+
{
|
|
214
|
+
id: "m1",
|
|
215
|
+
userId: "mira",
|
|
216
|
+
time: "2026-06-30T09:12:00",
|
|
217
|
+
bubbles: [
|
|
218
|
+
{
|
|
219
|
+
id: "m1-1",
|
|
220
|
+
text: "Morning! The Timestamp component now supports a `system_date` format, worth switching the audit log over.",
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "m1-2",
|
|
224
|
+
text: "I put the migration notes in the wiki under Decisions.",
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "m2",
|
|
230
|
+
userId: "devon",
|
|
231
|
+
time: "2026-06-30T09:15:00",
|
|
232
|
+
bubbles: [
|
|
233
|
+
{
|
|
234
|
+
id: "m2-1",
|
|
235
|
+
text: "Nice. Does that unblock the incident console timeline work?",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: "m3",
|
|
241
|
+
userId: "you",
|
|
242
|
+
time: "2026-06-30T09:17:00",
|
|
243
|
+
bubbles: [
|
|
244
|
+
{
|
|
245
|
+
id: "m3-1",
|
|
246
|
+
text: "It does. I will pick that up after the template review.",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "m3-2",
|
|
250
|
+
text: "One question on the List density defaults, will start a thread.",
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "m4",
|
|
256
|
+
userId: "sasha",
|
|
257
|
+
time: "2026-06-30T09:24:00",
|
|
258
|
+
bubbles: [
|
|
259
|
+
{
|
|
260
|
+
id: "m4-1",
|
|
261
|
+
text: "Heads up: the token sync job ran clean overnight, no drift between core and the theme packages.",
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: "m5",
|
|
267
|
+
userId: "mira",
|
|
268
|
+
time: "2026-06-30T09:26:00",
|
|
269
|
+
bubbles: [{ id: "m5-1", text: "Great, closing out the drift task then." }],
|
|
270
|
+
},
|
|
271
|
+
],
|
|
272
|
+
"frontend-guild": [
|
|
273
|
+
{
|
|
274
|
+
id: "g1",
|
|
275
|
+
userId: "devon",
|
|
276
|
+
time: "2026-06-30T08:40:00",
|
|
277
|
+
bubbles: [
|
|
278
|
+
{
|
|
279
|
+
id: "g1-1",
|
|
280
|
+
text: "Guild sync moved to Thursday this week to avoid the release freeze.",
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: "g2",
|
|
286
|
+
userId: "you",
|
|
287
|
+
time: "2026-06-30T08:44:00",
|
|
288
|
+
bubbles: [{ id: "g2-1", text: "Works for me, agenda doc is updated." }],
|
|
289
|
+
},
|
|
290
|
+
],
|
|
296
291
|
};
|
|
297
292
|
|
|
298
293
|
interface ThreadReply {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
294
|
+
id: string;
|
|
295
|
+
userId: string;
|
|
296
|
+
time: string;
|
|
297
|
+
text: string;
|
|
303
298
|
}
|
|
304
299
|
|
|
305
300
|
// One map: the root plus its replies. [0] is the opener, the rest are replies —
|
|
306
301
|
// one lookup for the divider count and one slice for the reply list.
|
|
307
302
|
const THREAD: ThreadReply[] = [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
303
|
+
{
|
|
304
|
+
id: "t0",
|
|
305
|
+
userId: "you",
|
|
306
|
+
time: "2026-06-30T09:17:30",
|
|
307
|
+
text: "One question on the List density defaults: should channel sidebars use compact or balanced? The spec shows both.",
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "t1",
|
|
311
|
+
userId: "mira",
|
|
312
|
+
time: "2026-06-30T09:19:00",
|
|
313
|
+
text: "Compact for navigation surfaces. Balanced is for content lists where descriptions carry weight.",
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "t2",
|
|
317
|
+
userId: "devon",
|
|
318
|
+
time: "2026-06-30T09:21:00",
|
|
319
|
+
text: "Agreed, the sidebar rows here are a good reference implementation.",
|
|
320
|
+
},
|
|
326
321
|
];
|
|
327
322
|
|
|
328
323
|
const RAIL_ITEMS = [
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
324
|
+
{ id: "home", label: "Home", icon: House },
|
|
325
|
+
{ id: "dms", label: "Direct messages", icon: MessagesSquare },
|
|
326
|
+
{ id: "activity", label: "Activity", icon: Bell },
|
|
327
|
+
{ id: "saved", label: "Saved items", icon: Bookmark },
|
|
333
328
|
];
|
|
334
329
|
|
|
335
330
|
// One thread message. The root carries the divider above the replies, so the
|
|
336
|
-
function ThreadMessage({reply}: {reply: ThreadReply}) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
</ChatMessageBubble>
|
|
350
|
-
</ChatMessage>
|
|
351
|
-
);
|
|
331
|
+
function ThreadMessage({ reply }: { reply: ThreadReply }) {
|
|
332
|
+
return (
|
|
333
|
+
<ChatMessage sender="assistant" avatar={<Avatar name={USERS[reply.userId].name} size="md" />}>
|
|
334
|
+
<ChatMessageBubble
|
|
335
|
+
name={USERS[reply.userId].name}
|
|
336
|
+
metadata={
|
|
337
|
+
<ChatMessageMetadata timestamp={<Timestamp value={reply.time} format="time" />} />
|
|
338
|
+
}
|
|
339
|
+
>
|
|
340
|
+
{reply.text}
|
|
341
|
+
</ChatMessageBubble>
|
|
342
|
+
</ChatMessage>
|
|
343
|
+
);
|
|
352
344
|
}
|
|
353
345
|
|
|
354
346
|
// One nav row factory for the sidebar lists. Search filtering stays at the
|
|
355
347
|
// call sites (visibleChannels/visibleDms); unread badges stay per-row. Only
|
|
356
348
|
// the ListItem shape is shared.
|
|
357
349
|
function NavRow({
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
350
|
+
label,
|
|
351
|
+
isSelected,
|
|
352
|
+
onSelect,
|
|
353
|
+
startContent,
|
|
354
|
+
unread,
|
|
363
355
|
}: {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
356
|
+
label: string;
|
|
357
|
+
isSelected: boolean;
|
|
358
|
+
onSelect: () => void;
|
|
359
|
+
startContent: ReactNode;
|
|
360
|
+
unread: number;
|
|
369
361
|
}) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
) : undefined
|
|
380
|
-
}
|
|
381
|
-
/>
|
|
382
|
-
);
|
|
362
|
+
return (
|
|
363
|
+
<ListItem
|
|
364
|
+
label={label}
|
|
365
|
+
isSelected={isSelected}
|
|
366
|
+
onClick={onSelect}
|
|
367
|
+
startContent={startContent}
|
|
368
|
+
endContent={unread > 0 ? <Badge label={String(unread)} variant="neutral" /> : undefined}
|
|
369
|
+
/>
|
|
370
|
+
);
|
|
383
371
|
}
|
|
384
372
|
// ---------------------------------------------------------------------------
|
|
385
373
|
// Stream message group — avatar + name on the first bubble, timestamp on the
|
|
386
374
|
// last, `group` positions tighten corner radii between consecutive bubbles.
|
|
387
375
|
// ---------------------------------------------------------------------------
|
|
388
376
|
|
|
389
|
-
function StreamMessageGroup({message}: {message: StreamMessage}) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
377
|
+
function StreamMessageGroup({ message }: { message: StreamMessage }) {
|
|
378
|
+
const isSelf = message.userId === "you";
|
|
379
|
+
const user = USERS[message.userId];
|
|
380
|
+
const lastIndex = message.bubbles.length - 1;
|
|
381
|
+
|
|
382
|
+
return (
|
|
383
|
+
<ChatMessage
|
|
384
|
+
sender={isSelf ? "user" : "assistant"}
|
|
385
|
+
avatar={isSelf ? undefined : <Avatar name={user.name} size="md" />}
|
|
386
|
+
>
|
|
387
|
+
{message.bubbles.map((bubble, index) => (
|
|
388
|
+
<ChatMessageBubble
|
|
389
|
+
key={bubble.id}
|
|
390
|
+
group={
|
|
391
|
+
message.bubbles.length === 1
|
|
392
|
+
? undefined
|
|
393
|
+
: index === 0
|
|
394
|
+
? "first"
|
|
395
|
+
: index === lastIndex
|
|
396
|
+
? "last"
|
|
397
|
+
: "middle"
|
|
398
|
+
}
|
|
399
|
+
name={!isSelf && index === 0 ? user.name : undefined}
|
|
400
|
+
metadata={
|
|
401
|
+
index === lastIndex ? (
|
|
402
|
+
<ChatMessageMetadata timestamp={<Timestamp value={message.time} format="time" />} />
|
|
403
|
+
) : undefined
|
|
404
|
+
}
|
|
405
|
+
>
|
|
406
|
+
{bubble.text}
|
|
407
|
+
</ChatMessageBubble>
|
|
408
|
+
))}
|
|
409
|
+
</ChatMessage>
|
|
410
|
+
);
|
|
423
411
|
}
|
|
424
412
|
|
|
425
413
|
// ---------------------------------------------------------------------------
|
|
@@ -427,272 +415,262 @@ function StreamMessageGroup({message}: {message: StreamMessage}) {
|
|
|
427
415
|
// ---------------------------------------------------------------------------
|
|
428
416
|
|
|
429
417
|
export default function MessagingShell() {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
418
|
+
const [selectedChannelId, setSelectedChannelId] = useState("design-systems");
|
|
419
|
+
const [selectedDmId, setSelectedDmId] = useState<string | null>(null);
|
|
420
|
+
const [isThreadOpen, setIsThreadOpen] = useState(true);
|
|
421
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
422
|
+
|
|
423
|
+
// Responsive contract (see file header).
|
|
424
|
+
const isThreadHidden = useMediaQuery("(max-width: 1024px)");
|
|
425
|
+
const isSidebarHidden = useMediaQuery("(max-width: 768px)");
|
|
426
|
+
|
|
427
|
+
const selectedChannel =
|
|
428
|
+
CHANNELS.find((channel) => channel.id === selectedChannelId) ?? CHANNELS[0];
|
|
429
|
+
const messages = MESSAGES_BY_CHANNEL[selectedChannel.id] ?? [];
|
|
430
|
+
|
|
431
|
+
const normalizedQuery = searchQuery.trim().toLowerCase();
|
|
432
|
+
const visibleChannels = CHANNELS.filter((channel) =>
|
|
433
|
+
channel.name.toLowerCase().includes(normalizedQuery),
|
|
434
|
+
);
|
|
435
|
+
const visibleDms = DIRECT_MESSAGES.filter((dm) =>
|
|
436
|
+
USERS[dm.userId].name.toLowerCase().includes(normalizedQuery),
|
|
437
|
+
);
|
|
438
|
+
|
|
439
|
+
const showThreadPanel = isThreadOpen && !isThreadHidden;
|
|
440
|
+
|
|
441
|
+
const workspaceRail = (
|
|
442
|
+
<VStack gap={2} style={railStyle}>
|
|
443
|
+
<Avatar name="Night watch" size="md" />
|
|
444
|
+
{RAIL_ITEMS.map((item) => (
|
|
445
|
+
<IconButton
|
|
446
|
+
key={item.id}
|
|
447
|
+
label={item.label}
|
|
448
|
+
tooltip={item.label}
|
|
449
|
+
icon={<Icon icon={item.icon} size="sm" color="inherit" />}
|
|
450
|
+
variant={item.id === "home" ? "secondary" : "ghost"}
|
|
451
|
+
onClick={() => {}}
|
|
452
|
+
/>
|
|
453
|
+
))}
|
|
454
|
+
<StackItem size="fill" />
|
|
455
|
+
<IconButton
|
|
456
|
+
label="Settings"
|
|
457
|
+
tooltip="Settings"
|
|
458
|
+
icon={<Icon icon={Settings} size="sm" color="inherit" />}
|
|
459
|
+
variant="ghost"
|
|
460
|
+
onClick={() => {}}
|
|
461
|
+
/>
|
|
462
|
+
</VStack>
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
const channelSidebar = (
|
|
466
|
+
<Stack direction="vertical" style={sidebarStyle}>
|
|
467
|
+
<HStack gap={2} style={sidebarHeaderStyle}>
|
|
468
|
+
<StackItem size="fill">
|
|
469
|
+
<Heading level={1}>Messages</Heading>
|
|
470
|
+
</StackItem>
|
|
471
|
+
<IconButton
|
|
472
|
+
label="New message"
|
|
473
|
+
tooltip="New message"
|
|
474
|
+
icon={<Icon icon={SquarePen} size="sm" color="inherit" />}
|
|
475
|
+
variant="ghost"
|
|
476
|
+
size="sm"
|
|
477
|
+
onClick={() => {}}
|
|
478
|
+
/>
|
|
479
|
+
</HStack>
|
|
480
|
+
<VStack gap={0} style={sidebarSearchStyle}>
|
|
481
|
+
<TextInput
|
|
482
|
+
label="Jump to"
|
|
483
|
+
isLabelHidden
|
|
484
|
+
size="sm"
|
|
485
|
+
placeholder="Jump to…"
|
|
486
|
+
startIcon={Search}
|
|
487
|
+
value={searchQuery}
|
|
488
|
+
onChange={setSearchQuery}
|
|
489
|
+
/>
|
|
490
|
+
</VStack>
|
|
491
|
+
<StackItem
|
|
492
|
+
size="fill"
|
|
493
|
+
style={sidebarScrollStyle}
|
|
494
|
+
role="region"
|
|
495
|
+
aria-label="Channels and direct messages"
|
|
496
|
+
tabIndex={0}
|
|
497
|
+
>
|
|
498
|
+
<List
|
|
499
|
+
density="compact"
|
|
500
|
+
hasDividers={false}
|
|
501
|
+
header={
|
|
502
|
+
<Text type="label" size="sm" color="secondary">
|
|
503
|
+
Channels
|
|
504
|
+
</Text>
|
|
505
|
+
}
|
|
506
|
+
>
|
|
507
|
+
{visibleChannels.map((channel) => (
|
|
508
|
+
<NavRow
|
|
509
|
+
key={channel.id}
|
|
510
|
+
label={channel.name}
|
|
511
|
+
isSelected={selectedDmId === null && channel.id === selectedChannelId}
|
|
512
|
+
onSelect={() => {
|
|
513
|
+
setSelectedChannelId(channel.id);
|
|
514
|
+
setSelectedDmId(null);
|
|
515
|
+
}}
|
|
516
|
+
startContent={<Icon icon={Hash} size="sm" color="secondary" />}
|
|
517
|
+
unread={channel.unread}
|
|
518
|
+
/>
|
|
519
|
+
))}
|
|
520
|
+
</List>
|
|
521
|
+
{/* The section gap rides on this List's own margin: List is the row
|
|
534
522
|
container, so no wrapper element is needed. */}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
end={
|
|
689
|
-
showThreadPanel ? (
|
|
690
|
-
<LayoutPanel width={340} padding={0}>
|
|
691
|
-
{threadPanel}
|
|
692
|
-
</LayoutPanel>
|
|
693
|
-
) : undefined
|
|
694
|
-
}
|
|
695
|
-
content={<LayoutContent padding={0}>{messageStream}</LayoutContent>}
|
|
696
|
-
/>
|
|
697
|
-
);
|
|
523
|
+
<List
|
|
524
|
+
density="compact"
|
|
525
|
+
hasDividers={false}
|
|
526
|
+
style={sectionGapStyle}
|
|
527
|
+
header={
|
|
528
|
+
<Text type="label" size="sm" color="secondary">
|
|
529
|
+
Direct messages
|
|
530
|
+
</Text>
|
|
531
|
+
}
|
|
532
|
+
>
|
|
533
|
+
{visibleDms.map((dm) => (
|
|
534
|
+
<NavRow
|
|
535
|
+
key={dm.id}
|
|
536
|
+
label={USERS[dm.userId].name}
|
|
537
|
+
isSelected={selectedDmId === dm.id}
|
|
538
|
+
onSelect={() => setSelectedDmId(dm.id)}
|
|
539
|
+
startContent={
|
|
540
|
+
<Avatar
|
|
541
|
+
name={USERS[dm.userId].name}
|
|
542
|
+
size="sm"
|
|
543
|
+
status={
|
|
544
|
+
<AvatarStatusDot
|
|
545
|
+
variant={PRESENCE[dm.presence].variant}
|
|
546
|
+
label={PRESENCE[dm.presence].label}
|
|
547
|
+
/>
|
|
548
|
+
}
|
|
549
|
+
/>
|
|
550
|
+
}
|
|
551
|
+
unread={dm.unread}
|
|
552
|
+
/>
|
|
553
|
+
))}
|
|
554
|
+
</List>
|
|
555
|
+
</StackItem>
|
|
556
|
+
</Stack>
|
|
557
|
+
);
|
|
558
|
+
|
|
559
|
+
const messageStream = (
|
|
560
|
+
<Stack direction="vertical" style={streamColumnStyle}>
|
|
561
|
+
<HStack gap={3} style={streamHeaderStyle}>
|
|
562
|
+
<Icon icon={Hash} size="sm" color="secondary" />
|
|
563
|
+
<Heading level={2}>{selectedChannel.name}</Heading>
|
|
564
|
+
<StackItem size="fill" style={streamTopicStyle}>
|
|
565
|
+
<Text type="body" color="secondary" maxLines={1}>
|
|
566
|
+
{selectedChannel.topic}
|
|
567
|
+
</Text>
|
|
568
|
+
</StackItem>
|
|
569
|
+
<StatusDot variant="success" label="12 online" />
|
|
570
|
+
<IconButton
|
|
571
|
+
label="Members"
|
|
572
|
+
tooltip="Members"
|
|
573
|
+
icon={<Icon icon={Users} size="sm" color="inherit" />}
|
|
574
|
+
variant="ghost"
|
|
575
|
+
size="sm"
|
|
576
|
+
onClick={() => {}}
|
|
577
|
+
/>
|
|
578
|
+
</HStack>
|
|
579
|
+
<Divider />
|
|
580
|
+
<StackItem size="fill" style={chatAreaStyle}>
|
|
581
|
+
<ChatLayout
|
|
582
|
+
style={chatFillStyle}
|
|
583
|
+
composer={
|
|
584
|
+
<ChatComposer placeholder={`Message #${selectedChannel.name}`} onSubmit={() => {}} />
|
|
585
|
+
}
|
|
586
|
+
emptyState={
|
|
587
|
+
<EmptyState
|
|
588
|
+
icon={<Icon icon={Inbox} size="lg" color="secondary" />}
|
|
589
|
+
title="No messages yet"
|
|
590
|
+
description="Start the conversation. Messages posted here are visible to the whole channel."
|
|
591
|
+
/>
|
|
592
|
+
}
|
|
593
|
+
>
|
|
594
|
+
{messages.length > 0 ? (
|
|
595
|
+
<ChatMessageList density="balanced">
|
|
596
|
+
<ChatSystemMessage variant="divider">Tuesday, June 30</ChatSystemMessage>
|
|
597
|
+
<ChatSystemMessage>Sasha Ortiz joined #{selectedChannel.name}</ChatSystemMessage>
|
|
598
|
+
{messages.map((message) => (
|
|
599
|
+
<StreamMessageGroup key={message.id} message={message} />
|
|
600
|
+
))}
|
|
601
|
+
</ChatMessageList>
|
|
602
|
+
) : null}
|
|
603
|
+
</ChatLayout>
|
|
604
|
+
</StackItem>
|
|
605
|
+
</Stack>
|
|
606
|
+
);
|
|
607
|
+
|
|
608
|
+
const threadPanel = (
|
|
609
|
+
<Stack direction="vertical" style={threadColumnStyle}>
|
|
610
|
+
<HStack gap={2} style={threadHeaderStyle}>
|
|
611
|
+
<StackItem size="fill">
|
|
612
|
+
<HStack gap={2} style={{ alignItems: "baseline" }}>
|
|
613
|
+
<Text weight="semibold">Thread</Text>
|
|
614
|
+
<Text type="supporting" color="secondary">
|
|
615
|
+
#{selectedChannel.name}
|
|
616
|
+
</Text>
|
|
617
|
+
</HStack>
|
|
618
|
+
</StackItem>
|
|
619
|
+
<IconButton
|
|
620
|
+
label="Close thread"
|
|
621
|
+
tooltip="Close thread"
|
|
622
|
+
icon={<Icon icon={X} size="sm" color="inherit" />}
|
|
623
|
+
variant="ghost"
|
|
624
|
+
size="sm"
|
|
625
|
+
onClick={() => setIsThreadOpen(false)}
|
|
626
|
+
/>
|
|
627
|
+
</HStack>
|
|
628
|
+
<Divider />
|
|
629
|
+
<StackItem
|
|
630
|
+
size="fill"
|
|
631
|
+
style={threadScrollStyle}
|
|
632
|
+
role="region"
|
|
633
|
+
aria-label="Thread messages"
|
|
634
|
+
tabIndex={0}
|
|
635
|
+
>
|
|
636
|
+
<ChatMessageList density="compact">
|
|
637
|
+
<ThreadMessage reply={THREAD[0]} />
|
|
638
|
+
<ChatSystemMessage variant="divider">{THREAD.length - 1} replies</ChatSystemMessage>
|
|
639
|
+
{THREAD.slice(1).map((reply) => (
|
|
640
|
+
<ThreadMessage key={reply.id} reply={reply} />
|
|
641
|
+
))}
|
|
642
|
+
</ChatMessageList>
|
|
643
|
+
</StackItem>
|
|
644
|
+
<VStack gap={0} style={threadComposerStyle}>
|
|
645
|
+
<ChatComposer density="compact" placeholder="Reply in thread…" onSubmit={() => {}} />
|
|
646
|
+
</VStack>
|
|
647
|
+
</Stack>
|
|
648
|
+
);
|
|
649
|
+
|
|
650
|
+
return (
|
|
651
|
+
<Layout
|
|
652
|
+
height="fill"
|
|
653
|
+
style={rootStyle}
|
|
654
|
+
start={
|
|
655
|
+
<>
|
|
656
|
+
<LayoutPanel width={68} padding={0}>
|
|
657
|
+
{workspaceRail}
|
|
658
|
+
</LayoutPanel>
|
|
659
|
+
{!isSidebarHidden && (
|
|
660
|
+
<LayoutPanel width={260} padding={0}>
|
|
661
|
+
{channelSidebar}
|
|
662
|
+
</LayoutPanel>
|
|
663
|
+
)}
|
|
664
|
+
</>
|
|
665
|
+
}
|
|
666
|
+
end={
|
|
667
|
+
showThreadPanel ? (
|
|
668
|
+
<LayoutPanel width={340} padding={0}>
|
|
669
|
+
{threadPanel}
|
|
670
|
+
</LayoutPanel>
|
|
671
|
+
) : undefined
|
|
672
|
+
}
|
|
673
|
+
content={<LayoutContent padding={0}>{messageStream}</LayoutContent>}
|
|
674
|
+
/>
|
|
675
|
+
);
|
|
698
676
|
}
|