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