astryx-dracula 0.2.1 → 0.3.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 (83) hide show
  1. package/BRAND.md +30 -18
  2. package/README.md +17 -12
  3. package/USAGE.md +29 -10
  4. package/astryx-dracula.js +19 -13
  5. package/astryx-dracula.variants.d.ts +15 -0
  6. package/package.json +59 -17
  7. package/shared/auth-chrome-config.ts +18 -0
  8. package/shared/auth-chrome.tsx +25 -0
  9. package/shared/auth-copy.ts +22 -0
  10. package/shared/chaptered-doc-config.ts +92 -0
  11. package/shared/chaptered-doc.tsx +332 -0
  12. package/shared/chart-hues.ts +27 -0
  13. package/shared/chart-labels.tsx +44 -0
  14. package/shared/chart-legend.tsx +100 -0
  15. package/shared/chart-panel-style.ts +13 -0
  16. package/shared/data-bar.tsx +160 -0
  17. package/shared/gallery-image.ts +20 -0
  18. package/shared/login-demo.ts +7 -0
  19. package/shared/metric-delta.tsx +36 -0
  20. package/shared/order-desk.tsx +273 -0
  21. package/shared/revenue-chart.tsx +174 -0
  22. package/shared/scene-castle.tsx +322 -0
  23. package/shared/scene-frame.tsx +88 -0
  24. package/shared/scene-hues.ts +49 -0
  25. package/shared/scene-tile.tsx +128 -0
  26. package/shared/settings-data.ts +125 -0
  27. package/shared/settings-rows.tsx +179 -0
  28. package/shared/sparkline.tsx +94 -0
  29. package/shared/sso-icons.tsx +30 -0
  30. package/templates/ai-chat-landing.tsx +66 -33
  31. package/templates/ai-chat.tsx +36 -19
  32. package/templates/blank.tsx +4 -3
  33. package/templates/centered-hero.tsx +14 -125
  34. package/templates/classic-gallery.tsx +20 -66
  35. package/templates/contact-form.tsx +59 -39
  36. package/templates/dashboard-portfolio.tsx +143 -226
  37. package/templates/dashboard.tsx +122 -122
  38. package/templates/detail-page.tsx +95 -91
  39. package/templates/documentation-design.template.mjs +1 -1
  40. package/templates/documentation-design.tsx +83 -96
  41. package/templates/documentation-technical.template.mjs +1 -1
  42. package/templates/documentation-technical.tsx +29 -19
  43. package/templates/documentation.template.mjs +1 -1
  44. package/templates/documentation.tsx +52 -74
  45. package/templates/editor.tsx +112 -84
  46. package/templates/file-explorer.tsx +131 -84
  47. package/templates/form-two-column.tsx +61 -125
  48. package/templates/gallery-hero.tsx +15 -171
  49. package/templates/ide.tsx +22 -20
  50. package/templates/incident-console.tsx +104 -70
  51. package/templates/kanban-board.tsx +99 -42
  52. package/templates/library.template.mjs +2 -2
  53. package/templates/library.tsx +37 -42
  54. package/templates/login-card.tsx +58 -87
  55. package/templates/login-split.tsx +88 -126
  56. package/templates/login-sso.tsx +105 -64
  57. package/templates/login.tsx +107 -53
  58. package/templates/messaging-shell.tsx +171 -144
  59. package/templates/mixed-gallery.tsx +29 -130
  60. package/templates/payment-form.tsx +368 -290
  61. package/templates/product-detail.tsx +39 -58
  62. package/templates/product-gallery.tsx +30 -41
  63. package/templates/product-tour.template.mjs +6 -0
  64. package/templates/product-tour.tsx +916 -0
  65. package/templates/settings-dialog.tsx +135 -282
  66. package/templates/settings-sidebar.tsx +178 -268
  67. package/templates/settings.tsx +41 -14
  68. package/templates/shell-nav.tsx +31 -24
  69. package/templates/shell-side-nav.tsx +29 -20
  70. package/templates/shell-top-nav.tsx +80 -44
  71. package/templates/side-gallery.tsx +38 -94
  72. package/templates/table-grouped.tsx +62 -34
  73. package/templates/table-page-chart.tsx +23 -302
  74. package/templates/table-page-heatmap-status.tsx +156 -92
  75. package/templates/table-page-shoe-store-heatmap.tsx +18 -293
  76. package/templates/table-page.tsx +23 -7
  77. package/templates/table.tsx +23 -8
  78. package/templates/tech-report.template.mjs +6 -0
  79. package/templates/tech-report.tsx +1486 -0
  80. package/templates/theme-showcase.template.mjs +1 -1
  81. package/templates/theme-showcase.tsx +299 -237
  82. package/theme.css +76 -14
  83. package/tokens.css +425 -30
@@ -1,14 +1,14 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
  // XLE (canonical structure, validated with `bunx astryx layout check`):
3
- // S > L > (LH[divider] > Tbar > (Hd"Sprint Board"[level=3] + Bd.neutral"8") + (H[g=2] > SE + D.strong + IB"Sort" + IB"Filter" + IB"Search" + B.primary"Add task")) + (LC[p=0] > G[c=4 g=4] > (C.muted[p=0] > L > (LH[divider] > H[j=between a=center] > (H[g=2 a=center] > SD + Hd"To-do"[level=4] + Ic) + Tx) + (LC[p=2] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=1] > Bd + Bd) + MM) + (V[g=1] > Hd[level=4] + Tx) + Tx)*2))*4)
3
+ // S > L > (LH[divider] > Tbar > (Hd"Sprint Board"[level=1] + Bd.neutral"8") + (H[g=2] > SE + D.strong + IB"Sort" + IB"Filter" + IB"Search" + B.primary"Add task")) + (LC[p=0] > G[c={min:280,max:4} g=4] > (C.muted[p=0] > L > (LH[divider] > H[j=between a=center] > (H[g=2 a=center] > SD + Hd"To-do"[level=2] + IB) + Tx) + (LC[p=3] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx)*2))*4)
4
4
 
5
5
  import {
6
6
  useEffect,
7
- useMemo,
8
7
  useRef,
9
8
  useState,
10
9
  type CSSProperties,
11
10
  type PointerEvent as ReactPointerEvent,
11
+ type KeyboardEvent as ReactKeyboardEvent,
12
12
  type ReactNode,
13
13
  } from 'react';
14
14
 
@@ -22,6 +22,7 @@ import {
22
22
  import {Text, Heading} from '@astryxdesign/core/Text';
23
23
  import {Card} from '@astryxdesign/core/Card';
24
24
  import {Badge} from '@astryxdesign/core/Badge';
25
+ import {Token} from '@astryxdesign/core/Token';
25
26
  import {Button} from '@astryxdesign/core/Button';
26
27
  import {IconButton} from '@astryxdesign/core/IconButton';
27
28
  import {Icon} from '@astryxdesign/core/Icon';
@@ -29,7 +30,7 @@ import {StatusDot} from '@astryxdesign/core/StatusDot';
29
30
  import {EmptyState} from '@astryxdesign/core/EmptyState';
30
31
  import {MoreMenu} from '@astryxdesign/core/MoreMenu';
31
32
  import {Selector} from '@astryxdesign/core/Selector';
32
- import {Tooltip} from '@astryxdesign/core/Tooltip';
33
+ import {Popover} from '@astryxdesign/core/Popover';
33
34
  import {Divider} from '@astryxdesign/core/Divider';
34
35
  import {Toolbar} from '@astryxdesign/core/Toolbar';
35
36
  import {Section} from '@astryxdesign/core/Section';
@@ -66,7 +67,7 @@ interface WorkItem {
66
67
  interface ColumnMeta {
67
68
  id: ColumnId;
68
69
  title: string;
69
- variant: 'neutral' | 'accent' | 'warning' | 'success';
70
+ variant: 'neutral' | 'info' | 'warning' | 'success';
70
71
  tooltip: string;
71
72
  emptyTitle: string;
72
73
  emptyDescription: string;
@@ -107,7 +108,7 @@ const COLUMNS: ColumnMeta[] = [
107
108
  {
108
109
  id: 'in-progress',
109
110
  title: 'In progress',
110
- variant: 'accent',
111
+ variant: 'info',
111
112
  tooltip: 'Theme work currently on the easel.',
112
113
  emptyTitle: 'Nothing in progress',
113
114
  emptyDescription: 'Tasks being worked on appear here.',
@@ -116,7 +117,7 @@ const COLUMNS: ColumnMeta[] = [
116
117
  {
117
118
  id: 'in-review',
118
119
  title: 'In review',
119
- variant: 'warning',
120
+ variant: 'info',
120
121
  tooltip: 'Shades waiting for your contrast review.',
121
122
  emptyTitle: 'Nothing in review',
122
123
  emptyDescription: 'Tasks awaiting your review appear here.',
@@ -135,13 +136,26 @@ const COLUMNS: ColumnMeta[] = [
135
136
 
136
137
  const PRIORITY_META: Record<
137
138
  Priority,
138
- {label: string; variant: 'red' | 'yellow' | 'cyan'}
139
+ {label: string; variant: 'red' | 'yellow' | 'neutral'}
139
140
  > = {
140
141
  high: {label: 'High', variant: 'red'},
141
142
  medium: {label: 'Medium', variant: 'yellow'},
142
- low: {label: 'Low', variant: 'cyan'},
143
+ low: {label: 'Low', variant: 'neutral'}, // neutral: low priority is not info
143
144
  };
144
145
 
146
+ function groupByColumn(items: WorkItem[]): Record<ColumnId, WorkItem[]> {
147
+ const map: Record<ColumnId, WorkItem[]> = {
148
+ todo: [],
149
+ 'in-progress': [],
150
+ 'in-review': [],
151
+ done: [],
152
+ };
153
+ for (const item of items) {
154
+ map[item.column].push(item);
155
+ }
156
+ return map;
157
+ }
158
+
145
159
  const INITIAL_ITEMS: WorkItem[] = [
146
160
  {
147
161
  id: 't1',
@@ -246,7 +260,7 @@ const boardColumnsStyle: CSSProperties = {
246
260
  overflowX: 'auto',
247
261
  overflowY: 'auto',
248
262
  height: '100%',
249
- padding: 'var(--space-gap)',
263
+ padding: 'var(--spacing-6)',
250
264
  };
251
265
  const columnShellStyle: CSSProperties = {
252
266
  minWidth: 0,
@@ -260,14 +274,17 @@ const cardStyle: CSSProperties = {
260
274
  touchAction: 'none',
261
275
  };
262
276
  // The dragged card is lifted out of flow and follows the pointer. It ignores
263
- // pointer events so hit-testing reads the columns underneath it.
277
+ // pointer events so hit-testing reads the columns underneath it. The clone
278
+ // rides above shell chrome (layered 0-3) but stays under overlay surfaces
279
+ // (menus, dialogs layer at 500+ plus the top layer), so an open menu wins.
280
+ const DRAG_CLONE_LAYER = 100;
264
281
  const floatingStyle: CSSProperties = {
265
282
  position: 'fixed',
266
283
  insetBlockStart: 0,
267
284
  insetInlineStart: 0,
268
285
  pointerEvents: 'none',
269
286
  cursor: 'grabbing',
270
- zIndex: 1000,
287
+ zIndex: DRAG_CLONE_LAYER,
271
288
  };
272
289
  // Placeholder marking the landing slot; matches the dragged card's height.
273
290
  const ghostStyle = (height: number): CSSProperties => ({
@@ -279,7 +296,13 @@ const toolbarDividerStyle: CSSProperties = {
279
296
  alignSelf: 'stretch',
280
297
  };
281
298
  const columnEmptyStateStyle: CSSProperties = {
282
- paddingBlock: 'var(--space-gap)',
299
+ // 12px, not 24. This applies to an EmptyState inside a LayoutContent
300
+ // padding={3} (12px), so 24 rendered as 36px of block air on the empty
301
+ // branch against 12px on the populated one -- a 3x difference between two
302
+ // states of the same column, and the only nested inset in the kit that
303
+ // exceeded its container. The block padding is the CONTAINER's job; this
304
+ // one is the placeholder's room to breathe inside it.
305
+ paddingBlock: 'var(--spacing-3)',
283
306
  };
284
307
 
285
308
  // ============= CARD BODY =============
@@ -302,8 +325,8 @@ function BoardCardBody({
302
325
  return (
303
326
  <VStack gap={2}>
304
327
  <HStack hAlign="between" vAlign="start">
305
- <HStack gap={1} vAlign="center" wrap="wrap">
306
- <Badge label={item.ref} variant="neutral" />
328
+ <HStack gap={2} vAlign="center" wrap="wrap">
329
+ <Token label={item.ref} size="sm" />
307
330
  <Badge label={priority.label} variant={priority.variant} />
308
331
  </HStack>
309
332
  <MoreMenu
@@ -319,7 +342,7 @@ function BoardCardBody({
319
342
  </HStack>
320
343
 
321
344
  <VStack gap={1}>
322
- <Heading level={4}>{item.title}</Heading>
345
+ <Heading level={3}>{item.title}</Heading>
323
346
  <Text type="body" color="secondary" maxLines={2}>
324
347
  {item.description}
325
348
  </Text>
@@ -345,12 +368,33 @@ function BoardCard({
345
368
  onPointerDown: (e: ReactPointerEvent, id: string) => void;
346
369
  onMove: (id: string, to: ColumnId) => void;
347
370
  }) {
371
+ // Keyboard-move path for the core drag interaction: arrow keys move the
372
+ // focused card across columns. The pointer DnD below stays quarantined and
373
+ // untouched; this only reuses its moveItem commit.
374
+ const onKeyDown = (e: ReactKeyboardEvent) => {
375
+ const at = COLUMNS.findIndex(c => c.id === item.column);
376
+ const to =
377
+ e.key === 'ArrowRight'
378
+ ? COLUMNS[Math.min(COLUMNS.length - 1, at + 1)]
379
+ : e.key === 'ArrowLeft'
380
+ ? COLUMNS[Math.max(0, at - 1)]
381
+ : undefined;
382
+ if (!to || to.id === item.column) {
383
+ return;
384
+ }
385
+ e.preventDefault();
386
+ onMove(item.id, to.id);
387
+ };
348
388
  return (
349
389
  <Card
350
390
  ref={cardRef}
351
391
  padding={3}
352
392
  style={cardStyle}
353
- onPointerDown={e => onPointerDown(e, item.id)}>
393
+ tabIndex={0}
394
+ role="button"
395
+ aria-label={`${item.title}. In ${COLUMNS.find(c => c.id === item.column)?.title}. Press left or right arrow to move across columns.`}
396
+ onPointerDown={e => onPointerDown(e, item.id)}
397
+ onKeyDown={onKeyDown}>
354
398
  <BoardCardBody item={item} onMove={onMove} />
355
399
  </Card>
356
400
  );
@@ -376,15 +420,29 @@ function BoardColumn({
376
420
  header={
377
421
  <LayoutHeader hasDivider padding={3}>
378
422
  <HStack hAlign="between" vAlign="center">
379
- <HStack gap={2} vAlign="center">
423
+ <HStack gap={1} vAlign="center">
380
424
  <StatusDot
381
425
  variant={meta.variant}
382
426
  label={`${meta.title} status`}
427
+ isPulsing={meta.id === 'in-progress' || meta.id === 'in-review'}
383
428
  />
384
- <Heading level={4}>{meta.title}</Heading>
385
- <Tooltip content={meta.tooltip}>
386
- <Icon icon={Info} size="sm" color="secondary" />
387
- </Tooltip>
429
+ <Heading level={2}>{meta.title}</Heading>
430
+ <Popover
431
+ placement="below"
432
+ width="min(20rem, calc(100vw - 2 * var(--space-viewport)))"
433
+ label={`${meta.title} column help`}
434
+ content={
435
+ <Text type="body" color="secondary">
436
+ {meta.tooltip}
437
+ </Text>
438
+ }>
439
+ <IconButton
440
+ label={`About the ${meta.title} column`}
441
+ icon={<Icon icon={Info} size="sm" />}
442
+ variant="ghost"
443
+ size="sm"
444
+ />
445
+ </Popover>
388
446
  </HStack>
389
447
  <Text type="supporting" color="secondary" hasTabularNumbers>
390
448
  {count}
@@ -393,7 +451,7 @@ function BoardColumn({
393
451
  </LayoutHeader>
394
452
  }
395
453
  content={
396
- <LayoutContent ref={contentRef} padding={2}>
454
+ <LayoutContent ref={contentRef} padding={3}>
397
455
  {children ?? (
398
456
  <EmptyState
399
457
  isCompact
@@ -461,18 +519,7 @@ export default function KanbanBoard() {
461
519
  return cb;
462
520
  };
463
521
 
464
- const itemsByColumn = useMemo(() => {
465
- const map: Record<ColumnId, WorkItem[]> = {
466
- todo: [],
467
- 'in-progress': [],
468
- 'in-review': [],
469
- done: [],
470
- };
471
- for (const item of items) {
472
- map[item.column].push(item);
473
- }
474
- return map;
475
- }, [items]);
522
+ const itemsByColumn = groupByColumn(items);
476
523
 
477
524
  const moveItem = (id: string, to: ColumnId) => {
478
525
  setItems(prev =>
@@ -493,9 +540,12 @@ export default function KanbanBoard() {
493
540
  continue;
494
541
  }
495
542
 
496
- const ids = itemsByColumn[colId]
497
- .filter(it => it.id !== draggedId)
498
- .map(it => it.id);
543
+ const ids: string[] = [];
544
+ for (const it of itemsByColumn[colId]) {
545
+ if (it.id !== draggedId) {
546
+ ids.push(it.id);
547
+ }
548
+ }
499
549
 
500
550
  let index = ids.length;
501
551
  for (let i = 0; i < ids.length; i++) {
@@ -661,13 +711,13 @@ export default function KanbanBoard() {
661
711
  <Layout
662
712
  height="fill"
663
713
  header={
664
- <LayoutHeader hasDivider padding={4}>
714
+ <LayoutHeader hasDivider padding={6}>
665
715
  <Toolbar
666
716
  label="Board actions"
667
717
  gap={2}
668
718
  startContent={
669
719
  <>
670
- <Heading level={3}>Sprint Board</Heading>
720
+ <Heading level={1} type="display-2">Sprint Board</Heading>
671
721
  <Badge label={items.length} variant="neutral" />
672
722
  </>
673
723
  }
@@ -716,8 +766,14 @@ export default function KanbanBoard() {
716
766
  </LayoutHeader>
717
767
  }
718
768
  content={
719
- <LayoutContent padding={0}>
720
- <Grid columns={{ minWidth: 280, max: 4 }} gap={4} style={boardColumnsStyle}>
769
+ <LayoutContent padding={0} isScrollable={false}>
770
+ <Grid
771
+ columns={{ minWidth: 280, max: 4 }}
772
+ gap={4}
773
+ style={boardColumnsStyle}
774
+ tabIndex={0}
775
+ role="region"
776
+ aria-label="Sprint board columns">
721
777
  {COLUMNS.map(meta => (
722
778
  <BoardColumn
723
779
  key={meta.id}
@@ -734,10 +790,11 @@ export default function KanbanBoard() {
734
790
  {drag && draggedItem ? (
735
791
  <Card
736
792
  padding={3}
737
- elevation="high"
793
+ elevation="none"
738
794
  style={{
739
795
  ...floatingStyle,
740
796
  width: drag.width,
797
+ borderColor: 'var(--color-border-emphasized)',
741
798
  transform: `translate(${drag.pointerX - drag.offsetX}px, ${drag.pointerY - drag.offsetY}px)`,
742
799
  }}>
743
800
  <BoardCardBody item={draggedItem} onMove={() => {}} />
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  type: 'page',
3
- name: 'Card Grid',
3
+ name: 'Library',
4
4
  description: 'Browsable grid with tabs and filters',
5
- category: 'marketing',
5
+ category: 'docs',
6
6
  };
@@ -1,8 +1,12 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
  // XLE (canonical structure, validated with `bunx astryx layout check`):
3
- // L > (LH[divider] > Hd"Library"[level=1]) + (LC[p=6] > V[g=6] > (V[g=4] > TI"Search the stacks..." + (H[a=center g=4] > (SI[fill] > TgG"Filter" > OFL > Tg"All"! + Tg"Layout" + Tg"Forms") + DM"Sort")) + D + (V[g=6] > (H[j=between a=center] > Hd"Layout"[level=2] + Tx"6 items"[t=supporting]) + (G[c={min:320} g=4] > (C[p=0] > AR + (S.transparent[p=4] > V[g=1] > Hd"Card"[level=3] + Tx"Description"[t=body]))*4)))
3
+ // L > (LH[divider] > (V[g=1] > Hd"Library"[level=1] + Tx"30 components across 5 categories"[t=body])) + (LC[p=6] > V[g=8] > (V[g=4] > TI"Search the stacks…" + (H[a=center g=3] > (SI[fill] > TgG"Filter" > OFL > Tg"All"! + Tg"Layout" + Tg"Forms" + Tg"Navigation" + Tg"Feedback" + Tg"Data") + DM"Sort")) + D + (V[g=8] > (H[j=between a=center] > Hd"Layout"[level=2] + Tx"6 items"[t=body]) + (G[c={min:280} g=4] > (C[p=0] > AR + (S.transparent[p=4] > V[g=1] > Hd"Card"[level=3] + Tx"Description"[t=supporting]))*4)))
4
4
 
5
- import {useState, useMemo, type CSSProperties} from 'react';
5
+ /**
6
+ * Library — a browsable grid of design-system entries grouped by category. Frame: page header (title) | content column (search, filter row, s (Frame/responsive/container: see XLE header above.)
7
+ */
8
+
9
+ import {useState, useMemo} from 'react';
6
10
  import {Layout, LayoutHeader, LayoutContent} from '@astryxdesign/core/Layout';
7
11
  import {Text, Heading} from '@astryxdesign/core/Text';
8
12
  import {Card} from '@astryxdesign/core/Card';
@@ -19,6 +23,8 @@ import {Button} from '@astryxdesign/core/Button';
19
23
  import {EmptyState} from '@astryxdesign/core/EmptyState';
20
24
  import {Icon} from '@astryxdesign/core/Icon';
21
25
  import {Search} from 'lucide-react';
26
+ import {SceneTile} from 'astryx-dracula/shared/scene-tile';
27
+ import type {SceneHue} from 'astryx-dracula/shared/scene-hues';
22
28
 
23
29
  interface LibraryItem {
24
30
  id: string;
@@ -28,9 +34,11 @@ interface LibraryItem {
28
34
  type: 'Component' | 'Pattern' | 'Utility';
29
35
  }
30
36
 
31
- // Dracula accent per category shelf, drawn from the fixed badge vocabulary.
32
- const CATEGORY_HUES: Record<string, string> = {
33
- Layout: 'var(--dracula-purple)',
37
+ // One Dracula accent per category shelf. Purple stays out of the map: it is
38
+ // reserved for interactive elements, and these hues only tint the thumbnail
39
+ // dot, so each shelf takes a non-purple accent instead.
40
+ const CATEGORY_HUES: Record<string, SceneHue> = {
41
+ Layout: 'var(--dracula-orange)',
34
42
  Forms: 'var(--dracula-cyan)',
35
43
  Navigation: 'var(--dracula-pink)',
36
44
  Feedback: 'var(--dracula-yellow)',
@@ -270,40 +278,16 @@ const ITEMS: LibraryItem[] = [
270
278
  },
271
279
  ];
272
280
 
273
- const thumbnailImage: CSSProperties = {
274
- width: '100%',
275
- height: '100%',
276
- display: 'block',
277
- };
278
-
279
281
  // =============================================================================
280
282
  // Side Nav
281
283
  // =============================================================================
282
284
 
283
285
  function LibraryCard({item}: {item: LibraryItem}) {
284
- const hue = CATEGORY_HUES[item.category] ?? 'var(--dracula-purple)';
286
+ const hue = CATEGORY_HUES[item.category] ?? 'var(--dracula-comment)';
285
287
  return (
286
288
  <Card padding={0}>
287
289
  <AspectRatio ratio={16 / 9}>
288
- <svg
289
- viewBox="0 0 400 300"
290
- preserveAspectRatio="xMidYMid slice"
291
- style={thumbnailImage}
292
- role="img"
293
- aria-label={`${item.name} thumbnail`}>
294
- <rect width="400" height="300" fill="var(--dracula-bg-light)" />
295
- <g
296
- transform="translate(200 150)"
297
- fill="none"
298
- stroke="var(--dracula-comment)"
299
- strokeWidth="5"
300
- strokeLinecap="round"
301
- strokeLinejoin="round">
302
- <rect x="-44" y="-44" width="88" height="88" rx="5" />
303
- <circle cx="18" cy="-18" r="2.5" fill={hue} stroke="none" />
304
- <path d="M-34 30 L-8 0 L10 18 L20 8 L34 24" />
305
- </g>
306
- </svg>
290
+ <SceneTile label={`${item.name} thumbnail`} hue={hue} size="lg" />
307
291
  </AspectRatio>
308
292
  <Section variant="transparent" padding={4}>
309
293
  <VStack gap={1}>
@@ -325,14 +309,14 @@ function LibrarySection({
325
309
  items: LibraryItem[];
326
310
  }) {
327
311
  return (
328
- <VStack gap={6}>
312
+ <VStack gap={8}>
329
313
  <HStack justify="between" vAlign="center">
330
314
  <Heading level={2}>{category}</Heading>
331
- <Text type="supporting" color="secondary" hasTabularNumbers>
315
+ <Text type="body" color="secondary" hasTabularNumbers>
332
316
  {items.length} {items.length === 1 ? 'item' : 'items'}
333
317
  </Text>
334
318
  </HStack>
335
- <Grid columns={{minWidth: 320}} gap={4}>
319
+ <Grid columns={{minWidth: 280}} gap={4}>
336
320
  {items.map(item => (
337
321
  <LibraryCard key={item.id} item={item} />
338
322
  ))}
@@ -382,32 +366,43 @@ export default function LibraryGrid() {
382
366
  }
383
367
  group.push(item);
384
368
  }
385
- return order
386
- .filter(cat => map.has(cat))
387
- .map(cat => ({category: cat, items: map.get(cat) ?? []}));
369
+ const result: Array<{category: string; items: LibraryItem[]}> = [];
370
+ for (const cat of order) {
371
+ const items = map.get(cat);
372
+ if (items) {
373
+ result.push({category: cat, items});
374
+ }
375
+ }
376
+ return result;
388
377
  }, [activeTab, filtered]);
389
378
 
390
379
  return (
391
380
  <Layout
381
+ height="fill"
392
382
  header={
393
383
  <LayoutHeader hasDivider padding={6}>
394
- <Heading level={1}>Library</Heading>
384
+ <VStack gap={1}>
385
+ <Heading level={1}>Library</Heading>
386
+ <Text type="body" color="secondary">
387
+ 30 components across 5 categories
388
+ </Text>
389
+ </VStack>
395
390
  </LayoutHeader>
396
391
  }
397
392
  content={
398
393
  <LayoutContent padding={6}>
399
- <VStack gap={6}>
394
+ <VStack gap={8}>
400
395
  <VStack gap={4}>
401
396
  <TextInput
402
397
  label="Search"
403
398
  isLabelHidden
404
- placeholder="Search the stacks..."
399
+ placeholder="Search the stacks…"
405
400
  value={search}
406
401
  onChange={setSearch}
407
402
  startIcon={Search}
408
403
  size="lg"
409
404
  />
410
- <HStack vAlign="center" gap={4}>
405
+ <HStack vAlign="center" gap={3}>
411
406
  <StackItem size="fill">
412
407
  <VStack>
413
408
  <ToggleButtonGroup
@@ -470,7 +465,7 @@ export default function LibraryGrid() {
470
465
  }
471
466
  />
472
467
  ) : (
473
- <VStack gap={6}>
468
+ <VStack gap={8}>
474
469
  {(
475
470
  groupedSections ?? [{category: activeTab, items: filtered}]
476
471
  ).flatMap(section => [