react-dockable-desktop 5.3.4 → 5.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/index.d.cts CHANGED
@@ -1479,7 +1479,16 @@ declare const ConfirmationForm: React$1.FC<ConfirmationFormProps>;
1479
1479
  interface SidebarTab {
1480
1480
  id: string;
1481
1481
  label: string;
1482
- icon: React$1.ReactNode;
1482
+ /** Required unless `hidden` is true — a hidden tab never renders a rail button, so it has no icon to show. */
1483
+ icon?: React$1.ReactNode;
1484
+ /**
1485
+ * Omit this tab's rail button entirely — no icon, no click target — while it
1486
+ * remains fully openable via `openTab()` / `useSidebar().openTab()` / a controlled
1487
+ * `activeTabId`. Use for menu-driven panels with no persistent icon (e.g. a
1488
+ * Google-Maps-style hamburger that opens content not otherwise pinned to the rail).
1489
+ * Default: false
1490
+ */
1491
+ hidden?: boolean;
1483
1492
  /**
1484
1493
  * Mount immediately when the Sidebar first renders, not on first user click.
1485
1494
  * Implies `preserveState: true`.
@@ -1582,9 +1591,40 @@ interface SidebarProps {
1582
1591
  onStripVisibilityChange?: (visible: boolean) => void;
1583
1592
  /**
1584
1593
  * Show an "X" close button in the expanded drawer's header, as an additional way to collapse
1585
- * the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false
1594
+ * the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false.
1595
+ * Has no effect once the default header is suppressed — via `hideDefaultHeader`, or simply by
1596
+ * passing `renderHeader` (either one is sufficient) — since the entire default header, this
1597
+ * button included, is skipped for every tab in that case.
1586
1598
  */
1587
1599
  showCloseButton?: boolean;
1600
+ /**
1601
+ * Suppress the library's own drawer header (title + `showCloseButton`'s close
1602
+ * button) for every tab, so `renderHeader` (or each tab's own `renderContent`)
1603
+ * can supply a header, border, and styling instead. Applies uniformly across
1604
+ * all tabs — there's no per-tab override. Passing `renderHeader` by itself has
1605
+ * the same suppressing effect even if this is left unset — the two conditions
1606
+ * are combined with OR, precisely so that supplying `renderHeader` alone is
1607
+ * never a silent no-op. The close mechanism is unaffected either way: the
1608
+ * `onClose` parameter passed to `renderContent`/`renderHeader`, or
1609
+ * `useSidebarTab().onClose` from anywhere in a tab's content tree.
1610
+ * Default: false
1611
+ */
1612
+ hideDefaultHeader?: boolean;
1613
+ /**
1614
+ * Custom header renderer used in place of the library's own drawer header.
1615
+ * Passing `renderHeader` is by itself sufficient to suppress the default
1616
+ * header, whether or not `hideDefaultHeader` is also set — the two props are
1617
+ * combined with OR. Called once for whichever tab is currently active, so
1618
+ * the same header markup (e.g. a hamburger icon, a search field, a close
1619
+ * button) is shared uniformly across every tab instead of being repeated
1620
+ * inside each tab's own `renderContent`. Omit `renderHeader` and set
1621
+ * `hideDefaultHeader: true` to render no header at all and let each tab's
1622
+ * `renderContent` supply its own instead.
1623
+ * @param tab - the currently active tab
1624
+ * @param onClose - call to collapse the sidebar drawer
1625
+ * @param onOpen - call to (re-)select this tab
1626
+ */
1627
+ renderHeader?: (tab: SidebarTab, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
1588
1628
  /** Main workspace content rendered alongside the sidebar. */
1589
1629
  children?: React$1.ReactNode;
1590
1630
  }
@@ -2240,7 +2280,8 @@ declare function usePanelContribution(contribution: PanelContribution): void;
2240
2280
  declare function useActivePanelContribution(): PanelContribution | null;
2241
2281
  /**
2242
2282
  * Converts a contributed sidebar section into a `SidebarTab` for `<Sidebar tabs={...}>`.
2243
- * `SidebarTab.icon` is required, so supply `fallbackIcon` for sections that omit one.
2283
+ * `SidebarTab.icon` is optional but recommended unless the tab is `hidden`; supply
2284
+ * `fallbackIcon` for sections that omit one.
2244
2285
  * `eagerMount`/`preserveState` have no contribution-side equivalent — a contribution
2245
2286
  * only exists while its owning panel is mounted and active, so both are left unset.
2246
2287
  */
package/dist/index.d.ts CHANGED
@@ -1479,7 +1479,16 @@ declare const ConfirmationForm: React$1.FC<ConfirmationFormProps>;
1479
1479
  interface SidebarTab {
1480
1480
  id: string;
1481
1481
  label: string;
1482
- icon: React$1.ReactNode;
1482
+ /** Required unless `hidden` is true — a hidden tab never renders a rail button, so it has no icon to show. */
1483
+ icon?: React$1.ReactNode;
1484
+ /**
1485
+ * Omit this tab's rail button entirely — no icon, no click target — while it
1486
+ * remains fully openable via `openTab()` / `useSidebar().openTab()` / a controlled
1487
+ * `activeTabId`. Use for menu-driven panels with no persistent icon (e.g. a
1488
+ * Google-Maps-style hamburger that opens content not otherwise pinned to the rail).
1489
+ * Default: false
1490
+ */
1491
+ hidden?: boolean;
1483
1492
  /**
1484
1493
  * Mount immediately when the Sidebar first renders, not on first user click.
1485
1494
  * Implies `preserveState: true`.
@@ -1582,9 +1591,40 @@ interface SidebarProps {
1582
1591
  onStripVisibilityChange?: (visible: boolean) => void;
1583
1592
  /**
1584
1593
  * Show an "X" close button in the expanded drawer's header, as an additional way to collapse
1585
- * the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false
1594
+ * the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false.
1595
+ * Has no effect once the default header is suppressed — via `hideDefaultHeader`, or simply by
1596
+ * passing `renderHeader` (either one is sufficient) — since the entire default header, this
1597
+ * button included, is skipped for every tab in that case.
1586
1598
  */
1587
1599
  showCloseButton?: boolean;
1600
+ /**
1601
+ * Suppress the library's own drawer header (title + `showCloseButton`'s close
1602
+ * button) for every tab, so `renderHeader` (or each tab's own `renderContent`)
1603
+ * can supply a header, border, and styling instead. Applies uniformly across
1604
+ * all tabs — there's no per-tab override. Passing `renderHeader` by itself has
1605
+ * the same suppressing effect even if this is left unset — the two conditions
1606
+ * are combined with OR, precisely so that supplying `renderHeader` alone is
1607
+ * never a silent no-op. The close mechanism is unaffected either way: the
1608
+ * `onClose` parameter passed to `renderContent`/`renderHeader`, or
1609
+ * `useSidebarTab().onClose` from anywhere in a tab's content tree.
1610
+ * Default: false
1611
+ */
1612
+ hideDefaultHeader?: boolean;
1613
+ /**
1614
+ * Custom header renderer used in place of the library's own drawer header.
1615
+ * Passing `renderHeader` is by itself sufficient to suppress the default
1616
+ * header, whether or not `hideDefaultHeader` is also set — the two props are
1617
+ * combined with OR. Called once for whichever tab is currently active, so
1618
+ * the same header markup (e.g. a hamburger icon, a search field, a close
1619
+ * button) is shared uniformly across every tab instead of being repeated
1620
+ * inside each tab's own `renderContent`. Omit `renderHeader` and set
1621
+ * `hideDefaultHeader: true` to render no header at all and let each tab's
1622
+ * `renderContent` supply its own instead.
1623
+ * @param tab - the currently active tab
1624
+ * @param onClose - call to collapse the sidebar drawer
1625
+ * @param onOpen - call to (re-)select this tab
1626
+ */
1627
+ renderHeader?: (tab: SidebarTab, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
1588
1628
  /** Main workspace content rendered alongside the sidebar. */
1589
1629
  children?: React$1.ReactNode;
1590
1630
  }
@@ -2240,7 +2280,8 @@ declare function usePanelContribution(contribution: PanelContribution): void;
2240
2280
  declare function useActivePanelContribution(): PanelContribution | null;
2241
2281
  /**
2242
2282
  * Converts a contributed sidebar section into a `SidebarTab` for `<Sidebar tabs={...}>`.
2243
- * `SidebarTab.icon` is required, so supply `fallbackIcon` for sections that omit one.
2283
+ * `SidebarTab.icon` is optional but recommended unless the tab is `hidden`; supply
2284
+ * `fallbackIcon` for sections that omit one.
2244
2285
  * `eagerMount`/`preserveState` have no contribution-side equivalent — a contribution
2245
2286
  * only exists while its owning panel is mounted and active, so both are left unset.
2246
2287
  */