@sybilion/uilib 1.2.6 → 1.2.9

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 (54) hide show
  1. package/assets/standalone-global.css +12 -11
  2. package/dist/esm/components/ui/Logo/Logo.js +7 -2
  3. package/dist/esm/components/ui/Logo/Logo.styl.js +1 -1
  4. package/dist/esm/components/ui/NavUserHeader/NavUserHeader.js +4 -2
  5. package/dist/esm/components/widgets/SignInPage/SignInPage.js +25 -0
  6. package/dist/esm/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.js +8 -0
  7. package/dist/esm/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.styl.js +7 -0
  8. package/dist/esm/components/widgets/SybilionAuthLayout/SybilionAuthLayout.js +16 -0
  9. package/dist/esm/components/widgets/SybilionAuthLayout/SybilionAuthLayout.styl.js +7 -0
  10. package/dist/esm/components/widgets/SybilionSignInPanel/SybilionSignInPanel.js +11 -0
  11. package/dist/esm/components/widgets/SybilionSignInPanel/SybilionSignInPanel.styl.js +7 -0
  12. package/dist/esm/docs/contexts/theme-context.js +14 -0
  13. package/dist/esm/docs/lib/theme.js +23 -0
  14. package/dist/esm/index.js +4 -0
  15. package/dist/esm/types/src/components/ui/Logo/Logo.d.ts +5 -0
  16. package/dist/esm/types/src/components/ui/NavUserHeader/NavUserHeader.d.ts +1 -1
  17. package/dist/esm/types/src/components/ui/NavUserHeader/NavUserHeader.types.d.ts +0 -4
  18. package/dist/esm/types/src/components/widgets/SignInPage/SignInPage.d.ts +10 -0
  19. package/dist/esm/types/src/components/widgets/SignInPage/index.d.ts +1 -0
  20. package/dist/esm/types/src/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.d.ts +1 -0
  21. package/dist/esm/types/src/components/widgets/SybilionAuthLayout/SybilionAuthLayout.d.ts +14 -0
  22. package/dist/esm/types/src/components/widgets/SybilionAuthLayout/index.d.ts +2 -0
  23. package/dist/esm/types/src/components/widgets/SybilionSignInPanel/SybilionSignInPanel.d.ts +11 -0
  24. package/dist/esm/types/src/components/widgets/SybilionSignInPanel/index.d.ts +1 -0
  25. package/dist/esm/types/src/docs/contexts/theme-context.d.ts +1 -0
  26. package/dist/esm/types/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.constants.d.ts +7 -0
  27. package/dist/esm/types/src/index.d.ts +3 -0
  28. package/docs/standalone-apps.md +38 -0
  29. package/package.json +4 -2
  30. package/src/assets/logo.svg +3 -0
  31. package/src/assets/sybilion_bg.svg +8 -0
  32. package/src/components/ui/Logo/Logo.styl +2 -0
  33. package/src/components/ui/Logo/Logo.tsx +12 -1
  34. package/src/components/ui/NavUserHeader/NavUserHeader.tsx +15 -17
  35. package/src/components/ui/NavUserHeader/NavUserHeader.types.ts +0 -4
  36. package/src/components/widgets/SignInPage/SignInPage.tsx +84 -0
  37. package/src/components/widgets/SignInPage/index.ts +1 -0
  38. package/src/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.styl +26 -0
  39. package/src/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.styl.d.ts +2 -0
  40. package/src/components/widgets/SybilionAuthLayout/SybilionAuthHeadline.tsx +18 -0
  41. package/src/components/widgets/SybilionAuthLayout/SybilionAuthLayout.styl +79 -0
  42. package/src/components/widgets/SybilionAuthLayout/SybilionAuthLayout.styl.d.ts +2 -0
  43. package/src/components/widgets/SybilionAuthLayout/SybilionAuthLayout.tsx +64 -0
  44. package/src/components/widgets/SybilionAuthLayout/index.ts +6 -0
  45. package/src/components/widgets/SybilionSignInPanel/SybilionSignInPanel.styl +48 -0
  46. package/src/components/widgets/SybilionSignInPanel/SybilionSignInPanel.styl.d.ts +2 -0
  47. package/src/components/widgets/SybilionSignInPanel/SybilionSignInPanel.tsx +59 -0
  48. package/src/components/widgets/SybilionSignInPanel/index.ts +4 -0
  49. package/src/docs/config/webpack.config.js +4 -3
  50. package/src/docs/contexts/theme-context.tsx +14 -1
  51. package/src/docs/pages/NavUserHeaderPage.tsx +1 -20
  52. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.constants.ts +444 -0
  53. package/src/docs/pages/StandaloneAppLayoutPage/StandaloneAppLayoutPage.tsx +9 -456
  54. package/src/index.ts +3 -0
@@ -1,4 +1,4 @@
1
- import { useCallback, useState } from 'react';
1
+ import { useState } from 'react';
2
2
 
3
3
  import { AppHeaderHost } from '#uilib/components/ui/AppHeader';
4
4
  import { DropdownMenuItem } from '#uilib/components/ui/DropdownMenu';
@@ -14,466 +14,26 @@ import { PageScroll } from '#uilib/components/ui/Page/PageScroll/PageScroll';
14
14
  import {
15
15
  Sidebar,
16
16
  SidebarContent,
17
- SidebarMenu,
18
17
  SidebarMenuButton,
19
18
  SidebarMenuItem,
20
19
  SidebarProvider,
21
20
  } 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';
21
+ import { SidebarDatasetsItemsGrouped } from '#uilib/components/widgets/SidebarDatasetsItemsGrouped';
27
22
  import { SybilionAppHeader } from '#uilib/components/widgets/SybilionAppHeader';
28
23
  import { GearSixIcon, UserCircleIcon } from '@phosphor-icons/react';
29
24
  import { House } from 'lucide-react';
30
25
 
31
26
  import { AppPageHeader } from '../../components/AppPageHeader/AppPageHeader';
32
27
  import { DocsHeaderActions } from '../../docsHeaderActions';
28
+ import {
29
+ DOCS_PREVIEW_APPS,
30
+ DOCS_WORKSPACE_APPS_LS_KEY,
31
+ MOCK_DATASETS,
32
+ PreviewPanel,
33
+ TEST_HEADER_ID,
34
+ } from './StandaloneAppLayoutPage.constants';
33
35
  import S from './StandaloneAppLayoutPage.styl';
34
36
 
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
37
  function DemoAppSidebar({
478
38
  panel,
479
39
  onSelectPanel,
@@ -563,17 +123,12 @@ function DemoMainBody({ panel }: { panel: PreviewPanel }) {
563
123
  }
564
124
 
565
125
  function StandaloneLayoutPreview() {
566
- const [theme, setTheme] = useState<'light' | 'dark'>('light');
567
126
  const [panel, setPanel] = useState<PreviewPanel>('home');
568
127
  const [previewPath, setPreviewPath] = useState('/docs-preview/home');
569
128
  const [selectedDatasetId, setSelectedDatasetId] = useState<
570
129
  number | undefined
571
130
  >();
572
131
 
573
- const onThemeToggle = useCallback(() => {
574
- setTheme(t => (t === 'dark' ? 'light' : 'dark'));
575
- }, []);
576
-
577
132
  return (
578
133
  <div className={S.preview}>
579
134
  <PageScroll rootClassName={S.previewScrollRoot}>
@@ -606,8 +161,6 @@ function StandaloneLayoutPreview() {
606
161
  email: 'preview@example.com',
607
162
  avatar: '',
608
163
  }}
609
- theme={theme}
610
- onThemeToggle={onThemeToggle}
611
164
  onLogout={() => undefined}
612
165
  menuItems={
613
166
  <>
package/src/index.ts CHANGED
@@ -58,3 +58,6 @@ export * from './components/ui/VimeoEmbed';
58
58
  export * from './components/ui/WorkspaceAppSwitcher';
59
59
  export * from './components/widgets/SidebarDatasetsItemsGrouped';
60
60
  export * from './components/widgets/SybilionAppHeader';
61
+ export * from './components/widgets/SybilionAuthLayout';
62
+ export * from './components/widgets/SybilionSignInPanel';
63
+ export * from './components/widgets/SignInPage';