@re-venue/ui-core-react 0.2.1 → 0.3.1

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.
@@ -2,9 +2,16 @@
2
2
  display: flex;
3
3
  height: 100dvh;
4
4
  overflow: hidden;
5
+ position: relative;
5
6
  font-family: 'Host Grotesk', system-ui, sans-serif;
6
7
  }
7
8
 
9
+ /* Reserves the collapsed rail's width in the flex flow while the real sidebar floats over the content. */
10
+ .rv-sidebar-rail-spacer {
11
+ width: 56px;
12
+ flex-shrink: 0;
13
+ }
14
+
8
15
  .rv-sidebar {
9
16
  width: 280px;
10
17
  flex-shrink: 0;
@@ -12,7 +19,7 @@
12
19
  flex-direction: column;
13
20
  background: var(--color-bg-panel, #ffffff);
14
21
  border-right: 1px solid var(--color-border-subtle, #d1d5db);
15
- transition: width var(--transition-slow, 0.25s ease);
22
+ transition: width var(--transition-slow, 0.25s ease), box-shadow var(--transition-fast, 0.1s ease);
16
23
  overflow: hidden;
17
24
  }
18
25
 
@@ -20,6 +27,22 @@
20
27
  width: 56px;
21
28
  }
22
29
 
30
+ /* Collapsed: lift out of flow and float over the page (the spacer holds the layout width). */
31
+ .rv-sidebar.rv-floating {
32
+ position: absolute;
33
+ top: 0;
34
+ left: 0;
35
+ bottom: 0;
36
+ z-index: 50;
37
+ width: 56px;
38
+ }
39
+
40
+ /* Hover/focus reveal: expand the floating panel over the content without reflowing it. */
41
+ .rv-sidebar.rv-floating.rv-flyout {
42
+ width: 280px;
43
+ box-shadow: 4px 0 24px rgba(0, 0, 0, 0.16);
44
+ }
45
+
23
46
  .rv-sidebar.rv-collapsed .rv-sidebar-top {
24
47
  justify-content: center;
25
48
  padding: 0;
@@ -278,6 +301,322 @@
278
301
  flex-direction: column;
279
302
  }
280
303
 
304
+ /* Sidebar top nav (e.g. Portfolio, above the tree) */
305
+ .rv-sidebar-top-nav {
306
+ display: flex;
307
+ flex-direction: column;
308
+ gap: 2px;
309
+ padding: 0.625rem 0.5rem 0.25rem;
310
+ flex-shrink: 0;
311
+ }
312
+
313
+ .rv-sidebar.rv-collapsed .rv-sidebar-top-nav {
314
+ padding: 0.5rem 0;
315
+ align-items: center;
316
+ }
317
+
318
+ /* Workspace → venue tree */
319
+ .rv-sidebar-tree {
320
+ flex: 1;
321
+ display: flex;
322
+ flex-direction: column;
323
+ gap: 1px;
324
+ padding: 0.25rem 0.5rem 0.5rem;
325
+ overflow-y: auto;
326
+ }
327
+
328
+ .rv-sidebar.rv-collapsed .rv-sidebar-tree {
329
+ padding: 0.5rem 0;
330
+ align-items: center;
331
+ }
332
+
333
+ .rv-tree-section-label {
334
+ font-size: 0.65rem;
335
+ font-weight: 700;
336
+ letter-spacing: 0.07em;
337
+ text-transform: uppercase;
338
+ color: var(--color-text-muted, #777777);
339
+ padding: 0.375rem 0.625rem 0.25rem;
340
+ /* Keep on one line so it clips (rather than wraps + reflows) while the width animates. */
341
+ white-space: nowrap;
342
+ overflow: hidden;
343
+ text-overflow: ellipsis;
344
+ }
345
+
346
+ .rv-tree-group {
347
+ display: flex;
348
+ flex-direction: column;
349
+ gap: 1px;
350
+ }
351
+
352
+ .rv-tree-ws {
353
+ display: flex;
354
+ align-items: center;
355
+ gap: 0.25rem;
356
+ }
357
+
358
+ .rv-sidebar.rv-collapsed .rv-tree-ws {
359
+ justify-content: center;
360
+ }
361
+
362
+ .rv-tree-disclosure {
363
+ flex-shrink: 0;
364
+ display: flex;
365
+ align-items: center;
366
+ justify-content: center;
367
+ width: 22px;
368
+ height: 22px;
369
+ border: none;
370
+ background: none;
371
+ cursor: pointer;
372
+ color: var(--color-text-muted, #777777);
373
+ border-radius: var(--radius-sm, 4px);
374
+ }
375
+
376
+ .rv-tree-disclosure svg {
377
+ transition: transform var(--transition-fast, 0.1s ease);
378
+ transform: rotate(-90deg);
379
+ }
380
+
381
+ .rv-tree-disclosure.rv-open svg {
382
+ transform: rotate(0deg);
383
+ }
384
+
385
+ .rv-tree-disclosure:hover {
386
+ background: var(--color-bg-surface, #f0f0f0);
387
+ color: var(--color-text-secondary, #444444);
388
+ }
389
+
390
+ .rv-tree-ws-title {
391
+ flex: 1;
392
+ min-width: 0;
393
+ display: flex;
394
+ align-items: center;
395
+ gap: 0.5rem;
396
+ padding: 0.5rem 0.5rem;
397
+ border: none;
398
+ background: none;
399
+ cursor: pointer;
400
+ border-radius: var(--radius-md, 8px);
401
+ font-family: inherit;
402
+ font-size: 0.875rem;
403
+ font-weight: 600;
404
+ color: var(--color-text-primary, #111111);
405
+ text-align: left;
406
+ }
407
+
408
+ .rv-tree-ws-title:hover {
409
+ background: var(--color-bg-surface, #f0f0f0);
410
+ }
411
+
412
+ .rv-sidebar.rv-collapsed .rv-tree-ws-title {
413
+ justify-content: center;
414
+ width: 100%;
415
+ padding: 0.5rem 0;
416
+ }
417
+
418
+ .rv-tree-ws-icon {
419
+ flex-shrink: 0;
420
+ color: var(--color-text-muted, #777777);
421
+ }
422
+
423
+ .rv-tree-ws-name {
424
+ overflow: hidden;
425
+ text-overflow: ellipsis;
426
+ white-space: nowrap;
427
+ }
428
+
429
+ .rv-tree-venues {
430
+ display: flex;
431
+ flex-direction: column;
432
+ gap: 1px;
433
+ margin: 1px 0 0.25rem 0.9375rem;
434
+ padding-left: 0.875rem;
435
+ border-left: 1px solid var(--color-border-subtle, #d1d5db);
436
+ }
437
+
438
+ .rv-tree-venue {
439
+ display: flex;
440
+ align-items: center;
441
+ gap: 0.5rem;
442
+ padding: 0.4375rem 0.5625rem;
443
+ border: none;
444
+ background: none;
445
+ cursor: pointer;
446
+ border-radius: var(--radius-md, 8px);
447
+ font-family: inherit;
448
+ font-size: 0.8125rem;
449
+ color: var(--color-text-secondary, #444444);
450
+ text-align: left;
451
+ width: 100%;
452
+ }
453
+
454
+ .rv-tree-venue svg {
455
+ flex-shrink: 0;
456
+ color: var(--color-text-muted, #777777);
457
+ }
458
+
459
+ .rv-tree-venue:hover:not(.rv-active) {
460
+ background: var(--color-bg-surface, #f0f0f0);
461
+ color: var(--color-text-primary, #111111);
462
+ }
463
+
464
+ .rv-tree-venue.rv-active {
465
+ background: var(--color-primary-focus, rgba(22, 163, 74, 0.1));
466
+ color: var(--color-primary, #16a34a);
467
+ font-weight: 600;
468
+ }
469
+
470
+ .rv-tree-venue.rv-active svg {
471
+ color: var(--color-primary, #16a34a);
472
+ }
473
+
474
+ .rv-tree-venue-name {
475
+ overflow: hidden;
476
+ text-overflow: ellipsis;
477
+ white-space: nowrap;
478
+ }
479
+
480
+ /* Active venue label (shown in the header when the sidebar is collapsed) */
481
+ .rv-header-venue {
482
+ display: flex;
483
+ align-items: center;
484
+ gap: 0.4375rem;
485
+ padding-right: 1.75rem;
486
+ margin-right: 0.5rem;
487
+ border-right: 1px solid var(--color-border-subtle, #d1d5db);
488
+ font-size: 0.875rem;
489
+ font-weight: 600;
490
+ color: var(--color-text-primary, #111111);
491
+ white-space: nowrap;
492
+ min-width: 0;
493
+ /* Plays on mount, i.e. when the sidebar collapses and the label appears. */
494
+ animation: rv-header-venue-in var(--transition-slow, 0.25s) ease both;
495
+ }
496
+
497
+ @keyframes rv-header-venue-in {
498
+ from {
499
+ opacity: 0;
500
+ transform: translateX(-10px);
501
+ }
502
+ to {
503
+ opacity: 1;
504
+ transform: translateX(0);
505
+ }
506
+ }
507
+
508
+ @media (prefers-reduced-motion: reduce) {
509
+ .rv-header-venue {
510
+ animation: none;
511
+ }
512
+ }
513
+
514
+ .rv-header-venue svg {
515
+ flex-shrink: 0;
516
+ color: var(--color-text-muted, #777777);
517
+ }
518
+
519
+ .rv-header-venue-name {
520
+ overflow: hidden;
521
+ text-overflow: ellipsis;
522
+ max-width: 220px;
523
+ }
524
+
525
+ /* Header nav (top-bar tool buttons) */
526
+ .rv-header-nav {
527
+ display: flex;
528
+ align-items: center;
529
+ gap: 0.25rem;
530
+ }
531
+
532
+ .rv-header-nav-item {
533
+ display: flex;
534
+ align-items: center;
535
+ gap: 0.5rem;
536
+ padding: 0.5rem 0.8125rem;
537
+ border-radius: var(--radius-md, 8px);
538
+ color: var(--color-text-secondary, #444444);
539
+ text-decoration: none;
540
+ font-size: 0.875rem;
541
+ transition: background var(--transition-fast, 0.1s ease), color var(--transition-fast, 0.1s ease);
542
+ white-space: nowrap;
543
+ }
544
+
545
+ .rv-header-nav-item .rv-nav-icon,
546
+ .rv-header-nav-item .rv-nav-icon svg {
547
+ width: 16px;
548
+ height: 16px;
549
+ }
550
+
551
+ .rv-header-nav-item:hover {
552
+ background: var(--color-bg-surface, #f0f0f0);
553
+ color: var(--color-text-primary, #111111);
554
+ }
555
+
556
+ .rv-header-nav-item.rv-active {
557
+ background: var(--color-primary-focus, rgba(22, 163, 74, 0.1));
558
+ color: var(--color-primary, #16a34a);
559
+ font-weight: 600;
560
+ }
561
+
562
+ /* Header right cluster (top-right): app actions + settings */
563
+ .rv-header-right {
564
+ margin-left: auto;
565
+ display: flex;
566
+ align-items: center;
567
+ gap: 0.75rem;
568
+ }
569
+
570
+ .rv-header-settings {
571
+ display: flex;
572
+ align-items: center;
573
+ gap: 0.5rem;
574
+ }
575
+
576
+ .rv-header-action {
577
+ display: inline-flex;
578
+ align-items: center;
579
+ gap: 0.4375rem;
580
+ padding: 0.4375rem 0.75rem;
581
+ border: 1px solid var(--color-border-subtle, #d1d5db);
582
+ border-radius: var(--radius-md, 8px);
583
+ background: var(--color-bg-panel, #ffffff);
584
+ font-family: inherit;
585
+ font-size: 0.8125rem;
586
+ color: var(--color-text-secondary, #444444);
587
+ text-decoration: none;
588
+ white-space: nowrap;
589
+ transition: background var(--transition-fast, 0.1s ease), color var(--transition-fast, 0.1s ease);
590
+ }
591
+
592
+ .rv-header-action:hover {
593
+ background: var(--color-bg-surface, #f0f0f0);
594
+ color: var(--color-text-primary, #111111);
595
+ }
596
+
597
+ .rv-header-action.rv-active {
598
+ background: var(--color-primary-focus, rgba(22, 163, 74, 0.1));
599
+ border-color: var(--color-primary-focus, rgba(22, 163, 74, 0.1));
600
+ color: var(--color-primary, #16a34a);
601
+ font-weight: 600;
602
+ }
603
+
604
+ .rv-header-action.rv-active .rv-header-action-icon {
605
+ color: var(--color-primary, #16a34a);
606
+ }
607
+
608
+ .rv-header-action-icon {
609
+ display: flex;
610
+ align-items: center;
611
+ justify-content: center;
612
+ color: var(--color-text-muted, #777777);
613
+ }
614
+
615
+ .rv-header-action-icon svg {
616
+ width: 15px;
617
+ height: 15px;
618
+ }
619
+
281
620
  /* VenueSwitcher */
282
621
  .rv-venue-switcher {
283
622
  position: relative;
package/src/types.ts CHANGED
@@ -16,12 +16,23 @@ export interface Venue {
16
16
  }
17
17
  }
18
18
 
19
+ /**
20
+ * Where a nav item is surfaced in the AppShell chrome:
21
+ * - 'sidebar' → rendered above the workspace/venue tree (e.g. Portfolio)
22
+ * - 'header' → a top-bar tool button (default); the first one is the venue-click target
23
+ * - 'workspace' → not rendered; its url is the target when a workspace title is clicked (e.g. Dashboard)
24
+ * - 'settings' → top-right settings cluster (e.g. Venue/Workspace Settings)
25
+ */
26
+ export type NavPlacement = 'sidebar' | 'header' | 'workspace' | 'settings'
27
+
19
28
  export interface SidebarNavItem {
20
29
  label: string
21
30
  url: string
22
31
  icon: string
23
32
  permission?: string
33
+ placement?: NavPlacement
24
34
  active?: boolean
35
+ /** @deprecated superseded by `placement: 'settings'`; ignored by the new layout */
25
36
  pinned?: boolean
26
37
  hidden?: boolean
27
38
  }