@behindthemusictree/app-kit-ui 36.0.0 → 37.0.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.
@@ -483,6 +483,7 @@ function SearchBox({
483
483
  groups,
484
484
  onPicked,
485
485
  onClear,
486
+ clearLabel,
486
487
  leading,
487
488
  className: className2,
488
489
  onFocus
@@ -514,6 +515,7 @@ function SearchBox({
514
515
  status,
515
516
  loading,
516
517
  onClear,
518
+ clearLabel,
517
519
  leading,
518
520
  inputClassName: "focus-visible:ring-0"
519
521
  }
@@ -614,6 +616,8 @@ function GenreSearch({
614
616
  onSelect,
615
617
  selectedName = null,
616
618
  onClear,
619
+ showClear,
620
+ clearLabel,
617
621
  onPrevious,
618
622
  placeholder,
619
623
  onQueryChange,
@@ -661,7 +665,8 @@ function GenreSearch({
661
665
  if (groupKey !== "genres") setQuery("");
662
666
  onQueryChange?.("");
663
667
  },
664
- onClear: canClear ? () => {
668
+ clearLabel,
669
+ onClear: showClear ?? canClear ? () => {
665
670
  clear();
666
671
  onQueryChange?.("");
667
672
  } : void 0,
@@ -1516,10 +1521,12 @@ function useGenreDetailContent({
1516
1521
  };
1517
1522
  }, [detail, scope]);
1518
1523
  if (isError) return {
1524
+ name: null,
1519
1525
  title: "Genre unavailable",
1520
1526
  content: /* @__PURE__ */ jsx20("p", { role: "alert", className: "p-4 text-sm text-[var(--color-text)]", children: "This genre could not be loaded." })
1521
1527
  };
1522
1528
  if (isPending || !detail || !view) return {
1529
+ name: null,
1523
1530
  title: "Loading genre\u2026",
1524
1531
  content: /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-3 p-4", "aria-busy": "true", "data-testid": "genre-detail-panel-skeleton", children: [
1525
1532
  /* @__PURE__ */ jsx20(Skeleton3, { className: "h-6 w-2/3" }),
@@ -1541,6 +1548,7 @@ function useGenreDetailContent({
1541
1548
  );
1542
1549
  const ancestors = /* @__PURE__ */ jsx20(GenreNodeAncestors, { ancestorNodes: view.ancestorNodes, onSelectNode: selectGenre });
1543
1550
  return {
1551
+ name: detail.name,
1544
1552
  title: detail.name,
1545
1553
  headerAccent: { background: view.fill, color: ACCENT_TEXT_COLOR },
1546
1554
  aside: expanded ? ancestors : void 0,
@@ -1582,7 +1590,7 @@ function GenreDetailPanel({
1582
1590
  onExpandedChange,
1583
1591
  edgeTab,
1584
1592
  extras,
1585
- headerClassName
1593
+ titleInSearch
1586
1594
  }) {
1587
1595
  const panel = useGenreDetailContent({
1588
1596
  genreUuid,
@@ -1605,7 +1613,7 @@ function GenreDetailPanel({
1605
1613
  onExpandedChange,
1606
1614
  edgeTab,
1607
1615
  aside: panel.aside,
1608
- headerClassName,
1616
+ titleInSearch,
1609
1617
  headerActions: onExpandedChange ? /* @__PURE__ */ jsx20(IconButton, { "aria-label": expanded ? "Shrink panel" : "Extend panel", onClick: () => onExpandedChange(!expanded), children: expanded ? /* @__PURE__ */ jsx20(Minimize2, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ jsx20(Maximize2, { "aria-hidden": "true", className: "h-4 w-4" }) }) : void 0,
1610
1618
  children: panel.content
1611
1619
  }
@@ -2606,7 +2614,6 @@ function GenreTreeView({
2606
2614
  if (node !== null && songUuid !== null) changeSong(null);
2607
2615
  selectNode(node);
2608
2616
  };
2609
- const handleGenreSearchClear = clearSelection;
2610
2617
  const handleGenreSearchSelect = (genrePlaylist2) => {
2611
2618
  reopenPanel();
2612
2619
  if (songUuid !== null) changeSong(null);
@@ -2689,7 +2696,7 @@ function GenreTreeView({
2689
2696
  expanded: overlayPanel.expanded ?? false,
2690
2697
  onExpandedChange: overlayPanel.onExpandedChange,
2691
2698
  onClose: overlayPanel.onClose,
2692
- compact: false
2699
+ titleInSearch: false
2693
2700
  };
2694
2701
  } else if (selectedGenreUuid) {
2695
2702
  activePanel = {
@@ -2699,7 +2706,7 @@ function GenreTreeView({
2699
2706
  expanded: isExpanded,
2700
2707
  onExpandedChange: changeExpanded,
2701
2708
  onClose: clearSelection,
2702
- compact: false,
2709
+ titleInSearch: true,
2703
2710
  headerAccent: relations ? { background: relations.fill, color: relations.textColor } : genreContent.headerAccent
2704
2711
  };
2705
2712
  } else if (builtInPanel) {
@@ -2710,7 +2717,7 @@ function GenreTreeView({
2710
2717
  expanded: builtInPanel.expanded,
2711
2718
  onExpandedChange: builtInPanel.onExpandedChange,
2712
2719
  onClose: builtInPanel.onClose,
2713
- compact: true
2720
+ titleInSearch: true
2714
2721
  };
2715
2722
  }
2716
2723
  const isPanelShown = activePanel !== null && (selectedGenreUuid !== null || isTreeReady);
@@ -2778,8 +2785,10 @@ function GenreTreeView({
2778
2785
  if (songUuid) changeSong(null);
2779
2786
  selectGenre(uuid);
2780
2787
  },
2781
- selectedName: (selectedGenreUuid ? genreContent.title : null) ?? (typeof builtInPanel?.title === "string" ? builtInPanel.title : null),
2782
- onClear: builtInSongPanel ? () => changeSong(null) : builtInArtistPanel ? () => changeArtist(null) : handleGenreSearchClear,
2788
+ selectedName: selectedGenreUuid ? genreContent.name : typeof builtInPanel?.title === "string" ? builtInPanel.title : null,
2789
+ onClear: activePanel?.onClose,
2790
+ showClear: activePanel?.titleInSearch ?? false,
2791
+ clearLabel: "Close panel",
2783
2792
  onPrevious: handlePrevious,
2784
2793
  onQueryChange: onSearchQueryChange,
2785
2794
  onFocus: onSearchFocus,
@@ -2969,8 +2978,7 @@ function GenreTreeView({
2969
2978
  ref: panelRef,
2970
2979
  side: "left",
2971
2980
  title: activePanel?.title ?? "",
2972
- hideTitle: activePanel?.compact,
2973
- hideClose: activePanel?.compact,
2981
+ titleInSearch: activePanel?.titleInSearch,
2974
2982
  headerAccent: activePanel?.headerAccent,
2975
2983
  headerActions: expandButton,
2976
2984
  onClose: activePanel?.onClose ?? noop,
@@ -2979,7 +2987,7 @@ function GenreTreeView({
2979
2987
  onExpandedChange: activePanel?.onExpandedChange,
2980
2988
  aside: activePanel?.aside,
2981
2989
  edgeTab: detailTab,
2982
- headerClassName: "pt-[calc(var(--layout-search-h)+var(--layout-panel-inset)+0.5rem)]",
2990
+ headerClassName: activePanel?.titleInSearch ? void 0 : "pt-[calc(var(--layout-search-h)+var(--layout-panel-inset)+0.5rem)]",
2983
2991
  children: activePanel?.aside && !activePanel.expanded ? /* @__PURE__ */ jsxs26(Fragment14, { children: [
2984
2992
  activePanel.content,
2985
2993
  activePanel.aside
@@ -3461,4 +3469,4 @@ export {
3461
3469
  GenreTreeViewSkeleton2 as GenreTreeViewSkeleton,
3462
3470
  GenreTreeOutlineSkeleton
3463
3471
  };
3464
- //# sourceMappingURL=chunk-RTXLUHJY.js.map
3472
+ //# sourceMappingURL=chunk-FTYMRCJS.js.map