@workbench-kit/react 0.0.1-prototype.0 → 0.0.2-prototype.0.1.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.
Files changed (155) hide show
  1. package/package.json +33 -9
  2. package/src/index.ts +545 -43
  3. package/src/jdw/JdwPreview.tsx +38 -0
  4. package/src/jdw/JsonCodeEditorPane.tsx +274 -0
  5. package/src/jdw/builtins/renderBuiltinWidgetLeaf.tsx +29 -0
  6. package/src/jdw/builtins/renderBuiltinWidgetNode.tsx +126 -0
  7. package/src/jdw/createBuiltinJdwRegistry.ts +111 -0
  8. package/src/jdw/cssRenderBackend.tsx +134 -0
  9. package/src/jdw/document.ts +38 -0
  10. package/src/jdw/fixtures/jdw-fixtures.ts +52 -0
  11. package/src/jdw/fixtures/jdw-sample-screens.ts +522 -0
  12. package/src/jdw/index.ts +45 -0
  13. package/src/jdw/parse.ts +1 -0
  14. package/src/jdw/renderJdw.tsx +32 -0
  15. package/src/json-config/JsonConfigWorkbench.tsx +316 -0
  16. package/src/json-config/index.ts +6 -0
  17. package/src/json-config/json-config-editor-state.ts +42 -0
  18. package/src/layout/Panel.tsx +146 -1
  19. package/src/layout/SideBarViewFrame.tsx +367 -328
  20. package/src/layout/WorkbenchCanvas.tsx +849 -0
  21. package/src/layout/WorkbenchFullscreen.tsx +368 -0
  22. package/src/layout/WorkbenchLayout.tsx +5 -0
  23. package/src/layout/WorkbenchLayoutBase.tsx +294 -0
  24. package/src/layout/WorkbenchPropertyPanel.tsx +497 -0
  25. package/src/layout/WorkbenchSidebarActions.tsx +274 -0
  26. package/src/layout/WorkbenchTree.tsx +351 -0
  27. package/src/layout/layoutHelpers.ts +25 -0
  28. package/src/modal/ConfirmDialog.tsx +61 -53
  29. package/src/modal/Modal.tsx +295 -35
  30. package/src/overlay/ContextMenu.tsx +146 -145
  31. package/src/primitives/AbsoluteBox.tsx +46 -0
  32. package/src/primitives/Badge.tsx +12 -12
  33. package/src/primitives/Button.tsx +44 -14
  34. package/src/primitives/Checkbox.tsx +11 -5
  35. package/src/primitives/EmptyState.tsx +27 -26
  36. package/src/primitives/Field.tsx +38 -38
  37. package/src/primitives/IconButton.tsx +5 -2
  38. package/src/primitives/List.tsx +111 -0
  39. package/src/primitives/NumberInput.tsx +38 -0
  40. package/src/primitives/ScrollArea.tsx +42 -0
  41. package/src/primitives/Select.tsx +1 -12
  42. package/src/primitives/StatusBar.tsx +46 -0
  43. package/src/primitives/TextArea.tsx +36 -0
  44. package/src/primitives/TextInput.tsx +11 -2
  45. package/src/primitives/WorkbenchChrome.tsx +424 -0
  46. package/src/primitives/WorkbenchEditor.tsx +394 -0
  47. package/src/primitives/index.ts +105 -0
  48. package/src/primitives/select/Select.tsx +266 -0
  49. package/src/primitives/select/index.ts +2 -0
  50. package/src/primitives/select/options.ts +38 -0
  51. package/src/primitives/select/overlay.ts +63 -0
  52. package/src/primitives/select/select.app.css +9 -0
  53. package/src/primitives/select/select.css +140 -0
  54. package/src/primitives/select/types.ts +18 -0
  55. package/src/primitives/styles.css +955 -0
  56. package/src/scrollbars.css +69 -0
  57. package/src/styles.css +7738 -1762
  58. package/src/utils/codicon.ts +17 -0
  59. package/src/widget-asset/WidgetAssetEditor.tsx +140 -0
  60. package/src/widget-asset/WidgetAssetMetadataForm.tsx +82 -0
  61. package/src/widget-asset/WidgetAssetModeControls.tsx +42 -0
  62. package/src/widget-asset/WidgetAssetSourceEditor.tsx +50 -0
  63. package/src/widget-asset/WidgetAssetWorkbench.tsx +112 -0
  64. package/src/widget-asset/index.ts +17 -0
  65. package/src/widget-asset/widget-asset-document.ts +37 -0
  66. package/src/widget-asset/widget-asset-mode.ts +3 -0
  67. package/src/widget-studio/builtin-widget-asset-catalog.ts +12 -0
  68. package/src/widget-studio/create-widget-studio-workspace-editor.tsx +79 -0
  69. package/src/widget-studio/index.ts +7 -0
  70. package/src/widget-studio/resolve-widget-studio-asset-catalog.ts +26 -0
  71. package/src/widget-tree/WidgetAssetPalette.tsx +77 -0
  72. package/src/widget-tree/WidgetInspectorPanel.tsx +266 -0
  73. package/src/widget-tree/WidgetSourceEditor.tsx +56 -0
  74. package/src/widget-tree/WidgetTreeLab.tsx +272 -0
  75. package/src/widget-tree/WidgetTreeModeControls.tsx +44 -0
  76. package/src/widget-tree/WidgetTreeSidePanel.tsx +49 -0
  77. package/src/widget-tree/WidgetTreeView.tsx +97 -0
  78. package/src/widget-tree/WidgetTreeWorkbench.tsx +111 -0
  79. package/src/widget-tree/WidgetTreeWorkspaceShell.tsx +154 -0
  80. package/src/widget-tree/demo-registry.ts +32 -0
  81. package/src/widget-tree/demo-widget-assets.ts +4 -0
  82. package/src/widget-tree/index.ts +27 -0
  83. package/src/widget-tree/widget-tree-document.ts +20 -0
  84. package/src/widget-tree/widget-tree-layout.ts +31 -0
  85. package/src/widget-tree/widget-tree-mode.ts +7 -0
  86. package/src/widget-tree/widget-tree-play-helpers.ts +74 -0
  87. package/src/workbench/ActivityBar.tsx +52 -52
  88. package/src/workbench/ArtifactShell.tsx +397 -0
  89. package/src/workbench/CommandPalette.tsx +819 -0
  90. package/src/workbench/ConfirmationFlow.tsx +245 -0
  91. package/src/workbench/MarkdownPreview.tsx +151 -0
  92. package/src/workbench/ShortcutCommandBridge.tsx +368 -0
  93. package/src/workbench/SplitView.tsx +136 -136
  94. package/src/workbench/StatusBar.tsx +178 -123
  95. package/src/workbench/StructuredArtifactEditor.tsx +205 -0
  96. package/src/workbench/Timeline.tsx +302 -0
  97. package/src/workbench/WorkbenchCanvasShell.tsx +941 -0
  98. package/src/workbench/WorkbenchShell.tsx +74 -70
  99. package/src/workbench/WorkbenchStandaloneShell.tsx +318 -291
  100. package/src/workbench/auth/WorkbenchAuthGate.tsx +61 -0
  101. package/src/workbench/auth/WorkbenchLoginView.tsx +635 -0
  102. package/src/workbench/auth/index.ts +19 -0
  103. package/src/workbench/chat/ChatComposer.tsx +165 -148
  104. package/src/workbench/chat/ChatMessageItem.tsx +10 -1
  105. package/src/workbench/chat/index.ts +9 -0
  106. package/src/workbench/chat/slashCommand.ts +28 -0
  107. package/src/workbench/chat/useChatRuntimeState.ts +76 -0
  108. package/src/workbench/chat/useSlashCommandSuggest.ts +101 -0
  109. package/src/workbench/commands.ts +520 -490
  110. package/src/workbench/index.ts +443 -98
  111. package/src/workbench/keyboard.ts +53 -0
  112. package/src/workbench/schema/index.ts +48 -0
  113. package/src/workbench/schema/workbenchDocument.ts +31 -0
  114. package/src/workbench/schema/workbenchDocumentActions.ts +6 -0
  115. package/src/workbench/schema/workbenchDocumentAdapter.ts +9 -0
  116. package/src/workbench/schema/workbenchDocumentPatch.ts +13 -0
  117. package/src/workbench/schema/workbenchDocumentRenderer.tsx +702 -0
  118. package/src/workbench/settings/NavigationPanel.tsx +47 -0
  119. package/src/workbench/settings/SchemaForm.tsx +420 -0
  120. package/src/workbench/settings/SectionedPanel.tsx +415 -0
  121. package/src/workbench/settings/StructuredDataForm.tsx +539 -0
  122. package/src/workbench/settings/StructuredDataSchemaPanel.tsx +559 -0
  123. package/src/workbench/settings/StructuredDataSchemaPanelEmbed.tsx +21 -0
  124. package/src/workbench/settings/StructuredDataSchemaPanelFrame.tsx +76 -0
  125. package/src/workbench/settings/StructuredDataTableView.tsx +127 -0
  126. package/src/workbench/settings/WorkbenchPanelRegion.tsx +46 -0
  127. package/src/workbench/settings/WorkbenchSettingsModal.tsx +21 -12
  128. package/src/workbench/settings/WorkbenchSettingsNav.tsx +38 -22
  129. package/src/workbench/settings/index.ts +135 -0
  130. package/src/workbench/settings/panel-region.css +21 -0
  131. package/src/workbench/settings/sectionedPanelScrollSpy.ts +143 -0
  132. package/src/workbench/settings/structured-data-schema-panel.css +330 -0
  133. package/src/workbench/settings/structured-data-table-view.css +85 -0
  134. package/src/workbench/settings/structuredDataSchema.ts +886 -0
  135. package/src/workbench/shell.ts +15 -0
  136. package/src/workbench/shellState.ts +203 -203
  137. package/src/workbench/standalone.ts +101 -94
  138. package/src/workbench/status.ts +129 -0
  139. package/src/workbench/theme.ts +44 -0
  140. package/src/workbench/workspace/MultiProviderExplorer.tsx +625 -0
  141. package/src/workbench/workspace/WorkspaceDraftsContext.tsx +111 -0
  142. package/src/workbench/workspace/WorkspaceEditor.tsx +47 -12
  143. package/src/workbench/workspace/WorkspaceEditorPanel.tsx +334 -353
  144. package/src/workbench/workspace/WorkspaceExplorer.tsx +532 -524
  145. package/src/workbench/workspace/WorkspaceFileIcon.tsx +32 -2
  146. package/src/workbench/workspace/WorkspaceSearchPanel.tsx +113 -113
  147. package/src/workbench/workspace/WorkspaceSearchResults.tsx +47 -47
  148. package/src/workbench/workspace/index.ts +156 -98
  149. package/src/workbench/workspace/mimeType.ts +45 -0
  150. package/src/workbench/workspace/path.ts +10 -10
  151. package/src/workbench/workspace/search.ts +6 -6
  152. package/src/workbench/workspace/tree.ts +1 -1
  153. package/src/workbench/workspace/types.ts +10 -10
  154. package/src/workbench/workspace/useVirtualWorkspace.ts +111 -98
  155. package/src/workbench/workspace/workspaceJsonDiagnostics.ts +83 -0
@@ -0,0 +1,368 @@
1
+ import { forwardRef } from 'react';
2
+ import type { ComponentPropsWithRef } from 'react';
3
+ import { cxCodicon } from '../utils/codicon';
4
+ import { cx } from '../utils/cx';
5
+
6
+ export type WorkbenchFullscreenLauncherRootProps = ComponentPropsWithRef<'div'>;
7
+
8
+ export const WorkbenchFullscreenLauncherRoot = forwardRef<
9
+ HTMLDivElement,
10
+ WorkbenchFullscreenLauncherRootProps
11
+ >(function WorkbenchFullscreenLauncherRoot({ className, ...props }, ref) {
12
+ return <div ref={ref} className={cx('ui-workbench-fullscreen-root', className)} {...props} />;
13
+ });
14
+
15
+ export type WorkbenchFullscreenBackdropProps = ComponentPropsWithRef<'div'>;
16
+
17
+ export function WorkbenchFullscreenBackdrop({
18
+ className,
19
+ ...props
20
+ }: WorkbenchFullscreenBackdropProps) {
21
+ return <div className={cx('ui-workbench-fullscreen-backdrop', className)} {...props} />;
22
+ }
23
+
24
+ export interface WorkbenchFullscreenBackdropImageProps extends ComponentPropsWithRef<'img'> {
25
+ src: string;
26
+ }
27
+
28
+ export function WorkbenchFullscreenBackdropImage({
29
+ alt = '',
30
+ className,
31
+ ...props
32
+ }: WorkbenchFullscreenBackdropImageProps) {
33
+ return (
34
+ <img
35
+ alt={alt}
36
+ className={cx('ui-workbench-fullscreen-backdrop__image', className)}
37
+ {...props}
38
+ />
39
+ );
40
+ }
41
+
42
+ export type WorkbenchFullscreenBackdropScrimProps = ComponentPropsWithRef<'div'>;
43
+
44
+ export function WorkbenchFullscreenBackdropScrim({
45
+ className,
46
+ ...props
47
+ }: WorkbenchFullscreenBackdropScrimProps) {
48
+ return (
49
+ <div
50
+ aria-hidden="true"
51
+ className={cx('ui-workbench-fullscreen-backdrop__scrim', className)}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ export type WorkbenchFullscreenContentProps = ComponentPropsWithRef<'div'>;
58
+
59
+ export function WorkbenchFullscreenContent({
60
+ className,
61
+ ...props
62
+ }: WorkbenchFullscreenContentProps) {
63
+ return <div className={cx('ui-workbench-fullscreen-content', className)} {...props} />;
64
+ }
65
+
66
+ export type WorkbenchFullscreenHeaderProps = ComponentPropsWithRef<'header'>;
67
+
68
+ export function WorkbenchFullscreenHeader({ className, ...props }: WorkbenchFullscreenHeaderProps) {
69
+ return <header className={cx('ui-workbench-fullscreen-header', className)} {...props} />;
70
+ }
71
+
72
+ export type WorkbenchFullscreenHeaderBrandProps = ComponentPropsWithRef<'div'>;
73
+
74
+ export function WorkbenchFullscreenHeaderBrand({
75
+ className,
76
+ ...props
77
+ }: WorkbenchFullscreenHeaderBrandProps) {
78
+ return <div className={cx('ui-workbench-fullscreen-header__brand', className)} {...props} />;
79
+ }
80
+
81
+ export type WorkbenchFullscreenHeaderTitleProps = ComponentPropsWithRef<'div'>;
82
+
83
+ export function WorkbenchFullscreenHeaderTitle({
84
+ className,
85
+ ...props
86
+ }: WorkbenchFullscreenHeaderTitleProps) {
87
+ return <div className={cx('ui-workbench-fullscreen-header__title', className)} {...props} />;
88
+ }
89
+
90
+ export type WorkbenchFullscreenHeaderSubtitleProps = ComponentPropsWithRef<'div'>;
91
+
92
+ export function WorkbenchFullscreenHeaderSubtitle({
93
+ className,
94
+ ...props
95
+ }: WorkbenchFullscreenHeaderSubtitleProps) {
96
+ return <div className={cx('ui-workbench-fullscreen-header__subtitle', className)} {...props} />;
97
+ }
98
+
99
+ export type WorkbenchFullscreenHeaderActionsProps = ComponentPropsWithRef<'div'>;
100
+
101
+ export function WorkbenchFullscreenHeaderActions({
102
+ className,
103
+ ...props
104
+ }: WorkbenchFullscreenHeaderActionsProps) {
105
+ return <div className={cx('ui-workbench-fullscreen-header__actions', className)} {...props} />;
106
+ }
107
+
108
+ export interface WorkbenchFullscreenButtonProps extends ComponentPropsWithRef<'button'> {
109
+ icon?: string | undefined;
110
+ prominent?: boolean | undefined;
111
+ }
112
+
113
+ export function WorkbenchFullscreenButton({
114
+ children,
115
+ className,
116
+ icon,
117
+ prominent = false,
118
+ type = 'button',
119
+ ...props
120
+ }: WorkbenchFullscreenButtonProps) {
121
+ const iconClassName = cxCodicon(icon);
122
+
123
+ return (
124
+ <button
125
+ className={cx('ui-workbench-fullscreen-button', className)}
126
+ data-prominent={prominent ? 'true' : 'false'}
127
+ type={type}
128
+ {...props}
129
+ >
130
+ {iconClassName ? <span className={iconClassName} aria-hidden /> : null}
131
+ <span>{children}</span>
132
+ </button>
133
+ );
134
+ }
135
+
136
+ export type WorkbenchFullscreenHeroProps = ComponentPropsWithRef<'section'>;
137
+
138
+ export function WorkbenchFullscreenHero({ className, ...props }: WorkbenchFullscreenHeroProps) {
139
+ return <section className={cx('ui-workbench-fullscreen-hero', className)} {...props} />;
140
+ }
141
+
142
+ export type WorkbenchFullscreenHeroMetaProps = ComponentPropsWithRef<'div'>;
143
+
144
+ export function WorkbenchFullscreenHeroMeta({
145
+ className,
146
+ ...props
147
+ }: WorkbenchFullscreenHeroMetaProps) {
148
+ return <div className={cx('ui-workbench-fullscreen-hero__meta', className)} {...props} />;
149
+ }
150
+
151
+ export type WorkbenchFullscreenHeroTitleProps = ComponentPropsWithRef<'h1'>;
152
+
153
+ export function WorkbenchFullscreenHeroTitle({
154
+ className,
155
+ ...props
156
+ }: WorkbenchFullscreenHeroTitleProps) {
157
+ return <h1 className={cx('ui-workbench-fullscreen-hero__title', className)} {...props} />;
158
+ }
159
+
160
+ export type WorkbenchFullscreenPillRowProps = ComponentPropsWithRef<'div'>;
161
+
162
+ export function WorkbenchFullscreenPillRow({
163
+ className,
164
+ ...props
165
+ }: WorkbenchFullscreenPillRowProps) {
166
+ return <div className={cx('ui-workbench-fullscreen-pill-row', className)} {...props} />;
167
+ }
168
+
169
+ export type WorkbenchFullscreenPillProps = ComponentPropsWithRef<'span'>;
170
+
171
+ export function WorkbenchFullscreenPill({ className, ...props }: WorkbenchFullscreenPillProps) {
172
+ return <span className={cx('ui-workbench-fullscreen-pill', className)} {...props} />;
173
+ }
174
+
175
+ export type WorkbenchFullscreenHeroActionRowProps = ComponentPropsWithRef<'div'>;
176
+
177
+ export function WorkbenchFullscreenHeroActionRow({
178
+ className,
179
+ ...props
180
+ }: WorkbenchFullscreenHeroActionRowProps) {
181
+ return <div className={cx('ui-workbench-fullscreen-hero__action-row', className)} {...props} />;
182
+ }
183
+
184
+ export type WorkbenchFullscreenHeroStatusProps = ComponentPropsWithRef<'div'>;
185
+
186
+ export function WorkbenchFullscreenHeroStatus({
187
+ className,
188
+ ...props
189
+ }: WorkbenchFullscreenHeroStatusProps) {
190
+ return <div className={cx('ui-workbench-fullscreen-hero__status', className)} {...props} />;
191
+ }
192
+
193
+ export type WorkbenchFullscreenEmptyProps = ComponentPropsWithRef<'div'>;
194
+
195
+ export function WorkbenchFullscreenEmpty({ className, ...props }: WorkbenchFullscreenEmptyProps) {
196
+ return <div className={cx('ui-workbench-fullscreen-empty', className)} {...props} />;
197
+ }
198
+
199
+ export type WorkbenchFullscreenEmptyTitleProps = ComponentPropsWithRef<'h1'>;
200
+
201
+ export function WorkbenchFullscreenEmptyTitle({
202
+ className,
203
+ ...props
204
+ }: WorkbenchFullscreenEmptyTitleProps) {
205
+ return <h1 className={cx('ui-workbench-fullscreen-empty__title', className)} {...props} />;
206
+ }
207
+
208
+ export type WorkbenchFullscreenEmptyTextProps = ComponentPropsWithRef<'p'>;
209
+
210
+ export function WorkbenchFullscreenEmptyText({
211
+ className,
212
+ ...props
213
+ }: WorkbenchFullscreenEmptyTextProps) {
214
+ return <p className={cx('ui-workbench-fullscreen-empty__text', className)} {...props} />;
215
+ }
216
+
217
+ export type WorkbenchFullscreenCarouselProps = ComponentPropsWithRef<'section'>;
218
+
219
+ export function WorkbenchFullscreenCarousel({
220
+ className,
221
+ ...props
222
+ }: WorkbenchFullscreenCarouselProps) {
223
+ return <section className={cx('ui-workbench-fullscreen-carousel', className)} {...props} />;
224
+ }
225
+
226
+ export type WorkbenchFullscreenCarouselViewportProps = ComponentPropsWithRef<'div'>;
227
+
228
+ export function WorkbenchFullscreenCarouselViewport({
229
+ className,
230
+ ...props
231
+ }: WorkbenchFullscreenCarouselViewportProps) {
232
+ return (
233
+ <div
234
+ className={cx(
235
+ 'ui-workbench-fullscreen-carousel__viewport',
236
+ 'ui-workbench-scrollbar',
237
+ className,
238
+ )}
239
+ {...props}
240
+ />
241
+ );
242
+ }
243
+
244
+ export interface WorkbenchFullscreenNavButtonProps extends Omit<
245
+ ComponentPropsWithRef<'button'>,
246
+ 'children'
247
+ > {
248
+ icon: string;
249
+ label: string;
250
+ }
251
+
252
+ export function WorkbenchFullscreenNavButton({
253
+ className,
254
+ icon,
255
+ label,
256
+ type = 'button',
257
+ ...props
258
+ }: WorkbenchFullscreenNavButtonProps) {
259
+ return (
260
+ <button
261
+ aria-label={label}
262
+ className={cx('ui-workbench-fullscreen-nav-button', className)}
263
+ title={label}
264
+ type={type}
265
+ {...props}
266
+ >
267
+ <span className={cxCodicon(icon)} aria-hidden />
268
+ </button>
269
+ );
270
+ }
271
+
272
+ export interface WorkbenchFullscreenOptionProps extends ComponentPropsWithRef<'div'> {
273
+ selected?: boolean | undefined;
274
+ }
275
+
276
+ export function WorkbenchFullscreenOption({
277
+ className,
278
+ selected = false,
279
+ ...props
280
+ }: WorkbenchFullscreenOptionProps) {
281
+ return (
282
+ <div
283
+ aria-selected={selected}
284
+ className={cx('ui-workbench-fullscreen-option', className)}
285
+ data-selected={selected ? 'true' : 'false'}
286
+ role="option"
287
+ tabIndex={0}
288
+ {...props}
289
+ />
290
+ );
291
+ }
292
+
293
+ export type WorkbenchFullscreenArtworkTone = 'accent' | 'success';
294
+
295
+ export interface WorkbenchFullscreenOptionArtworkProps extends ComponentPropsWithRef<'div'> {
296
+ tone?: WorkbenchFullscreenArtworkTone | undefined;
297
+ }
298
+
299
+ export function WorkbenchFullscreenOptionArtwork({
300
+ className,
301
+ tone = 'success',
302
+ ...props
303
+ }: WorkbenchFullscreenOptionArtworkProps) {
304
+ return (
305
+ <div
306
+ className={cx('ui-workbench-fullscreen-option__artwork', className)}
307
+ data-tone={tone}
308
+ {...props}
309
+ />
310
+ );
311
+ }
312
+
313
+ export type WorkbenchFullscreenOptionImageProps = ComponentPropsWithRef<'img'>;
314
+
315
+ export function WorkbenchFullscreenOptionImage({
316
+ alt = '',
317
+ className,
318
+ ...props
319
+ }: WorkbenchFullscreenOptionImageProps) {
320
+ return (
321
+ <img alt={alt} className={cx('ui-workbench-fullscreen-option__image', className)} {...props} />
322
+ );
323
+ }
324
+
325
+ export interface WorkbenchFullscreenOptionPlaceholderProps extends ComponentPropsWithRef<'span'> {
326
+ icon?: string | undefined;
327
+ }
328
+
329
+ export function WorkbenchFullscreenOptionPlaceholder({
330
+ className,
331
+ icon = 'device-desktop',
332
+ ...props
333
+ }: WorkbenchFullscreenOptionPlaceholderProps) {
334
+ return (
335
+ <span
336
+ aria-hidden="true"
337
+ className={cxCodicon(icon, 'ui-workbench-fullscreen-option__placeholder', className)}
338
+ {...props}
339
+ />
340
+ );
341
+ }
342
+
343
+ export type WorkbenchFullscreenOptionBodyProps = ComponentPropsWithRef<'div'>;
344
+
345
+ export function WorkbenchFullscreenOptionBody({
346
+ className,
347
+ ...props
348
+ }: WorkbenchFullscreenOptionBodyProps) {
349
+ return <div className={cx('ui-workbench-fullscreen-option__body', className)} {...props} />;
350
+ }
351
+
352
+ export type WorkbenchFullscreenOptionTitleProps = ComponentPropsWithRef<'div'>;
353
+
354
+ export function WorkbenchFullscreenOptionTitle({
355
+ className,
356
+ ...props
357
+ }: WorkbenchFullscreenOptionTitleProps) {
358
+ return <div className={cx('ui-workbench-fullscreen-option__title', className)} {...props} />;
359
+ }
360
+
361
+ export type WorkbenchFullscreenOptionMetaProps = ComponentPropsWithRef<'div'>;
362
+
363
+ export function WorkbenchFullscreenOptionMeta({
364
+ className,
365
+ ...props
366
+ }: WorkbenchFullscreenOptionMetaProps) {
367
+ return <div className={cx('ui-workbench-fullscreen-option__meta', className)} {...props} />;
368
+ }
@@ -0,0 +1,5 @@
1
+ export * from './WorkbenchLayoutBase';
2
+ export * from './WorkbenchCanvas';
3
+ export * from './WorkbenchFullscreen';
4
+ export * from './WorkbenchTree';
5
+ export * from './WorkbenchPropertyPanel';
@@ -0,0 +1,294 @@
1
+ import type { ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
2
+ import { ScrollArea } from '../primitives/ScrollArea';
3
+ import { cxCodicon } from '../utils/codicon';
4
+ import { cx } from '../utils/cx';
5
+ import { toLengthValue } from './layoutHelpers';
6
+
7
+ export type WorkbenchRootProps = ComponentPropsWithRef<'div'>;
8
+
9
+ export function WorkbenchRoot({ className, ...props }: WorkbenchRootProps) {
10
+ return <div className={cx('ui-workbench-root', className)} {...props} />;
11
+ }
12
+
13
+ export type WorkbenchFillProps = ComponentPropsWithRef<'div'>;
14
+
15
+ export function WorkbenchFill({ className, ...props }: WorkbenchFillProps) {
16
+ return <div className={cx('ui-workbench-fill', className)} {...props} />;
17
+ }
18
+
19
+ export type WorkbenchCenterProps = ComponentPropsWithRef<'main'>;
20
+
21
+ export function WorkbenchCenter({ className, ...props }: WorkbenchCenterProps) {
22
+ return <main className={cx('ui-workbench-center', className)} {...props} />;
23
+ }
24
+
25
+ export type WorkbenchPaneProps = ComponentPropsWithRef<'div'>;
26
+
27
+ export function WorkbenchPane({ className, ...props }: WorkbenchPaneProps) {
28
+ return <div className={cx('ui-workbench-pane', className)} {...props} />;
29
+ }
30
+
31
+ export type WorkbenchColumnProps = ComponentPropsWithRef<'div'>;
32
+
33
+ export function WorkbenchColumn({ className, ...props }: WorkbenchColumnProps) {
34
+ return <div className={cx('ui-workbench-column', className)} {...props} />;
35
+ }
36
+
37
+ export interface WorkbenchPanelSurfaceProps extends ComponentPropsWithRef<'div'> {
38
+ border?: 'left' | 'right' | false;
39
+ }
40
+
41
+ export function WorkbenchPanelSurface({
42
+ border = false,
43
+ className,
44
+ ...props
45
+ }: WorkbenchPanelSurfaceProps) {
46
+ return (
47
+ <ScrollArea
48
+ className={cx(
49
+ 'ui-workbench-panel-surface',
50
+ border === 'left' && 'ui-workbench-panel-surface--border-left',
51
+ border === 'right' && 'ui-workbench-panel-surface--border-right',
52
+ className,
53
+ )}
54
+ gutter="auto"
55
+ orientation="vertical"
56
+ {...props}
57
+ />
58
+ );
59
+ }
60
+
61
+ export type WorkbenchPanelScrollProps = ComponentPropsWithRef<'div'>;
62
+
63
+ export function WorkbenchPanelScroll({ className, ...props }: WorkbenchPanelScrollProps) {
64
+ return (
65
+ <ScrollArea
66
+ className={cx('ui-workbench-panel-scroll', className)}
67
+ gutter="auto"
68
+ orientation="vertical"
69
+ {...props}
70
+ />
71
+ );
72
+ }
73
+
74
+ export interface WorkbenchBannerProps extends ComponentPropsWithRef<'div'> {
75
+ tone?: 'default' | 'warning';
76
+ }
77
+
78
+ export function WorkbenchBanner({ className, tone = 'default', ...props }: WorkbenchBannerProps) {
79
+ return (
80
+ <div
81
+ className={cx(
82
+ 'ui-workbench-banner',
83
+ tone === 'warning' && 'ui-workbench-banner--warning',
84
+ className,
85
+ )}
86
+ {...props}
87
+ />
88
+ );
89
+ }
90
+
91
+ export interface WorkbenchBannerIconProps extends ComponentPropsWithRef<'span'> {
92
+ icon: string;
93
+ }
94
+
95
+ export function WorkbenchBannerIcon({ className, icon, ...props }: WorkbenchBannerIconProps) {
96
+ return (
97
+ <span
98
+ className={cxCodicon(icon, 'ui-workbench-banner__icon', className)}
99
+ aria-hidden
100
+ {...props}
101
+ />
102
+ );
103
+ }
104
+
105
+ export type WorkbenchBannerMessageProps = ComponentPropsWithRef<'span'>;
106
+
107
+ export function WorkbenchBannerMessage({ className, ...props }: WorkbenchBannerMessageProps) {
108
+ return <span className={cx('ui-workbench-banner__message', className)} {...props} />;
109
+ }
110
+
111
+ export type WorkbenchEditorFrameProps = ComponentPropsWithRef<'div'>;
112
+
113
+ export function WorkbenchEditorFrame({ className, ...props }: WorkbenchEditorFrameProps) {
114
+ return <div className={cx('ui-workbench-editor-frame', className)} {...props} />;
115
+ }
116
+
117
+ export type WorkbenchEditorBodyProps = ComponentPropsWithRef<'div'>;
118
+
119
+ export function WorkbenchEditorBody({ className, ...props }: WorkbenchEditorBodyProps) {
120
+ return <div className={cx('ui-workbench-editor-body', className)} {...props} />;
121
+ }
122
+
123
+ export type WorkbenchEditorViewportProps = ComponentPropsWithRef<'div'>;
124
+
125
+ export function WorkbenchEditorViewport({ className, ...props }: WorkbenchEditorViewportProps) {
126
+ return <div className={cx('ui-workbench-editor-viewport', className)} {...props} />;
127
+ }
128
+
129
+ export interface WorkbenchEditorBottomPanelProps extends ComponentPropsWithRef<'section'> {
130
+ height?: number | string;
131
+ }
132
+
133
+ export function WorkbenchEditorBottomPanel({
134
+ className,
135
+ height = 120,
136
+ style,
137
+ ...props
138
+ }: WorkbenchEditorBottomPanelProps) {
139
+ const panelStyle = {
140
+ '--ui-workbench-editor-bottom-panel-height': toLengthValue(height),
141
+ ...style,
142
+ } as CSSProperties;
143
+
144
+ return (
145
+ <section
146
+ className={cx('ui-workbench-editor-bottom-panel', className)}
147
+ style={panelStyle}
148
+ {...props}
149
+ />
150
+ );
151
+ }
152
+
153
+ export type WorkbenchEditorBottomPanelHeaderProps = ComponentPropsWithRef<'div'>;
154
+
155
+ export function WorkbenchEditorBottomPanelHeader({
156
+ className,
157
+ ...props
158
+ }: WorkbenchEditorBottomPanelHeaderProps) {
159
+ return <div className={cx('ui-workbench-editor-bottom-panel__header', className)} {...props} />;
160
+ }
161
+
162
+ export type WorkbenchEditorBottomPanelTitleProps = ComponentPropsWithRef<'span'>;
163
+
164
+ export function WorkbenchEditorBottomPanelTitle({
165
+ className,
166
+ ...props
167
+ }: WorkbenchEditorBottomPanelTitleProps) {
168
+ return <span className={cx('ui-workbench-editor-bottom-panel__title', className)} {...props} />;
169
+ }
170
+
171
+ export type WorkbenchEditorBottomPanelBodyProps = ComponentPropsWithRef<'div'>;
172
+
173
+ export function WorkbenchEditorBottomPanelBody({
174
+ className,
175
+ ...props
176
+ }: WorkbenchEditorBottomPanelBodyProps) {
177
+ return <div className={cx('ui-workbench-editor-bottom-panel__body', className)} {...props} />;
178
+ }
179
+
180
+ export type WorkbenchProblemSeverity = 'error' | 'info' | 'warning';
181
+
182
+ export type WorkbenchProblemListProps = ComponentPropsWithRef<'div'>;
183
+
184
+ export function WorkbenchProblemList({ className, ...props }: WorkbenchProblemListProps) {
185
+ return <div className={cx('ui-workbench-problem-list', className)} {...props} />;
186
+ }
187
+
188
+ export interface WorkbenchProblemItemProps extends Omit<
189
+ ComponentPropsWithRef<'button'>,
190
+ 'children'
191
+ > {
192
+ location?: ReactNode;
193
+ message: ReactNode;
194
+ severity?: WorkbenchProblemSeverity;
195
+ }
196
+
197
+ export function WorkbenchProblemItem({
198
+ className,
199
+ location,
200
+ message,
201
+ severity = 'error',
202
+ type = 'button',
203
+ ...props
204
+ }: WorkbenchProblemItemProps) {
205
+ return (
206
+ <button
207
+ className={cx('ui-workbench-problem-item', className)}
208
+ data-severity={severity}
209
+ type={type}
210
+ {...props}
211
+ >
212
+ {location ? <span className="ui-workbench-problem-item__location">{location}</span> : null}
213
+ <span className="ui-workbench-problem-item__message">{message}</span>
214
+ </button>
215
+ );
216
+ }
217
+
218
+ export type WorkbenchFloatingMenuAlign = 'end' | 'start';
219
+ export type WorkbenchFloatingMenuPlacement = 'bottom' | 'top';
220
+
221
+ export interface WorkbenchFloatingMenuProps extends ComponentPropsWithRef<'div'> {
222
+ align?: WorkbenchFloatingMenuAlign;
223
+ inset?: number | string;
224
+ offset?: number | string;
225
+ placement?: WorkbenchFloatingMenuPlacement;
226
+ width?: number | string;
227
+ }
228
+
229
+ export function WorkbenchFloatingMenu({
230
+ align = 'end',
231
+ className,
232
+ inset = 8,
233
+ offset = 28,
234
+ placement = 'top',
235
+ role = 'menu',
236
+ style,
237
+ width = 180,
238
+ ...props
239
+ }: WorkbenchFloatingMenuProps) {
240
+ const menuStyle = {
241
+ '--ui-workbench-floating-menu-inset': toLengthValue(inset),
242
+ '--ui-workbench-floating-menu-offset': toLengthValue(offset),
243
+ '--ui-workbench-floating-menu-width': toLengthValue(width),
244
+ ...style,
245
+ } as CSSProperties;
246
+
247
+ return (
248
+ <div
249
+ className={cx('ui-workbench-floating-menu', className)}
250
+ data-align={align}
251
+ data-placement={placement}
252
+ role={role}
253
+ style={menuStyle}
254
+ {...props}
255
+ />
256
+ );
257
+ }
258
+
259
+ export interface WorkbenchFloatingMenuItemProps extends Omit<
260
+ ComponentPropsWithRef<'button'>,
261
+ 'children'
262
+ > {
263
+ icon?: ReactNode | string;
264
+ label: ReactNode;
265
+ meta?: ReactNode;
266
+ selected?: boolean;
267
+ }
268
+
269
+ export function WorkbenchFloatingMenuItem({
270
+ className,
271
+ icon,
272
+ label,
273
+ meta,
274
+ role = 'menuitem',
275
+ selected = false,
276
+ type = 'button',
277
+ ...props
278
+ }: WorkbenchFloatingMenuItemProps) {
279
+ const resolvedIcon = typeof icon === 'string' ? <i className={cxCodicon(icon)} /> : icon;
280
+
281
+ return (
282
+ <button
283
+ className={cx('ui-workbench-floating-menu__item', className)}
284
+ data-selected={selected ? 'true' : 'false'}
285
+ role={role}
286
+ type={type}
287
+ {...props}
288
+ >
289
+ <span className="ui-workbench-floating-menu__icon">{resolvedIcon}</span>
290
+ <span className="ui-workbench-floating-menu__label">{label}</span>
291
+ {meta ? <span className="ui-workbench-floating-menu__meta">{meta}</span> : null}
292
+ </button>
293
+ );
294
+ }