@sybilion/uilib 1.2.4 → 1.2.6
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/dist/esm/components/ui/AppHeader/AppHeader.styl.js +1 -1
- package/dist/esm/components/ui/AppHeader/appChromeAnchors.js +3 -1
- package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +1 -1
- package/dist/esm/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.js +62 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.styl.js +7 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/workspaceApp.types.js +4 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/workspaceAppIcons.js +16 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/workspaceAppPaths.js +29 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/workspaceAppsConstants.js +4 -0
- package/dist/esm/components/ui/WorkspaceAppSwitcher/workspaceAppsLocalStorage.js +84 -0
- package/dist/esm/components/widgets/SybilionAppHeader/SybilionAppHeader.js +18 -0
- package/dist/esm/components/widgets/SybilionAppHeader/SybilionAppHeader.styl.js +7 -0
- package/dist/esm/index.js +8 -1
- package/dist/esm/types/src/components/ui/AppHeader/appChromeAnchors.d.ts +2 -0
- package/dist/esm/types/src/components/ui/AppHeader/index.d.ts +1 -1
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.d.ts +12 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/index.d.ts +7 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/workspaceApp.types.d.ts +19 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/workspaceAppIcons.d.ts +9 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/workspaceAppPaths.d.ts +3 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/workspaceAppsConstants.d.ts +2 -0
- package/dist/esm/types/src/components/ui/WorkspaceAppSwitcher/workspaceAppsLocalStorage.d.ts +6 -0
- package/dist/esm/types/src/components/widgets/SybilionAppHeader/SybilionAppHeader.d.ts +14 -0
- package/dist/esm/types/src/components/widgets/SybilionAppHeader/index.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +2 -0
- package/docs/standalone-apps.md +195 -53
- package/package.json +1 -1
- package/src/components/ui/AppHeader/AppHeader.styl +5 -0
- package/src/components/ui/AppHeader/appChromeAnchors.ts +3 -0
- package/src/components/ui/AppHeader/index.ts +1 -1
- package/src/components/ui/Sidebar/Sidebar.styl +1 -1
- package/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.styl +91 -0
- package/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.styl.d.ts +15 -0
- package/src/components/ui/WorkspaceAppSwitcher/WorkspaceAppSwitcher.tsx +163 -0
- package/src/components/ui/WorkspaceAppSwitcher/index.ts +20 -0
- package/src/components/ui/WorkspaceAppSwitcher/workspaceApp.types.ts +21 -0
- package/src/components/ui/WorkspaceAppSwitcher/workspaceAppIcons.ts +27 -0
- package/src/components/ui/WorkspaceAppSwitcher/workspaceAppPaths.ts +34 -0
- package/src/components/ui/WorkspaceAppSwitcher/workspaceAppsConstants.ts +2 -0
- package/src/components/ui/WorkspaceAppSwitcher/workspaceAppsLocalStorage.ts +95 -0
- package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.styl +53 -0
- package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.styl.d.ts +10 -0
- package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.tsx +74 -0
- package/src/components/widgets/SybilionAppHeader/index.ts +4 -0
- package/src/docs/pages/{StandaloneAppLayoutPage.styl → StandaloneAppLayoutPage/StandaloneAppLayoutPage.styl} +11 -21
- package/src/docs/pages/{StandaloneAppLayoutPage.styl.d.ts → StandaloneAppLayoutPage/StandaloneAppLayoutPage.styl.d.ts} +1 -0
- package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +659 -0
- package/src/docs/registry.ts +2 -1
- package/src/index.ts +2 -0
- package/src/docs/pages/StandaloneAppLayoutPage.tsx +0 -242
- /package/dist/esm/types/src/docs/pages/{StandaloneAppLayoutPage.d.ts → StandaloneAppLayoutPage/StandaloneAppLayoutPage.d.ts} +0 -0
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { AppHeaderHost } from '#uilib/components/ui/AppHeader';
|
|
4
|
+
import { DropdownMenuItem } from '#uilib/components/ui/DropdownMenu';
|
|
5
|
+
import {
|
|
6
|
+
AppShell,
|
|
7
|
+
AppShellMainContent,
|
|
8
|
+
PageContent,
|
|
9
|
+
PageContentSection,
|
|
10
|
+
PageHeader,
|
|
11
|
+
} from '#uilib/components/ui/Page';
|
|
12
|
+
import { PageFooter } from '#uilib/components/ui/Page/PageFooter/PageFooter';
|
|
13
|
+
import { PageScroll } from '#uilib/components/ui/Page/PageScroll/PageScroll';
|
|
14
|
+
import {
|
|
15
|
+
Sidebar,
|
|
16
|
+
SidebarContent,
|
|
17
|
+
SidebarMenu,
|
|
18
|
+
SidebarMenuButton,
|
|
19
|
+
SidebarMenuItem,
|
|
20
|
+
SidebarProvider,
|
|
21
|
+
} from '#uilib/components/ui/Sidebar/Sidebar';
|
|
22
|
+
import type { WorkspaceAppEntry } from '#uilib/components/ui/WorkspaceAppSwitcher';
|
|
23
|
+
import {
|
|
24
|
+
SidebarDatasetsItemsGrouped,
|
|
25
|
+
type SidebarDatasetsItemsGroupedDataset,
|
|
26
|
+
} from '#uilib/components/widgets/SidebarDatasetsItemsGrouped';
|
|
27
|
+
import { SybilionAppHeader } from '#uilib/components/widgets/SybilionAppHeader';
|
|
28
|
+
import { GearSixIcon, UserCircleIcon } from '@phosphor-icons/react';
|
|
29
|
+
import { House } from 'lucide-react';
|
|
30
|
+
|
|
31
|
+
import { AppPageHeader } from '../../components/AppPageHeader/AppPageHeader';
|
|
32
|
+
import { DocsHeaderActions } from '../../docsHeaderActions';
|
|
33
|
+
import S from './StandaloneAppLayoutPage.styl';
|
|
34
|
+
|
|
35
|
+
const MOCK_DATASETS: SidebarDatasetsItemsGroupedDataset[] = [
|
|
36
|
+
{
|
|
37
|
+
id: 1,
|
|
38
|
+
name: 'Acetic Acid Price - China - Dollar/MT',
|
|
39
|
+
status: 'active',
|
|
40
|
+
created_at: '2024-01-01',
|
|
41
|
+
updated_at: '2024-01-02',
|
|
42
|
+
keywords: '',
|
|
43
|
+
category: { id: 10, name: 'Chemicals' },
|
|
44
|
+
target_type_id: 1,
|
|
45
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
46
|
+
trend: 0,
|
|
47
|
+
regular_price: '0',
|
|
48
|
+
sale_price: '0',
|
|
49
|
+
regions: [
|
|
50
|
+
{ id: 1, name: 'Asia' },
|
|
51
|
+
{ id: 2, name: 'China' },
|
|
52
|
+
],
|
|
53
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 2,
|
|
57
|
+
name: 'Freight index — spot volume (China)',
|
|
58
|
+
status: 'active',
|
|
59
|
+
created_at: '2024-01-01',
|
|
60
|
+
updated_at: '2024-01-02',
|
|
61
|
+
keywords: '',
|
|
62
|
+
category: { id: 10, name: 'Chemicals' },
|
|
63
|
+
target_type_id: 2,
|
|
64
|
+
target_type: { id: 2, name: 'Freight index' },
|
|
65
|
+
trend: 0,
|
|
66
|
+
regular_price: '0',
|
|
67
|
+
sale_price: '0',
|
|
68
|
+
regions: [
|
|
69
|
+
{ id: 1, name: 'Asia' },
|
|
70
|
+
{ id: 2, name: 'China' },
|
|
71
|
+
],
|
|
72
|
+
unit: { id: 1, name: 'Index' },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 3,
|
|
76
|
+
name: 'Ethanol Price Europe Per Kg In USD',
|
|
77
|
+
status: 'active',
|
|
78
|
+
created_at: '2024-01-01',
|
|
79
|
+
updated_at: '2024-01-02',
|
|
80
|
+
keywords: '',
|
|
81
|
+
category: { id: 11, name: 'Energy' },
|
|
82
|
+
target_type_id: 1,
|
|
83
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
84
|
+
trend: 0,
|
|
85
|
+
regular_price: '0',
|
|
86
|
+
sale_price: '0',
|
|
87
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
88
|
+
unit: { id: 1, name: 'USD/kg' },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 4,
|
|
92
|
+
name: 'Brent Crude Oil — Front Month (ICE)',
|
|
93
|
+
status: 'active',
|
|
94
|
+
created_at: '2024-01-03',
|
|
95
|
+
updated_at: '2024-01-04',
|
|
96
|
+
keywords: '',
|
|
97
|
+
category: { id: 11, name: 'Energy' },
|
|
98
|
+
target_type_id: 1,
|
|
99
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
100
|
+
trend: 0,
|
|
101
|
+
regular_price: '0',
|
|
102
|
+
sale_price: '0',
|
|
103
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
104
|
+
unit: { id: 2, name: 'USD/bbl' },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 5,
|
|
108
|
+
name: 'WTI Crude — Cushing Spot',
|
|
109
|
+
status: 'active',
|
|
110
|
+
created_at: '2024-01-05',
|
|
111
|
+
updated_at: '2024-01-06',
|
|
112
|
+
keywords: '',
|
|
113
|
+
category: { id: 11, name: 'Energy' },
|
|
114
|
+
target_type_id: 1,
|
|
115
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
116
|
+
trend: 0,
|
|
117
|
+
regular_price: '0',
|
|
118
|
+
sale_price: '0',
|
|
119
|
+
regions: [
|
|
120
|
+
{ id: 3, name: 'North America' },
|
|
121
|
+
{ id: 4, name: 'United States' },
|
|
122
|
+
],
|
|
123
|
+
unit: { id: 2, name: 'USD/bbl' },
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 6,
|
|
127
|
+
name: 'Natural Gas Henry Hub — USD/MMBtu',
|
|
128
|
+
status: 'active',
|
|
129
|
+
created_at: '2024-01-07',
|
|
130
|
+
updated_at: '2024-01-08',
|
|
131
|
+
keywords: '',
|
|
132
|
+
category: { id: 11, name: 'Energy' },
|
|
133
|
+
target_type_id: 1,
|
|
134
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
135
|
+
trend: 0,
|
|
136
|
+
regular_price: '0',
|
|
137
|
+
sale_price: '0',
|
|
138
|
+
regions: [
|
|
139
|
+
{ id: 3, name: 'North America' },
|
|
140
|
+
{ id: 4, name: 'United States' },
|
|
141
|
+
],
|
|
142
|
+
unit: { id: 3, name: 'USD/MMBtu' },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 7,
|
|
146
|
+
name: 'LNG JKM — Japan-Korea Marker',
|
|
147
|
+
status: 'active',
|
|
148
|
+
created_at: '2024-01-09',
|
|
149
|
+
updated_at: '2024-01-10',
|
|
150
|
+
keywords: '',
|
|
151
|
+
category: { id: 11, name: 'Energy' },
|
|
152
|
+
target_type_id: 1,
|
|
153
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
154
|
+
trend: 0,
|
|
155
|
+
regular_price: '0',
|
|
156
|
+
sale_price: '0',
|
|
157
|
+
regions: [
|
|
158
|
+
{ id: 1, name: 'Asia' },
|
|
159
|
+
{ id: 2, name: 'China' },
|
|
160
|
+
],
|
|
161
|
+
unit: { id: 4, name: 'USD/MMBtu' },
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 8,
|
|
165
|
+
name: 'Copper — LME Cash Official USD/MT',
|
|
166
|
+
status: 'active',
|
|
167
|
+
created_at: '2024-01-11',
|
|
168
|
+
updated_at: '2024-01-12',
|
|
169
|
+
keywords: '',
|
|
170
|
+
category: { id: 12, name: 'Metals' },
|
|
171
|
+
target_type_id: 1,
|
|
172
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
173
|
+
trend: 0,
|
|
174
|
+
regular_price: '0',
|
|
175
|
+
sale_price: '0',
|
|
176
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
177
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 9,
|
|
181
|
+
name: 'Aluminium — LME 3M USD/MT',
|
|
182
|
+
status: 'active',
|
|
183
|
+
created_at: '2024-01-13',
|
|
184
|
+
updated_at: '2024-01-14',
|
|
185
|
+
keywords: '',
|
|
186
|
+
category: { id: 12, name: 'Metals' },
|
|
187
|
+
target_type_id: 1,
|
|
188
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
189
|
+
trend: 0,
|
|
190
|
+
regular_price: '0',
|
|
191
|
+
sale_price: '0',
|
|
192
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
193
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: 10,
|
|
197
|
+
name: 'Steel HRC — US Midwest ($/st)',
|
|
198
|
+
status: 'active',
|
|
199
|
+
created_at: '2024-01-15',
|
|
200
|
+
updated_at: '2024-01-16',
|
|
201
|
+
keywords: '',
|
|
202
|
+
category: { id: 12, name: 'Metals' },
|
|
203
|
+
target_type_id: 1,
|
|
204
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
205
|
+
trend: 0,
|
|
206
|
+
regular_price: '0',
|
|
207
|
+
sale_price: '0',
|
|
208
|
+
regions: [
|
|
209
|
+
{ id: 3, name: 'North America' },
|
|
210
|
+
{ id: 4, name: 'United States' },
|
|
211
|
+
],
|
|
212
|
+
unit: { id: 5, name: 'USD/st' },
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: 11,
|
|
216
|
+
name: 'Urea FOB Middle East — Granular',
|
|
217
|
+
status: 'active',
|
|
218
|
+
created_at: '2024-01-17',
|
|
219
|
+
updated_at: '2024-01-18',
|
|
220
|
+
keywords: '',
|
|
221
|
+
category: { id: 13, name: 'Agriculture' },
|
|
222
|
+
target_type_id: 1,
|
|
223
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
224
|
+
trend: 0,
|
|
225
|
+
regular_price: '0',
|
|
226
|
+
sale_price: '0',
|
|
227
|
+
regions: [{ id: 6, name: 'Middle East' }],
|
|
228
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: 12,
|
|
232
|
+
name: 'Corn — CBOT Nearby (cents/bu)',
|
|
233
|
+
status: 'active',
|
|
234
|
+
created_at: '2024-01-19',
|
|
235
|
+
updated_at: '2024-01-20',
|
|
236
|
+
keywords: '',
|
|
237
|
+
category: { id: 13, name: 'Agriculture' },
|
|
238
|
+
target_type_id: 1,
|
|
239
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
240
|
+
trend: 0,
|
|
241
|
+
regular_price: '0',
|
|
242
|
+
sale_price: '0',
|
|
243
|
+
regions: [
|
|
244
|
+
{ id: 3, name: 'North America' },
|
|
245
|
+
{ id: 4, name: 'United States' },
|
|
246
|
+
],
|
|
247
|
+
unit: { id: 6, name: 'cents/bu' },
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: 13,
|
|
251
|
+
name: 'Soybeans — CBOT Nearby',
|
|
252
|
+
status: 'active',
|
|
253
|
+
created_at: '2024-01-21',
|
|
254
|
+
updated_at: '2024-01-22',
|
|
255
|
+
keywords: '',
|
|
256
|
+
category: { id: 13, name: 'Agriculture' },
|
|
257
|
+
target_type_id: 1,
|
|
258
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
259
|
+
trend: 0,
|
|
260
|
+
regular_price: '0',
|
|
261
|
+
sale_price: '0',
|
|
262
|
+
regions: [
|
|
263
|
+
{ id: 3, name: 'North America' },
|
|
264
|
+
{ id: 4, name: 'United States' },
|
|
265
|
+
],
|
|
266
|
+
unit: { id: 7, name: 'USD/bu' },
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: 14,
|
|
270
|
+
name: 'Coffee Arabica — ICE NY',
|
|
271
|
+
status: 'active',
|
|
272
|
+
created_at: '2024-01-23',
|
|
273
|
+
updated_at: '2024-01-24',
|
|
274
|
+
keywords: '',
|
|
275
|
+
category: { id: 13, name: 'Agriculture' },
|
|
276
|
+
target_type_id: 1,
|
|
277
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
278
|
+
trend: 0,
|
|
279
|
+
regular_price: '0',
|
|
280
|
+
sale_price: '0',
|
|
281
|
+
regions: [{ id: 8, name: 'Latin America' }],
|
|
282
|
+
unit: { id: 8, name: 'USD/lb' },
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: 15,
|
|
286
|
+
name: 'Sugar #11 — ICE NY',
|
|
287
|
+
status: 'active',
|
|
288
|
+
created_at: '2024-01-25',
|
|
289
|
+
updated_at: '2024-01-26',
|
|
290
|
+
keywords: '',
|
|
291
|
+
category: { id: 13, name: 'Agriculture' },
|
|
292
|
+
target_type_id: 1,
|
|
293
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
294
|
+
trend: 0,
|
|
295
|
+
regular_price: '0',
|
|
296
|
+
sale_price: '0',
|
|
297
|
+
regions: [{ id: 8, name: 'Latin America' }],
|
|
298
|
+
unit: { id: 8, name: 'USD/lb' },
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: 16,
|
|
302
|
+
name: 'Polyethylene HDPE — CFR China',
|
|
303
|
+
status: 'active',
|
|
304
|
+
created_at: '2024-01-27',
|
|
305
|
+
updated_at: '2024-01-28',
|
|
306
|
+
keywords: '',
|
|
307
|
+
category: { id: 10, name: 'Chemicals' },
|
|
308
|
+
target_type_id: 1,
|
|
309
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
310
|
+
trend: 0,
|
|
311
|
+
regular_price: '0',
|
|
312
|
+
sale_price: '0',
|
|
313
|
+
regions: [
|
|
314
|
+
{ id: 1, name: 'Asia' },
|
|
315
|
+
{ id: 2, name: 'China' },
|
|
316
|
+
],
|
|
317
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 17,
|
|
321
|
+
name: 'Methanol — CFR China',
|
|
322
|
+
status: 'active',
|
|
323
|
+
created_at: '2024-01-29',
|
|
324
|
+
updated_at: '2024-01-30',
|
|
325
|
+
keywords: '',
|
|
326
|
+
category: { id: 10, name: 'Chemicals' },
|
|
327
|
+
target_type_id: 1,
|
|
328
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
329
|
+
trend: 0,
|
|
330
|
+
regular_price: '0',
|
|
331
|
+
sale_price: '0',
|
|
332
|
+
regions: [
|
|
333
|
+
{ id: 1, name: 'Asia' },
|
|
334
|
+
{ id: 2, name: 'China' },
|
|
335
|
+
],
|
|
336
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: 18,
|
|
340
|
+
name: 'Charter rates — Panamax Atlantic',
|
|
341
|
+
status: 'active',
|
|
342
|
+
created_at: '2024-02-01',
|
|
343
|
+
updated_at: '2024-02-02',
|
|
344
|
+
keywords: '',
|
|
345
|
+
category: { id: 10, name: 'Chemicals' },
|
|
346
|
+
target_type_id: 2,
|
|
347
|
+
target_type: { id: 2, name: 'Freight index' },
|
|
348
|
+
trend: 0,
|
|
349
|
+
regular_price: '0',
|
|
350
|
+
sale_price: '0',
|
|
351
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
352
|
+
unit: { id: 1, name: 'Index' },
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
id: 19,
|
|
356
|
+
name: 'Container freight — Asia to US West Coast',
|
|
357
|
+
status: 'active',
|
|
358
|
+
created_at: '2024-02-03',
|
|
359
|
+
updated_at: '2024-02-04',
|
|
360
|
+
keywords: '',
|
|
361
|
+
category: { id: 10, name: 'Chemicals' },
|
|
362
|
+
target_type_id: 2,
|
|
363
|
+
target_type: { id: 2, name: 'Freight index' },
|
|
364
|
+
trend: 0,
|
|
365
|
+
regular_price: '0',
|
|
366
|
+
sale_price: '0',
|
|
367
|
+
regions: [
|
|
368
|
+
{ id: 1, name: 'Asia' },
|
|
369
|
+
{ id: 2, name: 'China' },
|
|
370
|
+
],
|
|
371
|
+
unit: { id: 1, name: 'Index' },
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: 20,
|
|
375
|
+
name: 'Thermal Coal — Newcastle 6,000 kcal',
|
|
376
|
+
status: 'active',
|
|
377
|
+
created_at: '2024-02-05',
|
|
378
|
+
updated_at: '2024-02-06',
|
|
379
|
+
keywords: '',
|
|
380
|
+
category: { id: 11, name: 'Energy' },
|
|
381
|
+
target_type_id: 1,
|
|
382
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
383
|
+
trend: 0,
|
|
384
|
+
regular_price: '0',
|
|
385
|
+
sale_price: '0',
|
|
386
|
+
regions: [{ id: 9, name: 'Oceania' }],
|
|
387
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
id: 21,
|
|
391
|
+
name: 'Diesel ARA — USD/MT',
|
|
392
|
+
status: 'active',
|
|
393
|
+
created_at: '2024-02-07',
|
|
394
|
+
updated_at: '2024-02-08',
|
|
395
|
+
keywords: '',
|
|
396
|
+
category: { id: 11, name: 'Energy' },
|
|
397
|
+
target_type_id: 1,
|
|
398
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
399
|
+
trend: 0,
|
|
400
|
+
regular_price: '0',
|
|
401
|
+
sale_price: '0',
|
|
402
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
403
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
id: 22,
|
|
407
|
+
name: 'Propylene — Contract FD NWE',
|
|
408
|
+
status: 'active',
|
|
409
|
+
created_at: '2024-02-09',
|
|
410
|
+
updated_at: '2024-02-10',
|
|
411
|
+
keywords: '',
|
|
412
|
+
category: { id: 10, name: 'Chemicals' },
|
|
413
|
+
target_type_id: 1,
|
|
414
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
415
|
+
trend: 0,
|
|
416
|
+
regular_price: '0',
|
|
417
|
+
sale_price: '0',
|
|
418
|
+
regions: [{ id: 5, name: 'Europe' }],
|
|
419
|
+
unit: { id: 1, name: 'EUR/MT' },
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
id: 23,
|
|
423
|
+
name: 'Ammonia — CFR India',
|
|
424
|
+
status: 'active',
|
|
425
|
+
created_at: '2024-02-11',
|
|
426
|
+
updated_at: '2024-02-12',
|
|
427
|
+
keywords: '',
|
|
428
|
+
category: { id: 10, name: 'Chemicals' },
|
|
429
|
+
target_type_id: 1,
|
|
430
|
+
target_type: { id: 1, name: 'Commodity price' },
|
|
431
|
+
trend: 0,
|
|
432
|
+
regular_price: '0',
|
|
433
|
+
sale_price: '0',
|
|
434
|
+
regions: [{ id: 1, name: 'Asia' }],
|
|
435
|
+
unit: { id: 1, name: 'USD/MT' },
|
|
436
|
+
},
|
|
437
|
+
];
|
|
438
|
+
|
|
439
|
+
type PreviewPanel = 'home' | 'datasets';
|
|
440
|
+
|
|
441
|
+
const TEST_HEADER_ID = 'test-header-id';
|
|
442
|
+
|
|
443
|
+
const DOCS_WORKSPACE_APPS_LS_KEY = 'uilib.docs.workspaceApps';
|
|
444
|
+
|
|
445
|
+
const DOCS_PREVIEW_APPS: WorkspaceAppEntry[] = [
|
|
446
|
+
{
|
|
447
|
+
id: 'docs-home',
|
|
448
|
+
displayName: 'Datasets Dashboard',
|
|
449
|
+
subtitle: 'Data analysis tools',
|
|
450
|
+
iconKey: 'grid-four',
|
|
451
|
+
accent: '#0d9488',
|
|
452
|
+
accentMuted: 'rgba(13, 148, 136, 0.12)',
|
|
453
|
+
href: '/docs-preview/home',
|
|
454
|
+
matchPathPrefixes: ['/docs-preview/home'],
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: 'docs-datasets',
|
|
458
|
+
displayName: 'Datasets',
|
|
459
|
+
subtitle: 'Dataset library',
|
|
460
|
+
iconKey: 'package',
|
|
461
|
+
accent: '#6366f1',
|
|
462
|
+
accentMuted: 'rgba(99, 102, 241, 0.12)',
|
|
463
|
+
href: '/docs-preview/datasets',
|
|
464
|
+
matchPathPrefixes: ['/docs-preview/datasets'],
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: 'my-custom-app',
|
|
468
|
+
displayName: 'Custom app',
|
|
469
|
+
subtitle: 'Slug-only app (sybilion.io/apps/…)',
|
|
470
|
+
iconKey: 'boat',
|
|
471
|
+
accent: '#0ea5e9',
|
|
472
|
+
accentMuted: 'rgba(14, 165, 233, 0.12)',
|
|
473
|
+
href: '/apps/my-custom-app',
|
|
474
|
+
},
|
|
475
|
+
];
|
|
476
|
+
|
|
477
|
+
function DemoAppSidebar({
|
|
478
|
+
panel,
|
|
479
|
+
onSelectPanel,
|
|
480
|
+
selectedDatasetId,
|
|
481
|
+
onSelectDatasetId,
|
|
482
|
+
}: {
|
|
483
|
+
panel: PreviewPanel;
|
|
484
|
+
onSelectPanel: (p: PreviewPanel) => void;
|
|
485
|
+
selectedDatasetId: number | undefined;
|
|
486
|
+
onSelectDatasetId: (id: number | undefined) => void;
|
|
487
|
+
}) {
|
|
488
|
+
return (
|
|
489
|
+
<Sidebar variant="inset" collapsible="offcanvas">
|
|
490
|
+
<SidebarContent>
|
|
491
|
+
<SidebarDatasetsItemsGrouped
|
|
492
|
+
preItems={
|
|
493
|
+
<SidebarMenuItem>
|
|
494
|
+
<SidebarMenuButton
|
|
495
|
+
type="button"
|
|
496
|
+
isActive={panel === 'home'}
|
|
497
|
+
onClick={() => onSelectPanel('home')}
|
|
498
|
+
>
|
|
499
|
+
<House size={16} strokeWidth={1.75} aria-hidden />
|
|
500
|
+
Home
|
|
501
|
+
</SidebarMenuButton>
|
|
502
|
+
</SidebarMenuItem>
|
|
503
|
+
}
|
|
504
|
+
groupBy="regions"
|
|
505
|
+
datasets={MOCK_DATASETS}
|
|
506
|
+
selectedDatasetId={selectedDatasetId}
|
|
507
|
+
onDatasetClick={id => {
|
|
508
|
+
onSelectDatasetId(id);
|
|
509
|
+
onSelectPanel('datasets');
|
|
510
|
+
}}
|
|
511
|
+
/>
|
|
512
|
+
</SidebarContent>
|
|
513
|
+
</Sidebar>
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function DemoMainBody({ panel }: { panel: PreviewPanel }) {
|
|
518
|
+
if (panel === 'home') {
|
|
519
|
+
return (
|
|
520
|
+
<>
|
|
521
|
+
<PageHeader
|
|
522
|
+
breadcrumbs={[{ label: 'Home' }]}
|
|
523
|
+
title="Home"
|
|
524
|
+
subheader="Greenfield shell preview (no SDK or auth in this embed)."
|
|
525
|
+
/>
|
|
526
|
+
<PageContent>
|
|
527
|
+
<PageContentSection>
|
|
528
|
+
<p style={{ margin: 0, color: 'var(--muted-foreground)' }}>
|
|
529
|
+
Preview: greenfield shell layout only (no SDK or auth). Real SPA
|
|
530
|
+
uses one top-level Router; this embed cannot nest MemoryRouter
|
|
531
|
+
under docs BrowserRouter — sidebar uses local state instead of{' '}
|
|
532
|
+
<code>NavLink</code> / <code>Routes</code>.
|
|
533
|
+
</p>
|
|
534
|
+
</PageContentSection>
|
|
535
|
+
</PageContent>
|
|
536
|
+
</>
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
return (
|
|
541
|
+
<>
|
|
542
|
+
<PageHeader
|
|
543
|
+
breadcrumbs={[{ label: 'Datasets' }]}
|
|
544
|
+
title="Datasets"
|
|
545
|
+
subheader="Sidebar + dataset list use local state (not Router)."
|
|
546
|
+
/>
|
|
547
|
+
<PageContent>
|
|
548
|
+
<PageContentSection>
|
|
549
|
+
<p style={{ margin: 0, color: 'var(--muted-foreground)' }}>
|
|
550
|
+
Use sidebar links and dataset rows; panel state stays inside this
|
|
551
|
+
box.
|
|
552
|
+
</p>
|
|
553
|
+
</PageContentSection>
|
|
554
|
+
<PageContentSection title="Scroll test">
|
|
555
|
+
<div className={S.scrollTestBlock}>
|
|
556
|
+
Placeholder region with <code>min-height: 100vh</code> — scroll the
|
|
557
|
+
main column to verify PageScroll / AppShell behavior.
|
|
558
|
+
</div>
|
|
559
|
+
</PageContentSection>
|
|
560
|
+
</PageContent>
|
|
561
|
+
</>
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
function StandaloneLayoutPreview() {
|
|
566
|
+
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
|
567
|
+
const [panel, setPanel] = useState<PreviewPanel>('home');
|
|
568
|
+
const [previewPath, setPreviewPath] = useState('/docs-preview/home');
|
|
569
|
+
const [selectedDatasetId, setSelectedDatasetId] = useState<
|
|
570
|
+
number | undefined
|
|
571
|
+
>();
|
|
572
|
+
|
|
573
|
+
const onThemeToggle = useCallback(() => {
|
|
574
|
+
setTheme(t => (t === 'dark' ? 'light' : 'dark'));
|
|
575
|
+
}, []);
|
|
576
|
+
|
|
577
|
+
return (
|
|
578
|
+
<div className={S.preview}>
|
|
579
|
+
<PageScroll rootClassName={S.previewScrollRoot}>
|
|
580
|
+
<AppShell>
|
|
581
|
+
<DemoAppSidebar
|
|
582
|
+
panel={panel}
|
|
583
|
+
onSelectPanel={setPanel}
|
|
584
|
+
selectedDatasetId={selectedDatasetId}
|
|
585
|
+
onSelectDatasetId={setSelectedDatasetId}
|
|
586
|
+
/>
|
|
587
|
+
|
|
588
|
+
<AppShellMainContent
|
|
589
|
+
header={<AppHeaderHost anchorId={TEST_HEADER_ID} />}
|
|
590
|
+
footer={
|
|
591
|
+
<PageFooter
|
|
592
|
+
versionLink="#standalone-layout-preview"
|
|
593
|
+
versionLabel="0.0.0-preview"
|
|
594
|
+
/>
|
|
595
|
+
}
|
|
596
|
+
>
|
|
597
|
+
<SybilionAppHeader
|
|
598
|
+
pageHeaderId={TEST_HEADER_ID}
|
|
599
|
+
pathname={previewPath}
|
|
600
|
+
onNavigate={setPreviewPath}
|
|
601
|
+
authenticated
|
|
602
|
+
appsStorageKey={DOCS_WORKSPACE_APPS_LS_KEY}
|
|
603
|
+
defaultApps={DOCS_PREVIEW_APPS}
|
|
604
|
+
user={{
|
|
605
|
+
name: 'Preview User',
|
|
606
|
+
email: 'preview@example.com',
|
|
607
|
+
avatar: '',
|
|
608
|
+
}}
|
|
609
|
+
theme={theme}
|
|
610
|
+
onThemeToggle={onThemeToggle}
|
|
611
|
+
onLogout={() => undefined}
|
|
612
|
+
menuItems={
|
|
613
|
+
<>
|
|
614
|
+
<DropdownMenuItem>
|
|
615
|
+
<UserCircleIcon />
|
|
616
|
+
Account (preview)
|
|
617
|
+
</DropdownMenuItem>
|
|
618
|
+
<DropdownMenuItem>
|
|
619
|
+
<GearSixIcon />
|
|
620
|
+
Settings (preview)
|
|
621
|
+
</DropdownMenuItem>
|
|
622
|
+
</>
|
|
623
|
+
}
|
|
624
|
+
/>
|
|
625
|
+
<DemoMainBody panel={panel} />
|
|
626
|
+
</AppShellMainContent>
|
|
627
|
+
</AppShell>
|
|
628
|
+
</PageScroll>
|
|
629
|
+
</div>
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export default function StandaloneAppLayoutPage() {
|
|
634
|
+
return (
|
|
635
|
+
<>
|
|
636
|
+
<AppPageHeader
|
|
637
|
+
breadcrumbs={[{ label: 'Standalone app layout' }]}
|
|
638
|
+
title="Standalone app layout"
|
|
639
|
+
subheader={
|
|
640
|
+
<>
|
|
641
|
+
Live preview of AppShell + Sidebar + main column from
|
|
642
|
+
docs/standalone-apps.md §4. <br />
|
|
643
|
+
Full greenfield setup (deps, global CSS, SybilionAuthProvider, SDK)
|
|
644
|
+
lives in that doc — this page is layout only.
|
|
645
|
+
</>
|
|
646
|
+
}
|
|
647
|
+
actions={<DocsHeaderActions />}
|
|
648
|
+
/>
|
|
649
|
+
<PageContentSection title="Embedded mini-app (layout preview)">
|
|
650
|
+
<SidebarProvider
|
|
651
|
+
sidebarWidthStorageKey="uilib.docs.standaloneLayout.sidebarWidthPx"
|
|
652
|
+
persistSidebarWidthWithoutConsent
|
|
653
|
+
>
|
|
654
|
+
<StandaloneLayoutPreview />
|
|
655
|
+
</SidebarProvider>
|
|
656
|
+
</PageContentSection>
|
|
657
|
+
</>
|
|
658
|
+
);
|
|
659
|
+
}
|
package/src/docs/registry.ts
CHANGED
|
@@ -220,7 +220,8 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
220
220
|
slug: 'standalone-app-layout',
|
|
221
221
|
title: 'Standalone app layout',
|
|
222
222
|
section: 'Layout',
|
|
223
|
-
load: () =>
|
|
223
|
+
load: () =>
|
|
224
|
+
import('./pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage'),
|
|
224
225
|
},
|
|
225
226
|
{
|
|
226
227
|
slug: 'progress',
|
package/src/index.ts
CHANGED
|
@@ -55,4 +55,6 @@ export * from './components/ui/Toggle';
|
|
|
55
55
|
export * from './components/ui/ToggleGroup';
|
|
56
56
|
export * from './components/ui/Tooltip';
|
|
57
57
|
export * from './components/ui/VimeoEmbed';
|
|
58
|
+
export * from './components/ui/WorkspaceAppSwitcher';
|
|
58
59
|
export * from './components/widgets/SidebarDatasetsItemsGrouped';
|
|
60
|
+
export * from './components/widgets/SybilionAppHeader';
|