astryx-dracula 0.5.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BRAND.md +3 -3
- package/README.md +7 -4
- package/USAGE.md +49 -49
- package/astryx-dracula.d.ts +2 -2
- package/astryx-dracula.js +25 -9
- package/astryx-dracula.variants.d.ts +2 -2
- package/astryx.integration.mjs +1 -1
- package/icons.mjs +21 -17
- package/icons.tsx +69 -62
- package/package.json +125 -120
- package/shared/auth-chrome-config.ts +6 -6
- package/shared/auth-chrome.tsx +143 -144
- package/shared/auth-copy.ts +14 -14
- package/shared/chaptered-doc-config.ts +48 -51
- package/shared/chaptered-doc.tsx +267 -289
- package/shared/chart-hues.ts +25 -10
- package/shared/chart-labels.tsx +31 -30
- package/shared/chart-legend.tsx +55 -56
- package/shared/chart-panel-style.ts +3 -3
- package/shared/data-bar.tsx +97 -102
- package/shared/format-money.ts +1 -1
- package/shared/gallery-image.ts +6 -6
- package/shared/login-demo.ts +1 -1
- package/shared/metric-card.tsx +101 -105
- package/shared/metric-delta.tsx +28 -27
- package/shared/order-desk.tsx +205 -216
- package/shared/revenue-chart.tsx +145 -165
- package/shared/scene-castle.tsx +206 -291
- package/shared/scene-frame.tsx +33 -32
- package/shared/scene-hues.ts +17 -17
- package/shared/scene-tile.tsx +88 -92
- package/shared/settings-data.ts +119 -125
- package/shared/settings-rows.tsx +122 -159
- package/shared/sparkline.tsx +75 -88
- package/shared/sso-icons.tsx +10 -22
- package/shared/stars.tsx +16 -25
- package/templates/ai-chat-landing.template.mjs +5 -4
- package/templates/ai-chat-landing.tsx +473 -460
- package/templates/ai-chat.template.mjs +5 -4
- package/templates/ai-chat.tsx +543 -612
- package/templates/blank.template.mjs +5 -4
- package/templates/blank.tsx +18 -14
- package/templates/centered-hero.template.mjs +5 -4
- package/templates/centered-hero.tsx +55 -68
- package/templates/classic-gallery.template.mjs +5 -4
- package/templates/classic-gallery.tsx +97 -104
- package/templates/contact-form.template.mjs +5 -4
- package/templates/contact-form.tsx +247 -282
- package/templates/dashboard-portfolio.template.mjs +5 -4
- package/templates/dashboard-portfolio.tsx +717 -548
- package/templates/dashboard.template.mjs +5 -4
- package/templates/dashboard.tsx +596 -567
- package/templates/detail-page.template.mjs +5 -4
- package/templates/detail-page.tsx +546 -603
- package/templates/documentation-design.template.mjs +5 -4
- package/templates/documentation-design.tsx +231 -243
- package/templates/documentation-technical.template.mjs +5 -4
- package/templates/documentation-technical.tsx +236 -239
- package/templates/documentation.template.mjs +5 -4
- package/templates/documentation.tsx +267 -279
- package/templates/editor.template.mjs +5 -4
- package/templates/editor.tsx +844 -877
- package/templates/file-explorer.template.mjs +5 -4
- package/templates/file-explorer.tsx +566 -590
- package/templates/form-two-column.template.mjs +5 -4
- package/templates/form-two-column.tsx +195 -210
- package/templates/gallery-hero.template.mjs +5 -4
- package/templates/gallery-hero.tsx +93 -114
- package/templates/ide.template.mjs +5 -4
- package/templates/ide.tsx +407 -453
- package/templates/incident-console.template.mjs +5 -4
- package/templates/incident-console.tsx +593 -575
- package/templates/kanban-board.template.mjs +5 -4
- package/templates/kanban-board.tsx +665 -683
- package/templates/library.template.mjs +5 -4
- package/templates/library.tsx +409 -430
- package/templates/login-card.template.mjs +5 -4
- package/templates/login-card.tsx +63 -72
- package/templates/login-split.template.mjs +5 -4
- package/templates/login-split.tsx +192 -193
- package/templates/login-sso.template.mjs +5 -4
- package/templates/login-sso.tsx +257 -258
- package/templates/login.template.mjs +5 -4
- package/templates/login.tsx +53 -49
- package/templates/messaging-shell.template.mjs +5 -4
- package/templates/messaging-shell.tsx +556 -574
- package/templates/mixed-gallery.template.mjs +5 -4
- package/templates/mixed-gallery.tsx +60 -58
- package/templates/payment-form.template.mjs +5 -4
- package/templates/payment-form.tsx +882 -991
- package/templates/product-detail.template.mjs +5 -4
- package/templates/product-detail.tsx +261 -272
- package/templates/product-gallery.template.mjs +5 -4
- package/templates/product-gallery.tsx +126 -137
- package/templates/product-tour.template.mjs +5 -4
- package/templates/product-tour.tsx +741 -773
- package/templates/settings-dialog.template.mjs +5 -4
- package/templates/settings-dialog.tsx +688 -717
- package/templates/settings-sidebar.template.mjs +5 -4
- package/templates/settings-sidebar.tsx +762 -807
- package/templates/settings.template.mjs +5 -4
- package/templates/settings.tsx +289 -304
- package/templates/shell-nav.template.mjs +5 -4
- package/templates/shell-nav.tsx +212 -219
- package/templates/shell-side-nav.template.mjs +5 -4
- package/templates/shell-side-nav.tsx +135 -157
- package/templates/shell-top-nav.template.mjs +5 -4
- package/templates/shell-top-nav.tsx +182 -203
- package/templates/side-gallery.template.mjs +5 -4
- package/templates/side-gallery.tsx +85 -90
- package/templates/table-grouped.template.mjs +5 -4
- package/templates/table-grouped.tsx +1000 -1053
- package/templates/table-page-chart.template.mjs +5 -4
- package/templates/table-page-chart.tsx +400 -398
- package/templates/table-page-heatmap-status.template.mjs +5 -4
- package/templates/table-page-heatmap-status.tsx +483 -512
- package/templates/table-page-shoe-store-heatmap.template.mjs +5 -4
- package/templates/table-page-shoe-store-heatmap.tsx +748 -746
- package/templates/table-page.template.mjs +5 -4
- package/templates/table-page.tsx +396 -405
- package/templates/table.template.mjs +5 -4
- package/templates/table.tsx +92 -93
- package/templates/tech-report.template.mjs +5 -4
- package/templates/tech-report.tsx +1316 -1304
- package/templates/theme-showcase.template.mjs +5 -4
- package/templates/theme-showcase.tsx +871 -951
- package/theme.css +35 -77
- package/theme.css.d.ts +9 -0
- package/tokens.css +373 -380
|
@@ -1,624 +1,600 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
3
|
-
//
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
5
|
+
// L[h=fill] > (Tbar[size=sm dv=[bottom]] > (IB"Go back" + IB"Go forward" + Tx"Folder"[t=label]) + (SG"View mode" > SGI*4) + (IB"Group" + IB"Share" + IB"Tags" + IB"More" + IB"Search")) + (LC[p=0 !scroll] > (VH"File Explorer" + H[h=100%] > (S.transparent[p=2 w=240 dv=[end]] > UL[density=compact !hasDividers] > (LI > Ic + Tx"Item"[t=body])*3)*3 + (S.transparent[p=4 w=320] > V[g=4 a=center] > Av[size=96] + (V[g=1 a=center] > Tx"Name"[t=body] + Tx"Kind"[t=supporting]) + (ML"Information" > MLI*3))))
|
|
4
6
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {MetadataList, MetadataListItem} from '@astryxdesign/core/MetadataList';
|
|
7
|
+
import { Avatar } from "@astryxdesign/core/Avatar";
|
|
8
|
+
import { EmptyState } from "@astryxdesign/core/EmptyState";
|
|
9
|
+
import { useMediaQuery } from "@astryxdesign/core/hooks";
|
|
10
|
+
import { Icon } from "@astryxdesign/core/Icon";
|
|
11
|
+
import { IconButton } from "@astryxdesign/core/IconButton";
|
|
12
|
+
import { HStack, Layout, LayoutContent, VStack } from "@astryxdesign/core/Layout";
|
|
13
|
+
import { List, ListItem } from "@astryxdesign/core/List";
|
|
14
|
+
import { MetadataList, MetadataListItem } from "@astryxdesign/core/MetadataList";
|
|
15
|
+
import { Section } from "@astryxdesign/core/Section";
|
|
16
|
+
import { SegmentedControl, SegmentedControlItem } from "@astryxdesign/core/SegmentedControl";
|
|
17
|
+
import { Text } from "@astryxdesign/core/Text";
|
|
18
|
+
import { Toolbar } from "@astryxdesign/core/Toolbar";
|
|
19
|
+
import { VisuallyHidden } from "@astryxdesign/core/VisuallyHidden";
|
|
19
20
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
FileText,
|
|
36
|
-
Folder,
|
|
37
|
-
} from 'lucide-react';
|
|
21
|
+
ChevronLeft,
|
|
22
|
+
ChevronRight,
|
|
23
|
+
Columns,
|
|
24
|
+
Ellipsis,
|
|
25
|
+
FileText,
|
|
26
|
+
Folder,
|
|
27
|
+
LayoutGrid,
|
|
28
|
+
Rows3,
|
|
29
|
+
Search,
|
|
30
|
+
Share2,
|
|
31
|
+
SlidersHorizontal,
|
|
32
|
+
Table,
|
|
33
|
+
Tag,
|
|
34
|
+
} from "lucide-react";
|
|
35
|
+
import { useMemo, useState } from "react";
|
|
38
36
|
|
|
39
37
|
interface FileSystemItem {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
type: "file" | "folder";
|
|
41
|
+
children?: FileSystemItem[];
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
const FILESYSTEM: FileSystemItem[] = [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
],
|
|
262
|
-
},
|
|
45
|
+
{
|
|
46
|
+
id: "applications",
|
|
47
|
+
name: "Applications",
|
|
48
|
+
type: "folder",
|
|
49
|
+
children: [
|
|
50
|
+
{
|
|
51
|
+
id: "chrome-apps",
|
|
52
|
+
name: "Chrome Apps",
|
|
53
|
+
type: "folder",
|
|
54
|
+
children: [
|
|
55
|
+
{ id: "component-lab", name: "Palette Lab.app", type: "file" },
|
|
56
|
+
{ id: "google-chat", name: "Night Chat.app", type: "file" },
|
|
57
|
+
{ id: "workchat", name: "Coven.app", type: "file" },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
{ id: "figma", name: "Figma.app", type: "file" },
|
|
61
|
+
{ id: "safari", name: "Safari.app", type: "file" },
|
|
62
|
+
{ id: "slack", name: "Slack.app", type: "file" },
|
|
63
|
+
{ id: "terminal", name: "Terminal.app", type: "file" },
|
|
64
|
+
{ id: "vscode", name: "Visual Studio Code.app", type: "file" },
|
|
65
|
+
{ id: "xcode", name: "Xcode.app", type: "file" },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{ id: "debug-log", name: "debug-nocturne.log", type: "file" },
|
|
69
|
+
{
|
|
70
|
+
id: "desktop",
|
|
71
|
+
name: "Desktop",
|
|
72
|
+
type: "folder",
|
|
73
|
+
children: [
|
|
74
|
+
{ id: "screenshot1", name: "Screenshot 2026-10-31.png", type: "file" },
|
|
75
|
+
{ id: "notes-txt", name: "midnight-notes.txt", type: "file" },
|
|
76
|
+
{
|
|
77
|
+
id: "projects",
|
|
78
|
+
name: "Projects",
|
|
79
|
+
type: "folder",
|
|
80
|
+
children: [
|
|
81
|
+
{ id: "readme-proj", name: "README.md", type: "file" },
|
|
82
|
+
{
|
|
83
|
+
id: "src-folder",
|
|
84
|
+
name: "src",
|
|
85
|
+
type: "folder",
|
|
86
|
+
children: [
|
|
87
|
+
{ id: "index-ts", name: "index.ts", type: "file" },
|
|
88
|
+
{ id: "app-tsx", name: "App.tsx", type: "file" },
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "documents",
|
|
97
|
+
name: "Documents",
|
|
98
|
+
type: "folder",
|
|
99
|
+
children: [
|
|
100
|
+
{ id: "design-spec", name: "dracula-spec.pdf", type: "file" },
|
|
101
|
+
{ id: "resume", name: "resume.docx", type: "file" },
|
|
102
|
+
{
|
|
103
|
+
id: "work",
|
|
104
|
+
name: "Work",
|
|
105
|
+
type: "folder",
|
|
106
|
+
children: [
|
|
107
|
+
{ id: "q1-report", name: "Q1-report.xlsx", type: "file" },
|
|
108
|
+
{ id: "presentation", name: "team-presentation.pptx", type: "file" },
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "downloads",
|
|
115
|
+
name: "Downloads",
|
|
116
|
+
type: "folder",
|
|
117
|
+
children: [
|
|
118
|
+
{ id: "archive", name: "archive.zip", type: "file" },
|
|
119
|
+
{ id: "installer", name: "installer.dmg", type: "file" },
|
|
120
|
+
{ id: "photo", name: "castle-2026.jpg", type: "file" },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{ id: "login-screenshot", name: "login-midnight-screenshot.png", type: "file" },
|
|
124
|
+
{
|
|
125
|
+
id: "movies",
|
|
126
|
+
name: "Movies",
|
|
127
|
+
type: "folder",
|
|
128
|
+
children: [{ id: "recording", name: "screen-recording.mov", type: "file" }],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "music",
|
|
132
|
+
name: "Music",
|
|
133
|
+
type: "folder",
|
|
134
|
+
children: [{ id: "playlist", name: "favorites.m3u", type: "file" }],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "node-modules",
|
|
138
|
+
name: "node_modules",
|
|
139
|
+
type: "folder",
|
|
140
|
+
children: [
|
|
141
|
+
{
|
|
142
|
+
id: "react",
|
|
143
|
+
name: "react",
|
|
144
|
+
type: "folder",
|
|
145
|
+
children: [{ id: "react-index", name: "index.js", type: "file" }],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: "react-dom",
|
|
149
|
+
name: "react-dom",
|
|
150
|
+
type: "folder",
|
|
151
|
+
children: [{ id: "react-dom-index", name: "index.js", type: "file" }],
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "pictures",
|
|
157
|
+
name: "Pictures",
|
|
158
|
+
type: "folder",
|
|
159
|
+
children: [
|
|
160
|
+
{
|
|
161
|
+
id: "vacation",
|
|
162
|
+
name: "transylvania-2026",
|
|
163
|
+
type: "folder",
|
|
164
|
+
children: [
|
|
165
|
+
{ id: "img1", name: "IMG_0001.jpg", type: "file" },
|
|
166
|
+
{ id: "img2", name: "IMG_0002.jpg", type: "file" },
|
|
167
|
+
{ id: "img3", name: "IMG_0003.jpg", type: "file" },
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "screenshots-folder",
|
|
172
|
+
name: "Screenshots",
|
|
173
|
+
type: "folder",
|
|
174
|
+
children: [
|
|
175
|
+
{ id: "ss1", name: "Screen Shot 1.png", type: "file" },
|
|
176
|
+
{ id: "ss2", name: "Screen Shot 2.png", type: "file" },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "public",
|
|
183
|
+
name: "Public",
|
|
184
|
+
type: "folder",
|
|
185
|
+
children: [{ id: "drop-box", name: "Drop Box", type: "folder", children: [] }],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: "astryx",
|
|
189
|
+
name: "astryx",
|
|
190
|
+
type: "folder",
|
|
191
|
+
children: [
|
|
192
|
+
{ id: "astryx-readme", name: "README.md", type: "file" },
|
|
193
|
+
{ id: "astryx-pkg", name: "package.json", type: "file" },
|
|
194
|
+
{
|
|
195
|
+
id: "astryx-packages",
|
|
196
|
+
name: "packages",
|
|
197
|
+
type: "folder",
|
|
198
|
+
children: [
|
|
199
|
+
{
|
|
200
|
+
id: "astryx-core",
|
|
201
|
+
name: "core",
|
|
202
|
+
type: "folder",
|
|
203
|
+
children: [
|
|
204
|
+
{
|
|
205
|
+
id: "core-src",
|
|
206
|
+
name: "src",
|
|
207
|
+
type: "folder",
|
|
208
|
+
children: [
|
|
209
|
+
{ id: "button-tsx", name: "Button.tsx", type: "file" },
|
|
210
|
+
{ id: "card-tsx", name: "Card.tsx", type: "file" },
|
|
211
|
+
{ id: "text-tsx", name: "Text.tsx", type: "file" },
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "astryx-cli",
|
|
218
|
+
name: "cli",
|
|
219
|
+
type: "folder",
|
|
220
|
+
children: [{ id: "cli-index", name: "index.ts", type: "file" }],
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "astryx-apps",
|
|
226
|
+
name: "apps",
|
|
227
|
+
type: "folder",
|
|
228
|
+
children: [
|
|
229
|
+
{
|
|
230
|
+
id: "storybook",
|
|
231
|
+
name: "storybook",
|
|
232
|
+
type: "folder",
|
|
233
|
+
children: [
|
|
234
|
+
{
|
|
235
|
+
id: "sb-config",
|
|
236
|
+
name: ".storybook",
|
|
237
|
+
type: "folder",
|
|
238
|
+
children: [],
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "sandbox-app",
|
|
244
|
+
name: "sandbox",
|
|
245
|
+
type: "folder",
|
|
246
|
+
children: [
|
|
247
|
+
{
|
|
248
|
+
id: "sandbox-src",
|
|
249
|
+
name: "src",
|
|
250
|
+
type: "folder",
|
|
251
|
+
children: [],
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
263
259
|
];
|
|
264
260
|
|
|
265
261
|
// Static toolbar content, hoisted out of the render path: neither element
|
|
266
262
|
// reads component state, so rebuilding them per render buys nothing.
|
|
267
263
|
const viewSwitcher = (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
264
|
+
<SegmentedControl value="column" onChange={() => {}} label="View mode">
|
|
265
|
+
<SegmentedControlItem
|
|
266
|
+
value="grid"
|
|
267
|
+
label="Grid"
|
|
268
|
+
icon={<Icon icon={LayoutGrid} size="sm" />}
|
|
269
|
+
isLabelHidden
|
|
270
|
+
/>
|
|
271
|
+
<SegmentedControlItem
|
|
272
|
+
value="list"
|
|
273
|
+
label="List"
|
|
274
|
+
icon={<Icon icon={Rows3} size="sm" />}
|
|
275
|
+
isLabelHidden
|
|
276
|
+
/>
|
|
277
|
+
<SegmentedControlItem
|
|
278
|
+
value="column"
|
|
279
|
+
label="Column"
|
|
280
|
+
icon={<Icon icon={Columns} size="sm" />}
|
|
281
|
+
isLabelHidden
|
|
282
|
+
/>
|
|
283
|
+
<SegmentedControlItem
|
|
284
|
+
value="gallery"
|
|
285
|
+
label="Gallery"
|
|
286
|
+
icon={<Icon icon={Table} size="sm" />}
|
|
287
|
+
isLabelHidden
|
|
288
|
+
/>
|
|
289
|
+
</SegmentedControl>
|
|
294
290
|
);
|
|
295
291
|
const fileActions = (
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
292
|
+
<>
|
|
293
|
+
<IconButton
|
|
294
|
+
variant="ghost"
|
|
295
|
+
size="sm"
|
|
296
|
+
icon={<Icon icon={SlidersHorizontal} size="sm" />}
|
|
297
|
+
label="Group"
|
|
298
|
+
tooltip="Group"
|
|
299
|
+
/>
|
|
300
|
+
<IconButton
|
|
301
|
+
variant="ghost"
|
|
302
|
+
size="sm"
|
|
303
|
+
icon={<Icon icon={Share2} size="sm" />}
|
|
304
|
+
label="Share"
|
|
305
|
+
tooltip="Share"
|
|
306
|
+
/>
|
|
307
|
+
<IconButton
|
|
308
|
+
variant="ghost"
|
|
309
|
+
size="sm"
|
|
310
|
+
icon={<Icon icon={Tag} size="sm" />}
|
|
311
|
+
label="Tags"
|
|
312
|
+
tooltip="Tags"
|
|
313
|
+
/>
|
|
314
|
+
<IconButton
|
|
315
|
+
variant="ghost"
|
|
316
|
+
size="sm"
|
|
317
|
+
icon={<Icon icon={Ellipsis} size="sm" />}
|
|
318
|
+
label="More"
|
|
319
|
+
tooltip="More"
|
|
320
|
+
/>
|
|
321
|
+
<IconButton
|
|
322
|
+
variant="ghost"
|
|
323
|
+
size="sm"
|
|
324
|
+
icon={<Icon icon={Search} size="sm" />}
|
|
325
|
+
label="Search"
|
|
326
|
+
tooltip="Search"
|
|
327
|
+
/>
|
|
328
|
+
</>
|
|
333
329
|
);
|
|
334
330
|
|
|
335
331
|
function findItem(items: FileSystemItem[], id: string): FileSystemItem | null {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
332
|
+
for (const item of items) {
|
|
333
|
+
if (item.id === id) {
|
|
334
|
+
return item;
|
|
335
|
+
}
|
|
336
|
+
if (item.children) {
|
|
337
|
+
const found = findItem(item.children, id);
|
|
338
|
+
if (found) {
|
|
339
|
+
return found;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
348
344
|
}
|
|
349
345
|
|
|
350
346
|
function getFileExtension(name: string): string {
|
|
351
|
-
|
|
352
|
-
|
|
347
|
+
const dot = name.lastIndexOf(".");
|
|
348
|
+
return dot > 0 ? name.substring(dot + 1).toUpperCase() : "File";
|
|
353
349
|
}
|
|
354
350
|
|
|
355
351
|
export default function FileExplorer() {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
352
|
+
const [selectedPath, setSelectedPath] = useState<string[]>([
|
|
353
|
+
"applications",
|
|
354
|
+
"chrome-apps",
|
|
355
|
+
"component-lab",
|
|
356
|
+
]);
|
|
361
357
|
|
|
362
|
-
|
|
358
|
+
const isNarrow = useMediaQuery("(max-width: 768px)");
|
|
363
359
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
360
|
+
const columns = useMemo(() => {
|
|
361
|
+
// `id` names the folder a column lists, so the React key stays put when
|
|
362
|
+
// narrow mode slices the row down to the last visible column.
|
|
363
|
+
const cols: {
|
|
364
|
+
id: string;
|
|
365
|
+
items: FileSystemItem[];
|
|
366
|
+
selectedId: string | null;
|
|
367
|
+
}[] = [];
|
|
368
|
+
cols.push({
|
|
369
|
+
id: "root",
|
|
370
|
+
items: FILESYSTEM,
|
|
371
|
+
selectedId: selectedPath[0] ?? null,
|
|
372
|
+
});
|
|
373
|
+
let currentItems: FileSystemItem[] = FILESYSTEM;
|
|
374
|
+
for (let i = 0; i < selectedPath.length; i++) {
|
|
375
|
+
const selected = currentItems.find((item) => item.id === selectedPath[i]);
|
|
376
|
+
if (selected?.children && selected.children.length > 0) {
|
|
377
|
+
cols.push({
|
|
378
|
+
id: selectedPath[i],
|
|
379
|
+
items: selected.children,
|
|
380
|
+
selectedId: selectedPath[i + 1] ?? null,
|
|
381
|
+
});
|
|
382
|
+
currentItems = selected.children;
|
|
383
|
+
} else {
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return cols;
|
|
388
|
+
}, [selectedPath]);
|
|
393
389
|
|
|
394
|
-
|
|
395
|
-
|
|
390
|
+
const columnOffset = isNarrow ? Math.max(columns.length - 1, 0) : 0;
|
|
391
|
+
const visibleColumns = isNarrow ? columns.slice(-1) : columns;
|
|
396
392
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
return 'Home';
|
|
414
|
-
}, [selectedPath]);
|
|
393
|
+
const currentFolderName = useMemo(() => {
|
|
394
|
+
if (selectedPath.length === 0) {
|
|
395
|
+
return "Home";
|
|
396
|
+
}
|
|
397
|
+
const lastId = selectedPath[selectedPath.length - 1];
|
|
398
|
+
const item = findItem(FILESYSTEM, lastId);
|
|
399
|
+
if (item?.type === "folder") {
|
|
400
|
+
return item.name;
|
|
401
|
+
}
|
|
402
|
+
if (selectedPath.length >= 2) {
|
|
403
|
+
const parent = findItem(FILESYSTEM, selectedPath[selectedPath.length - 2]);
|
|
404
|
+
return parent?.name ?? "Home";
|
|
405
|
+
}
|
|
406
|
+
return "Home";
|
|
407
|
+
}, [selectedPath]);
|
|
415
408
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
409
|
+
const selectedFile = useMemo(() => {
|
|
410
|
+
if (selectedPath.length === 0) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
const lastId = selectedPath[selectedPath.length - 1];
|
|
414
|
+
const item = findItem(FILESYSTEM, lastId);
|
|
415
|
+
return item?.type === "file" ? item : null;
|
|
416
|
+
}, [selectedPath]);
|
|
424
417
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
418
|
+
// Narrow mode is one pane at a time, the same master→detail shape the
|
|
419
|
+
// folder columns already use: the deepest column, or the file preview when
|
|
420
|
+
// the selection ends on a file. Beside each other the column and the
|
|
421
|
+
// preview need 240 + 320 = 560px, so in a 390px pane the preview was cut at
|
|
422
|
+
// the viewport edge with nothing to scroll it into view. "Go back" (:464)
|
|
423
|
+
// pops the selected file off the path, so it is also the way back from the
|
|
424
|
+
// preview to the column.
|
|
425
|
+
const isPreviewPane = isNarrow && selectedFile != null;
|
|
433
426
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
427
|
+
const handleSelect = (columnIndex: number, itemId: string) => {
|
|
428
|
+
setSelectedPath([...selectedPath.slice(0, columnIndex), itemId]);
|
|
429
|
+
};
|
|
437
430
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
431
|
+
const titleContent = (
|
|
432
|
+
<>
|
|
433
|
+
<IconButton
|
|
434
|
+
variant="ghost"
|
|
435
|
+
size="sm"
|
|
436
|
+
icon={<Icon icon={ChevronLeft} size="sm" />}
|
|
437
|
+
onClick={() => {
|
|
438
|
+
if (selectedPath.length > 0) {
|
|
439
|
+
setSelectedPath(selectedPath.slice(0, -1));
|
|
440
|
+
}
|
|
441
|
+
}}
|
|
442
|
+
isDisabled={selectedPath.length === 0}
|
|
443
|
+
label="Go back"
|
|
444
|
+
tooltip="Go back"
|
|
445
|
+
/>
|
|
446
|
+
<IconButton
|
|
447
|
+
variant="ghost"
|
|
448
|
+
size="sm"
|
|
449
|
+
icon={<Icon icon={ChevronRight} size="sm" />}
|
|
450
|
+
isDisabled
|
|
451
|
+
label="Go forward"
|
|
452
|
+
tooltip="Go forward"
|
|
453
|
+
/>
|
|
454
|
+
<Text type="label" maxLines={1}>
|
|
455
|
+
{currentFolderName}
|
|
456
|
+
</Text>
|
|
457
|
+
</>
|
|
458
|
+
);
|
|
466
459
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
<MetadataListItem label="Modified">
|
|
608
|
-
<Text type="body">Yesterday, 10:27 PM</Text>
|
|
609
|
-
</MetadataListItem>
|
|
610
|
-
<MetadataListItem label="Kind">
|
|
611
|
-
<Text type="body">
|
|
612
|
-
{getFileExtension(selectedFile.name)} Document
|
|
613
|
-
</Text>
|
|
614
|
-
</MetadataListItem>
|
|
615
|
-
</MetadataList>
|
|
616
|
-
</VStack>
|
|
617
|
-
</Section>
|
|
618
|
-
)}
|
|
619
|
-
</HStack>
|
|
620
|
-
</LayoutContent>
|
|
621
|
-
}
|
|
622
|
-
/>
|
|
623
|
-
);
|
|
460
|
+
return (
|
|
461
|
+
<Layout
|
|
462
|
+
style={{ height: "100dvh" }}
|
|
463
|
+
height="fill"
|
|
464
|
+
header={
|
|
465
|
+
<>
|
|
466
|
+
<Toolbar
|
|
467
|
+
label="File Explorer"
|
|
468
|
+
size="sm"
|
|
469
|
+
dividers={isNarrow ? undefined : ["bottom"]}
|
|
470
|
+
startContent={titleContent}
|
|
471
|
+
centerContent={isNarrow ? undefined : viewSwitcher}
|
|
472
|
+
endContent={isNarrow ? undefined : fileActions}
|
|
473
|
+
/>
|
|
474
|
+
{isNarrow && (
|
|
475
|
+
<Section variant="transparent" padding={2} dividers={["bottom"]}>
|
|
476
|
+
<HStack
|
|
477
|
+
gap={2}
|
|
478
|
+
vAlign="center"
|
|
479
|
+
style={{ overflowX: "auto" }}
|
|
480
|
+
role="region"
|
|
481
|
+
aria-label="View and file actions"
|
|
482
|
+
tabIndex={0}
|
|
483
|
+
>
|
|
484
|
+
{viewSwitcher}
|
|
485
|
+
{fileActions}
|
|
486
|
+
</HStack>
|
|
487
|
+
</Section>
|
|
488
|
+
)}
|
|
489
|
+
</>
|
|
490
|
+
}
|
|
491
|
+
content={
|
|
492
|
+
<LayoutContent padding={0} isScrollable={false}>
|
|
493
|
+
<VisuallyHidden as="h1">File Explorer</VisuallyHidden>
|
|
494
|
+
<HStack height="100%" style={{ overflowX: "auto", overflowY: "hidden" }}>
|
|
495
|
+
{!isPreviewPane &&
|
|
496
|
+
visibleColumns.map((col, colIndex) => {
|
|
497
|
+
const trueIndex = columnOffset + colIndex;
|
|
498
|
+
const showDivider = trueIndex < columns.length - 1 || selectedFile != null;
|
|
499
|
+
return (
|
|
500
|
+
<Section
|
|
501
|
+
key={col.id}
|
|
502
|
+
width={240}
|
|
503
|
+
padding={2}
|
|
504
|
+
variant="transparent"
|
|
505
|
+
dividers={showDivider ? ["end"] : undefined}
|
|
506
|
+
style={{ overflowY: "auto", flexShrink: 0 }}
|
|
507
|
+
role="region"
|
|
508
|
+
aria-label={`Folder column ${trueIndex + 1}`}
|
|
509
|
+
tabIndex={0}
|
|
510
|
+
>
|
|
511
|
+
{col.items.length === 0 ? (
|
|
512
|
+
<EmptyState
|
|
513
|
+
title="Quiet in the crypt"
|
|
514
|
+
description="This folder holds no scrolls yet."
|
|
515
|
+
isCompact
|
|
516
|
+
/>
|
|
517
|
+
) : (
|
|
518
|
+
<List density="compact" hasDividers={false}>
|
|
519
|
+
{col.items.map((item) => {
|
|
520
|
+
const isSelected = col.selectedId === item.id;
|
|
521
|
+
const hasChildren =
|
|
522
|
+
item.type === "folder" &&
|
|
523
|
+
item.children != null &&
|
|
524
|
+
item.children.length > 0;
|
|
525
|
+
return (
|
|
526
|
+
<ListItem
|
|
527
|
+
key={item.id}
|
|
528
|
+
label={
|
|
529
|
+
<Text type="body" maxLines={1}>
|
|
530
|
+
{item.name}
|
|
531
|
+
</Text>
|
|
532
|
+
}
|
|
533
|
+
startContent={
|
|
534
|
+
<Icon
|
|
535
|
+
icon={item.type === "folder" ? Folder : FileText}
|
|
536
|
+
color={item.type === "folder" ? "accent" : "secondary"}
|
|
537
|
+
size="sm"
|
|
538
|
+
/>
|
|
539
|
+
}
|
|
540
|
+
endContent={
|
|
541
|
+
hasChildren ? (
|
|
542
|
+
<Icon icon={ChevronRight} size="xsm" color="secondary" />
|
|
543
|
+
) : undefined
|
|
544
|
+
}
|
|
545
|
+
onClick={() => handleSelect(trueIndex, item.id)}
|
|
546
|
+
isSelected={isSelected}
|
|
547
|
+
/>
|
|
548
|
+
);
|
|
549
|
+
})}
|
|
550
|
+
</List>
|
|
551
|
+
)}
|
|
552
|
+
</Section>
|
|
553
|
+
);
|
|
554
|
+
})}
|
|
555
|
+
{selectedFile && (
|
|
556
|
+
<Section
|
|
557
|
+
width={isPreviewPane ? "100%" : 320}
|
|
558
|
+
// 16px, not 24. The sibling column at :529 is padding={2}
|
|
559
|
+
// (8px) because it holds a dense compact List, and these two
|
|
560
|
+
// sit in one HStack (:519) as columns of the same view --
|
|
561
|
+
// 24 beside 8 made the compact column look broken rather
|
|
562
|
+
// than compact. 16 is the outer-inset value this repo already
|
|
563
|
+
// uses for exactly this (scaffolds.md new-site recipe).
|
|
564
|
+
padding={4}
|
|
565
|
+
variant="transparent"
|
|
566
|
+
style={{ overflowY: "auto", flexGrow: 1, flexShrink: 0 }}
|
|
567
|
+
role="region"
|
|
568
|
+
aria-label={`Details for ${selectedFile.name}`}
|
|
569
|
+
tabIndex={0}
|
|
570
|
+
>
|
|
571
|
+
<VStack gap={4} hAlign="center">
|
|
572
|
+
<Avatar name={selectedFile.name} size={96} />
|
|
573
|
+
<VStack gap={1} hAlign="center">
|
|
574
|
+
<Text type="body" weight="semibold" maxLines={1}>
|
|
575
|
+
{selectedFile.name}
|
|
576
|
+
</Text>
|
|
577
|
+
<Text type="supporting" color="secondary">
|
|
578
|
+
{getFileExtension(selectedFile.name)} Document
|
|
579
|
+
</Text>
|
|
580
|
+
</VStack>
|
|
581
|
+
<MetadataList title="Information">
|
|
582
|
+
<MetadataListItem label="Created">
|
|
583
|
+
<Text type="body">March 28, 2026 at 2:15 PM</Text>
|
|
584
|
+
</MetadataListItem>
|
|
585
|
+
<MetadataListItem label="Modified">
|
|
586
|
+
<Text type="body">Yesterday, 10:27 PM</Text>
|
|
587
|
+
</MetadataListItem>
|
|
588
|
+
<MetadataListItem label="Kind">
|
|
589
|
+
<Text type="body">{getFileExtension(selectedFile.name)} Document</Text>
|
|
590
|
+
</MetadataListItem>
|
|
591
|
+
</MetadataList>
|
|
592
|
+
</VStack>
|
|
593
|
+
</Section>
|
|
594
|
+
)}
|
|
595
|
+
</HStack>
|
|
596
|
+
</LayoutContent>
|
|
597
|
+
}
|
|
598
|
+
/>
|
|
599
|
+
);
|
|
624
600
|
}
|