astryx-dracula 0.4.0 → 0.5.0

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 (50) hide show
  1. package/package.json +6 -2
  2. package/shared/auth-chrome.tsx +156 -6
  3. package/shared/chaptered-doc.tsx +3 -4
  4. package/shared/chart-hues.ts +0 -5
  5. package/shared/chart-legend.tsx +2 -3
  6. package/shared/data-bar.tsx +5 -5
  7. package/shared/format-money.ts +3 -0
  8. package/shared/metric-card.tsx +127 -0
  9. package/shared/scene-hues.ts +0 -8
  10. package/shared/scene-tile.tsx +3 -11
  11. package/shared/settings-data.ts +28 -0
  12. package/shared/settings-rows.tsx +1 -6
  13. package/shared/stars.tsx +28 -0
  14. package/templates/ai-chat-landing.tsx +88 -58
  15. package/templates/ai-chat.tsx +65 -78
  16. package/templates/centered-hero.tsx +2 -2
  17. package/templates/dashboard-portfolio.tsx +77 -155
  18. package/templates/dashboard.tsx +17 -134
  19. package/templates/detail-page.tsx +14 -18
  20. package/templates/documentation-design.tsx +66 -519
  21. package/templates/documentation-technical.tsx +2 -22
  22. package/templates/editor.tsx +168 -185
  23. package/templates/file-explorer.tsx +10 -24
  24. package/templates/ide.tsx +12 -18
  25. package/templates/incident-console.tsx +48 -46
  26. package/templates/kanban-board.tsx +36 -85
  27. package/templates/library.tsx +42 -66
  28. package/templates/login-card.tsx +33 -126
  29. package/templates/login-split.tsx +91 -123
  30. package/templates/login-sso.tsx +12 -33
  31. package/templates/login.tsx +21 -121
  32. package/templates/messaging-shell.tsx +162 -168
  33. package/templates/payment-form.tsx +24 -26
  34. package/templates/product-detail.tsx +7 -40
  35. package/templates/product-tour.tsx +38 -60
  36. package/templates/settings-dialog.tsx +10 -32
  37. package/templates/settings-sidebar.tsx +44 -77
  38. package/templates/settings.tsx +208 -121
  39. package/templates/shell-nav.tsx +20 -75
  40. package/templates/shell-side-nav.tsx +16 -90
  41. package/templates/shell-top-nav.tsx +20 -53
  42. package/templates/side-gallery.tsx +19 -19
  43. package/templates/table-grouped.tsx +17 -164
  44. package/templates/table-page-chart.tsx +12 -11
  45. package/templates/table-page-heatmap-status.tsx +0 -17
  46. package/templates/table-page-shoe-store-heatmap.tsx +12 -12
  47. package/templates/table-page.tsx +4 -31
  48. package/templates/table.tsx +7 -10
  49. package/templates/tech-report.tsx +58 -72
  50. package/templates/theme-showcase.tsx +124 -415
@@ -4,30 +4,12 @@
4
4
 
5
5
  import {useState, useTransition} from 'react';
6
6
  import {demoLogin} from 'astryx-dracula/shared/login-demo';
7
- import {
8
- AUTH_HEADING,
9
- AUTH_SUBTITLE,
10
- AUTH_PRIMARY_CTA,
11
- AUTH_SIGNUP_PROMPT,
12
- AUTH_SIGNUP_LINK,
13
- AUTH_FORGOT_PASSWORD,
14
- AUTH_ERROR_MESSAGE,
15
- AUTH_EMAIL_PLACEHOLDER,
16
- AUTH_PASSWORD_PLACEHOLDER,
17
- AUTH_TERMS_PREFIX,
18
- AUTH_TERMS_SERVICE,
19
- AUTH_TERMS_PRIVACY,
20
- } from 'astryx-dracula/shared/auth-copy';
7
+ import {AUTH_ERROR_MESSAGE} from 'astryx-dracula/shared/auth-copy';
21
8
  import {VStack} from '@astryxdesign/core/Layout';
22
9
  import {Center} from '@astryxdesign/core/Center';
23
- import {Text, Heading} from '@astryxdesign/core/Text';
24
- import {TextInput} from '@astryxdesign/core/TextInput';
25
- import {Button} from '@astryxdesign/core/Button';
26
- import {Card} from '@astryxdesign/core/Card';
27
- import {Link} from '@astryxdesign/core/Link';
28
10
 
29
- import {authPageStyle as pageStyle, authContentStyle as contentStyle, inputAutoComplete} from 'astryx-dracula/shared/auth-chrome-config';
30
- import {LoginBrand} from 'astryx-dracula/shared/auth-chrome';
11
+ import {authPageStyle as pageStyle, authContentStyle as contentStyle} from 'astryx-dracula/shared/auth-chrome-config';
12
+ import {LoginBrand, AuthCard, AuthLoginFields} from 'astryx-dracula/shared/auth-chrome';
31
13
 
32
14
  export default function LoginPage() {
33
15
  const [email, setEmail] = useState('');
@@ -51,106 +33,24 @@ export default function LoginPage() {
51
33
  <VStack gap={4} hAlign="center" style={contentStyle}>
52
34
  <LoginBrand />
53
35
 
54
- {/* Card */}
55
- <Card padding={4} width="100%">
56
- <VStack gap={4} hAlign="stretch">
57
- <VStack gap={1} hAlign="center">
58
- <Heading level={1} type="display-2" justify="center">
59
- {AUTH_HEADING}
60
- </Heading>
61
- <Text type="body" color="secondary">
62
- {AUTH_SUBTITLE}
63
- </Text>
64
- </VStack>
65
-
66
- {/* The field group, as its three siblings carry it
67
- (login-card.tsx:76, login-split.tsx:160, login-sso.tsx:192).
68
- Without it these two inputs sat 16px apart -- the outer
69
- VStack's gap={4} -- where all three twins render 8px, so the
70
- gap between the two fields was twice the gap between the
71
- fields and the sign-up link below. */}
72
- <VStack gap={2}>
73
- <TextInput
74
- label="Email"
75
- isLabelHidden
76
- value={email}
77
- onChange={v => {
78
- setEmail(v);
79
- setError(null);
80
- }}
81
- placeholder={AUTH_EMAIL_PLACEHOLDER}
82
- type="email"
83
- {...inputAutoComplete('email')}
84
- size="lg"
85
- onEnter={handleSignIn}
86
- status={error ? {type: 'error', message: error} : undefined}
87
- />
88
-
89
- <VStack gap={1}>
90
- <TextInput
91
- label="Password"
92
- isLabelHidden
93
- value={password}
94
- onChange={v => {
95
- setPassword(v);
96
- setError(null);
97
- }}
98
- placeholder={AUTH_PASSWORD_PLACEHOLDER}
99
- type="password"
100
- {...inputAutoComplete('current-password')}
101
- size="lg"
102
- onEnter={handleSignIn}
103
- status={error ? {type: 'error', message: error} : undefined}
104
- />
105
- {error && (
106
- <VStack hAlign="end">
107
- <Link
108
- href="#/templates/login"
109
- color="secondary"
110
- isStandalone>
111
- {AUTH_FORGOT_PASSWORD}
112
- </Link>
113
- </VStack>
114
- )}
115
- </VStack>
116
- </VStack>
117
-
118
- <Button
119
- label={AUTH_PRIMARY_CTA}
120
- variant="primary"
121
- size="lg"
122
- isLoading={isLoading}
123
- onClick={handleSignIn}
124
- />
125
-
126
- {/* Prose links. A link inside a sentence needs a persistent
127
- underline — colour alone is not a cue (WCAG 1.4.1 / F73),
128
- and the kit underlines on hover only. */}
129
- <VStack hAlign="center">
130
- <Text type="supporting" color="secondary">
131
- {AUTH_SIGNUP_PROMPT}{' '}
132
- <Link href="#/templates/login" type="supporting" hasUnderline>
133
- {AUTH_SIGNUP_LINK}
134
- </Link>
135
- </Text>
136
- </VStack>
137
- </VStack>
138
- </Card>
139
-
140
- {/* Terms */}
141
- <VStack hAlign="center" width="100%">
142
- <Text type="supporting" color="secondary" justify="center">
143
- {AUTH_TERMS_PREFIX}{' '}
144
- <Link href="#/templates/login" type="supporting" hasUnderline>
145
- {AUTH_TERMS_SERVICE}
146
- </Link>{' '}
147
- and{' '}
148
- <Link href="#/templates/login" type="supporting" hasUnderline>
149
- {AUTH_TERMS_PRIVACY}
150
- </Link>
151
- .
152
- </Text>
153
- </VStack>
36
+ <AuthCard selfHash="#/templates/login">
37
+ <AuthLoginFields
38
+ email={email}
39
+ password={password}
40
+ error={error}
41
+ selfHash="#/templates/login"
42
+ isLoading={isLoading}
43
+ onEmailChange={v => {
44
+ setEmail(v);
45
+ setError(null);
46
+ }}
47
+ onPasswordChange={v => {
48
+ setPassword(v);
49
+ setError(null);
50
+ }}
51
+ onSubmit={handleSignIn}
52
+ />
53
+ </AuthCard>
154
54
  </VStack>
155
55
  </Center>
156
56
  );
@@ -6,7 +6,7 @@
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} from 'react';
9
+ import {useState, type CSSProperties, type ReactNode} from 'react';
10
10
 
11
11
  import {
12
12
  Layout,
@@ -59,89 +59,74 @@ import {
59
59
  } from 'lucide-react';
60
60
 
61
61
  // ---------------------------------------------------------------------------
62
- // Styles — plain CSS properties with semantic tokens only.
62
+ // Styles — semantic tokens only. Layout/Stack own their padding via props,
63
+ // so only surfaces Astryx has no prop for live here: dvh anchoring, scroll
64
+ // clipping with a ring budget, and the topic truncation floor.
63
65
  // ---------------------------------------------------------------------------
64
66
 
65
- const styles: Record<string, CSSProperties> = {
66
- root: {
67
- height: '100dvh',
68
- width: '100%',
69
- },
70
- rail: {
71
- height: '100%',
72
- alignItems: 'center',
73
- paddingTop: 'var(--spacing-3)',
74
- paddingBottom: 'var(--spacing-3)',
75
- },
76
- sidebar: {
77
- height: '100%',
78
- minHeight: 0,
79
- },
80
- sidebarHeader: {
81
- alignItems: 'center',
82
- paddingInline: 'var(--spacing-3)',
83
- paddingBlock: 'var(--spacing-3)',
84
- },
85
- sidebarSearch: {
86
- paddingInline: 'var(--spacing-3)',
87
- paddingBottom: 'var(--spacing-2)',
88
- },
89
- // Block-start only: the inline (8px) and bottom (12px) edges already clear
90
- // Two different jobs on one object, so the two different values are not
91
- // redundant. INLINE is a content gutter: it must equal sidebarHeader and
92
- // sidebarSearch above it (both var(--spacing-3) = 12px) because the channel
93
- // list sits directly under the search field in the same 260px start panel --
94
- // at 8px the body sat 4px inside the field above it. BLOCK-START is a ring
95
- // budget, not a gutter: 4px = ring offset 2 + thickness 2, so the focus ring
96
- // lands inside this clip instead of on its edge. The bottom edge stays 12px
97
- // because the list scrolls into it, not into a ring.
98
- sidebarScroll: {
99
- minHeight: 0,
100
- overflowY: 'auto',
101
- paddingInline: 'var(--spacing-3)',
102
- paddingBlockStart: 'var(--spacing-1)',
103
- paddingBottom: 'var(--spacing-3)',
104
- },
105
- streamColumn: {
106
- height: '100%',
107
- minHeight: 0,
108
- },
109
- streamHeader: {
110
- alignItems: 'center',
111
- paddingInline: 'var(--spacing-4)',
112
- paddingBlock: 'var(--spacing-3)',
113
- },
114
- streamTopic: {
115
- minWidth: 0,
116
- },
117
- chatArea: {
118
- minHeight: 0,
119
- display: 'flex',
120
- flexDirection: 'column',
121
- },
122
- chatFill: {
123
- flex: 1,
124
- minHeight: 0,
125
- },
126
- threadColumn: {
127
- height: '100%',
128
- minHeight: 0,
129
- },
130
- threadHeader: {
131
- alignItems: 'center',
132
- paddingInline: 'var(--spacing-3)',
133
- paddingBlock: 'var(--spacing-3)',
134
- },
135
- threadScroll: {
136
- minHeight: 0,
137
- overflowY: 'auto',
138
- paddingInline: 'var(--spacing-3)',
139
- paddingBlock: 'var(--spacing-3)',
140
- },
141
- threadComposer: {
142
- padding: 'var(--spacing-3)',
143
- },
67
+ // Fill the window: Layout height="fill" is height:100%, which only resolves
68
+ // against a definite height — the host's <html>/<body> don't set one.
69
+ const rootStyle: CSSProperties = {height: '100dvh', width: '100%'};
70
+ // Workspace rail: full height, centered, ring-safe vertical padding.
71
+ const railStyle: CSSProperties = {
72
+ height: '100%',
73
+ alignItems: 'center',
74
+ paddingTop: 'var(--spacing-3)',
75
+ paddingBottom: 'var(--spacing-3)',
76
+ };
77
+ // Sidebar frame: full height, scrolls internally.
78
+ const sidebarStyle: CSSProperties = {height: '100%', minHeight: 0};
79
+ const sidebarHeaderStyle: CSSProperties = {
80
+ alignItems: 'center',
81
+ paddingInline: 'var(--spacing-3)',
82
+ paddingBlock: 'var(--spacing-3)',
83
+ };
84
+ const sidebarSearchStyle: CSSProperties = {
85
+ paddingInline: 'var(--spacing-3)',
86
+ paddingBottom: 'var(--spacing-2)',
87
+ };
88
+ // Block-start only: the inline (8px) and bottom (12px) edges already clear.
89
+ // INLINE is a content gutter matching sidebarHeader/sidebarSearch (12px);
90
+ // BLOCK-START is a 4px ring budget (offset 2 + thickness 2). Not redundant.
91
+ const sidebarScrollStyle: CSSProperties = {
92
+ minHeight: 0,
93
+ overflowY: 'auto',
94
+ paddingInline: 'var(--spacing-3)',
95
+ paddingBlockStart: 'var(--spacing-1)',
96
+ paddingBottom: 'var(--spacing-3)',
144
97
  };
98
+ // DM section gap: List is the row container, so the gap rides on the second
99
+ // List's own margin instead of a wrapper element.
100
+ const sectionGapStyle: CSSProperties = {marginTop: 'var(--spacing-4)'};
101
+ // Stream column: full height, scrolls internally.
102
+ const streamColumnStyle: CSSProperties = {height: '100%', minHeight: 0};
103
+ const streamHeaderStyle: CSSProperties = {
104
+ alignItems: 'center',
105
+ paddingInline: 'var(--spacing-4)',
106
+ paddingBlock: 'var(--spacing-3)',
107
+ };
108
+ // Truncation floor: the topic StackItem must shrink before the header does.
109
+ const streamTopicStyle: CSSProperties = {minWidth: 0};
110
+ const chatAreaStyle: CSSProperties = {
111
+ minHeight: 0,
112
+ display: 'flex',
113
+ flexDirection: 'column',
114
+ };
115
+ const chatFillStyle: CSSProperties = {flex: 1, minHeight: 0};
116
+ // Thread column: full height, scrolls internally.
117
+ const threadColumnStyle: CSSProperties = {height: '100%', minHeight: 0};
118
+ const threadHeaderStyle: CSSProperties = {
119
+ alignItems: 'center',
120
+ paddingInline: 'var(--spacing-3)',
121
+ paddingBlock: 'var(--spacing-3)',
122
+ };
123
+ const threadScrollStyle: CSSProperties = {
124
+ minHeight: 0,
125
+ overflowY: 'auto',
126
+ paddingInline: 'var(--spacing-3)',
127
+ paddingBlock: 'var(--spacing-3)',
128
+ };
129
+ const threadComposerStyle: CSSProperties = {padding: 'var(--spacing-3)'};
145
130
 
146
131
  // ---------------------------------------------------------------------------
147
132
  // Deterministic fixtures — fixed ISO timestamps, stable ordering.
@@ -202,17 +187,16 @@ const DIRECT_MESSAGES: DirectMessage[] = [
202
187
  {id: 'dm-sasha', userId: 'sasha', presence: 'offline', unread: 0},
203
188
  ];
204
189
 
205
- // AvatarStatusDot supports success | neutral | error (no warning): busy stays error (do-not-disturb), never warning.
206
- const PRESENCE_VARIANT: Record<Presence, 'success' | 'error' | 'neutral'> = {
207
- online: 'success',
208
- busy: 'error',
209
- offline: 'neutral',
210
- };
211
-
212
- const PRESENCE_LABEL: Record<Presence, string> = {
213
- online: 'Online',
214
- busy: 'Busy',
215
- offline: 'Offline',
190
+ // AvatarStatusDot supports success | neutral | error (no warning): busy stays
191
+ // error (do-not-disturb), never warning. One config — variant and label travel
192
+ // 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'},
216
200
  };
217
201
 
218
202
  /** One bubble's copy. Ids key the bubble; its position only sets the grouping. */
@@ -318,14 +302,15 @@ interface ThreadReply {
318
302
  text: string;
319
303
  }
320
304
 
321
- const THREAD_ROOT: ThreadReply = {
322
- id: 't0',
323
- userId: 'you',
324
- time: '2026-06-30T09:17:30',
325
- text: 'One question on the List density defaults: should channel sidebars use compact or balanced? The spec shows both.',
326
- };
327
-
328
- const THREAD_REPLIES: ThreadReply[] = [
305
+ // One map: the root plus its replies. [0] is the opener, the rest are replies —
306
+ // one lookup for the divider count and one slice for the reply list.
307
+ 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
+ },
329
314
  {
330
315
  id: 't1',
331
316
  userId: 'mira',
@@ -347,6 +332,55 @@ const RAIL_ITEMS = [
347
332
  {id: 'saved', label: 'Saved items', icon: Bookmark},
348
333
  ];
349
334
 
335
+ // 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
+ );
352
+ }
353
+
354
+ // One nav row factory for the sidebar lists. Search filtering stays at the
355
+ // call sites (visibleChannels/visibleDms); unread badges stay per-row. Only
356
+ // the ListItem shape is shared.
357
+ function NavRow({
358
+ label,
359
+ isSelected,
360
+ onSelect,
361
+ startContent,
362
+ unread,
363
+ }: {
364
+ label: string;
365
+ isSelected: boolean;
366
+ onSelect: () => void;
367
+ startContent: ReactNode;
368
+ unread: number;
369
+ }) {
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
+ );
383
+ }
350
384
  // ---------------------------------------------------------------------------
351
385
  // Stream message group — avatar + name on the first bubble, timestamp on the
352
386
  // last, `group` positions tighten corner radii between consecutive bubbles.
@@ -417,7 +451,7 @@ export default function MessagingShell() {
417
451
  const showThreadPanel = isThreadOpen && !isThreadHidden;
418
452
 
419
453
  const workspaceRail = (
420
- <VStack gap={2} style={styles.rail}>
454
+ <VStack gap={2} style={railStyle}>
421
455
  <Avatar name="Night watch" size="md" />
422
456
  {RAIL_ITEMS.map(item => (
423
457
  <IconButton
@@ -437,17 +471,12 @@ export default function MessagingShell() {
437
471
  variant="ghost"
438
472
  onClick={() => {}}
439
473
  />
440
- <Avatar
441
- name={USERS.you.name}
442
- size="md"
443
- status={<AvatarStatusDot variant="success" label="Online" />}
444
- />
445
474
  </VStack>
446
475
  );
447
476
 
448
477
  const channelSidebar = (
449
- <Stack direction="vertical" style={styles.sidebar}>
450
- <HStack gap={2} style={styles.sidebarHeader}>
478
+ <Stack direction="vertical" style={sidebarStyle}>
479
+ <HStack gap={2} style={sidebarHeaderStyle}>
451
480
  <StackItem size="fill">
452
481
  <Heading level={1}>Messages</Heading>
453
482
  </StackItem>
@@ -460,7 +489,7 @@ export default function MessagingShell() {
460
489
  onClick={() => {}}
461
490
  />
462
491
  </HStack>
463
- <VStack gap={0} style={styles.sidebarSearch}>
492
+ <VStack gap={0} style={sidebarSearchStyle}>
464
493
  <TextInput
465
494
  label="Jump to"
466
495
  isLabelHidden
@@ -473,7 +502,7 @@ export default function MessagingShell() {
473
502
  </VStack>
474
503
  <StackItem
475
504
  size="fill"
476
- style={styles.sidebarScroll}
505
+ style={sidebarScrollStyle}
477
506
  role="region"
478
507
  aria-label="Channels and direct messages"
479
508
  tabIndex={0}>
@@ -486,22 +515,18 @@ export default function MessagingShell() {
486
515
  </Text>
487
516
  }>
488
517
  {visibleChannels.map(channel => (
489
- <ListItem
518
+ <NavRow
490
519
  key={channel.id}
491
520
  label={channel.name}
492
521
  isSelected={
493
522
  selectedDmId === null && channel.id === selectedChannelId
494
523
  }
495
- onClick={() => {
524
+ onSelect={() => {
496
525
  setSelectedChannelId(channel.id);
497
526
  setSelectedDmId(null);
498
527
  }}
499
528
  startContent={<Icon icon={Hash} size="sm" color="secondary" />}
500
- endContent={
501
- channel.unread > 0 ? (
502
- <Badge label={String(channel.unread)} variant="neutral" />
503
- ) : undefined
504
- }
529
+ unread={channel.unread}
505
530
  />
506
531
  ))}
507
532
  </List>
@@ -510,35 +535,31 @@ export default function MessagingShell() {
510
535
  <List
511
536
  density="compact"
512
537
  hasDividers={false}
513
- style={styles.sectionGap}
538
+ style={sectionGapStyle}
514
539
  header={
515
540
  <Text type="label" size="sm" color="secondary">
516
541
  Direct messages
517
542
  </Text>
518
543
  }>
519
544
  {visibleDms.map(dm => (
520
- <ListItem
545
+ <NavRow
521
546
  key={dm.id}
522
547
  label={USERS[dm.userId].name}
523
548
  isSelected={selectedDmId === dm.id}
524
- onClick={() => setSelectedDmId(dm.id)}
549
+ onSelect={() => setSelectedDmId(dm.id)}
525
550
  startContent={
526
551
  <Avatar
527
552
  name={USERS[dm.userId].name}
528
553
  size="sm"
529
554
  status={
530
555
  <AvatarStatusDot
531
- variant={PRESENCE_VARIANT[dm.presence]}
532
- label={PRESENCE_LABEL[dm.presence]}
556
+ variant={PRESENCE[dm.presence].variant}
557
+ label={PRESENCE[dm.presence].label}
533
558
  />
534
559
  }
535
560
  />
536
561
  }
537
- endContent={
538
- dm.unread > 0 ? (
539
- <Badge label={String(dm.unread)} variant="neutral" />
540
- ) : undefined
541
- }
562
+ unread={dm.unread}
542
563
  />
543
564
  ))}
544
565
  </List>
@@ -547,11 +568,11 @@ export default function MessagingShell() {
547
568
  );
548
569
 
549
570
  const messageStream = (
550
- <Stack direction="vertical" style={styles.streamColumn}>
551
- <HStack gap={3} style={styles.streamHeader}>
571
+ <Stack direction="vertical" style={streamColumnStyle}>
572
+ <HStack gap={3} style={streamHeaderStyle}>
552
573
  <Icon icon={Hash} size="sm" color="secondary" />
553
574
  <Heading level={2}>{selectedChannel.name}</Heading>
554
- <StackItem size="fill" style={styles.streamTopic}>
575
+ <StackItem size="fill" style={streamTopicStyle}>
555
576
  <Text type="body" color="secondary" maxLines={1}>
556
577
  {selectedChannel.topic}
557
578
  </Text>
@@ -567,9 +588,9 @@ export default function MessagingShell() {
567
588
  />
568
589
  </HStack>
569
590
  <Divider />
570
- <StackItem size="fill" style={styles.chatArea}>
591
+ <StackItem size="fill" style={chatAreaStyle}>
571
592
  <ChatLayout
572
- style={styles.chatFill}
593
+ style={chatFillStyle}
573
594
  composer={
574
595
  <ChatComposer
575
596
  placeholder={`Message #${selectedChannel.name}`}
@@ -602,8 +623,8 @@ export default function MessagingShell() {
602
623
  );
603
624
 
604
625
  const threadPanel = (
605
- <Stack direction="vertical" style={styles.threadColumn}>
606
- <HStack gap={2} style={styles.threadHeader}>
626
+ <Stack direction="vertical" style={threadColumnStyle}>
627
+ <HStack gap={2} style={threadHeaderStyle}>
607
628
  <StackItem size="fill">
608
629
  <HStack gap={2} style={{alignItems: 'baseline'}}>
609
630
  <Text weight="semibold">Thread</Text>
@@ -624,48 +645,21 @@ export default function MessagingShell() {
624
645
  <Divider />
625
646
  <StackItem
626
647
  size="fill"
627
- style={styles.threadScroll}
648
+ style={threadScrollStyle}
628
649
  role="region"
629
650
  aria-label="Thread messages"
630
651
  tabIndex={0}>
631
652
  <ChatMessageList density="compact">
632
- <ChatMessage
633
- sender="assistant"
634
- avatar={<Avatar name={USERS[THREAD_ROOT.userId].name} size="md" />}>
635
- <ChatMessageBubble
636
- name={USERS[THREAD_ROOT.userId].name}
637
- metadata={
638
- <ChatMessageMetadata
639
- timestamp={
640
- <Timestamp value={THREAD_ROOT.time} format="time" />
641
- }
642
- />
643
- }>
644
- {THREAD_ROOT.text}
645
- </ChatMessageBubble>
646
- </ChatMessage>
653
+ <ThreadMessage reply={THREAD[0]} />
647
654
  <ChatSystemMessage variant="divider">
648
- {THREAD_REPLIES.length} replies
655
+ {THREAD.length - 1} replies
649
656
  </ChatSystemMessage>
650
- {THREAD_REPLIES.map(reply => (
651
- <ChatMessage
652
- key={reply.id}
653
- sender="assistant"
654
- avatar={<Avatar name={USERS[reply.userId].name} size="md" />}>
655
- <ChatMessageBubble
656
- name={USERS[reply.userId].name}
657
- metadata={
658
- <ChatMessageMetadata
659
- timestamp={<Timestamp value={reply.time} format="time" />}
660
- />
661
- }>
662
- {reply.text}
663
- </ChatMessageBubble>
664
- </ChatMessage>
657
+ {THREAD.slice(1).map(reply => (
658
+ <ThreadMessage key={reply.id} reply={reply} />
665
659
  ))}
666
660
  </ChatMessageList>
667
661
  </StackItem>
668
- <VStack gap={0} style={styles.threadComposer}>
662
+ <VStack gap={0} style={threadComposerStyle}>
669
663
  <ChatComposer
670
664
  density="compact"
671
665
  placeholder="Reply in thread…"
@@ -678,7 +672,7 @@ export default function MessagingShell() {
678
672
  return (
679
673
  <Layout
680
674
  height="fill"
681
- style={styles.root}
675
+ style={rootStyle}
682
676
  start={
683
677
  <>
684
678
  <LayoutPanel width={68} padding={0}>