@behindthemusictree/genre-tree-view 6.2.0 → 6.4.0

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/styles.css CHANGED
@@ -236,19 +236,6 @@
236
236
  gap: 0.5rem;
237
237
  }
238
238
 
239
- .gtv-zoom-controls {
240
- display: flex;
241
- flex-direction: column;
242
- gap: 0.125rem;
243
- width: fit-content;
244
- padding: 0.1875rem;
245
- box-sizing: border-box;
246
- background: var(--gtv-surface, var(--color-surface, #ffffff));
247
- border: 1px solid var(--gtv-border, var(--color-border, #e4e4e7));
248
- border-radius: 0.5rem;
249
- filter: drop-shadow(0 2px 6px rgba(24, 24, 27, 0.16));
250
- }
251
-
252
239
  /* Top-centre: the top corners belong to the host (search + panel on the left, app chrome on the
253
240
  right), and the trail sits right above the wheel it describes. */
254
241
  .gtv-wheel-breadcrumb {
@@ -310,8 +297,7 @@
310
297
  }
311
298
  }
312
299
 
313
- .gtv-wheel-floating-controls--horizontal,
314
- .gtv-wheel-floating-controls--horizontal .gtv-zoom-controls {
300
+ .gtv-wheel-floating-controls--horizontal {
315
301
  flex-direction: row;
316
302
  }
317
303
 
@@ -322,38 +308,11 @@
322
308
  }
323
309
  }
324
310
 
325
- .gtv-zoom-btn {
326
- display: flex;
327
- align-items: center;
328
- justify-content: center;
329
- width: 28px;
330
- height: 28px;
331
- padding: 0;
332
- border: none;
333
- border-radius: 0.375rem;
334
- background: transparent;
335
- color: var(--gtv-text-muted, var(--color-text-muted, #52525b));
336
- cursor: pointer;
337
- }
338
-
339
- .gtv-zoom-btn:hover {
340
- background-color: var(--gtv-surface-muted, var(--color-surface-muted, #f4f4f5));
341
- color: var(--gtv-text, var(--color-text, #18181b));
342
- }
343
-
344
- .gtv-zoom-btn--disabled {
345
- opacity: 0.4;
346
- cursor: not-allowed;
347
- }
348
-
349
- .gtv-zoom-btn--disabled:hover {
350
- background-color: transparent;
351
- color: var(--gtv-text-muted, var(--color-text-muted, #52525b));
352
- }
353
-
354
- .gtv-zoom-btn--selected {
355
- background-color: var(--gtv-surface-muted, var(--color-surface-muted, #f4f4f5));
356
- color: var(--gtv-text, var(--color-text, #18181b));
311
+ /* Pinch and pan replace the buttons on a touch screen (see `showZoomControls`). */
312
+ @media (pointer: coarse) {
313
+ .gtv-zoom-controls--auto {
314
+ display: none;
315
+ }
357
316
  }
358
317
 
359
318
  /* Node info panel — shows a clicked node's own fields, anchored to the left of the tree
@@ -485,6 +444,83 @@
485
444
  }
486
445
  }
487
446
 
447
+ .gtv-info-panel-grabber {
448
+ display: none;
449
+ }
450
+
451
+ /* A side column would leave no room for the tree in a narrow container, so the node panel docks
452
+ to the bottom as a sheet within thumb reach: peek covers INFO_PANEL_SHEET_PEEK_FRACTION of the
453
+ container (see constants.ts), full rises to the panel's usual top. */
454
+ @container (max-width: 767px) {
455
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded) {
456
+ --gtv-info-panel-header-inset: 0px;
457
+ top: auto;
458
+ left: 0;
459
+ right: 0;
460
+ bottom: 0;
461
+ width: auto;
462
+ height: 40%;
463
+ display: flex;
464
+ flex-direction: column;
465
+ overflow: hidden;
466
+ padding-bottom: env(safe-area-inset-bottom, 0px);
467
+ border-radius: var(--radius-panel, 1rem) var(--radius-panel, 1rem) 0 0;
468
+ transition: transform 200ms ease-out, visibility 0s linear 0s, height 200ms ease-out;
469
+ }
470
+
471
+ .gtv-info-panel--sheet-full:not(.gtv-info-panel--expanded) {
472
+ height: calc(100% - var(--gtv-info-panel-top, var(--layout-gutter, 0.75rem)));
473
+ }
474
+
475
+ .gtv-info-panel--sheet.gtv-info-panel--collapsed:not(.gtv-info-panel--expanded) {
476
+ transform: translateY(100%);
477
+ transition: transform 200ms ease-out, visibility 0s linear 200ms;
478
+ }
479
+
480
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded) > .gtv-info-panel-body {
481
+ flex: 1 1 auto;
482
+ min-height: 0;
483
+ overflow-y: auto;
484
+ overscroll-behavior: contain;
485
+ }
486
+
487
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded) .gtv-info-panel-grabber {
488
+ display: flex;
489
+ flex: none;
490
+ justify-content: center;
491
+ align-items: center;
492
+ width: 100%;
493
+ height: var(--layout-touch-target, 2.75rem);
494
+ padding: 0;
495
+ border: none;
496
+ background: transparent;
497
+ color: inherit;
498
+ cursor: grab;
499
+ touch-action: none;
500
+ }
501
+
502
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded) > .gtv-info-panel-header {
503
+ flex: none;
504
+ border-radius: 0;
505
+ }
506
+
507
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded) .gtv-info-panel-grabber::before {
508
+ content: "";
509
+ width: 2.25rem;
510
+ height: 0.25rem;
511
+ border-radius: 9999px;
512
+ background: currentColor;
513
+ opacity: 0.4;
514
+ }
515
+ }
516
+
517
+ @media (prefers-reduced-motion: reduce) {
518
+ .gtv-info-panel--sheet:not(.gtv-info-panel--expanded),
519
+ .gtv-info-panel--sheet.gtv-info-panel--collapsed:not(.gtv-info-panel--expanded) {
520
+ transition: none;
521
+ }
522
+ }
523
+
488
524
  .gtv-info-panel-header {
489
525
  display: flex;
490
526
  align-items: center;
@@ -1721,3 +1757,24 @@
1721
1757
  animation: gtv-busy-pulse 1.6s ease-in-out infinite;
1722
1758
  }
1723
1759
  }
1760
+
1761
+ /* Finger-sized hit areas (44px, Apple HIG) on touch screens; mouse layouts keep their density. */
1762
+ @media (pointer: coarse) {
1763
+ .gtv-info-panel-close,
1764
+ .gtv-info-panel-previous,
1765
+ .gtv-info-panel-zoom-in {
1766
+ width: var(--layout-touch-target, 2.75rem);
1767
+ height: var(--layout-touch-target, 2.75rem);
1768
+ }
1769
+
1770
+ .gtv-menu-row {
1771
+ height: var(--layout-touch-target, 2.75rem);
1772
+ font-size: 0.875rem;
1773
+ }
1774
+
1775
+ .gtv-outline-row,
1776
+ .gtv-info-panel-child,
1777
+ .gtv-info-panel-section-toggle {
1778
+ min-height: var(--layout-touch-target, 2.75rem);
1779
+ }
1780
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behindthemusictree/genre-tree-view",
3
- "version": "6.2.0",
3
+ "version": "6.4.0",
4
4
  "description": "Reusable, presentational D3-based genre/hierarchy tree visualization component for React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,6 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "peerDependencies": {
30
+ "@behindthemusictree/ui": "^0.10.0",
30
31
  "react": ">=18.0.0",
31
32
  "react-dom": ">=18.0.0"
32
33
  },
@@ -35,6 +36,7 @@
35
36
  "react-icons": "5.7.0"
36
37
  },
37
38
  "devDependencies": {
39
+ "@behindthemusictree/ui": "0.10.0",
38
40
  "@codspeed/vitest-plugin": "6.0.1",
39
41
  "@testing-library/jest-dom": "7.0.0",
40
42
  "@testing-library/react": "16.3.2",
@@ -62,4 +64,4 @@
62
64
  "coverage": "vitest run --coverage",
63
65
  "bench": "vitest bench --run"
64
66
  }
65
- }
67
+ }