react-dockable-desktop 5.2.1 → 5.3.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
@@ -1501,10 +1501,13 @@ interface SidebarTab {
1501
1501
  renderContent: (tabId: string, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
1502
1502
  }
1503
1503
  /**
1504
- * Simple case for `SidebarProps.headerAction`: the library renders a default-styled icon
1505
- * button (visually consistent with the regular tab buttons) and forwards the click.
1504
+ * Simple case for `SidebarProps.headerAction`/`footerAction`: the library renders a
1505
+ * default-styled icon button (visually consistent with the regular tab buttons) and forwards
1506
+ * the click.
1506
1507
  */
1507
1508
  interface SidebarHeaderActionButton {
1509
+ /** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
1510
+ id?: string;
1508
1511
  icon: React$1.ReactNode;
1509
1512
  /** Tooltip and aria-label — same convention as `SidebarTab.label`. */
1510
1513
  label: string;
@@ -1512,12 +1515,14 @@ interface SidebarHeaderActionButton {
1512
1515
  disabled?: boolean;
1513
1516
  }
1514
1517
  /**
1515
- * Full-control case for `SidebarProps.headerAction`: the consumer supplies their own markup
1516
- * (a Material UI `IconButton`, a Bootstrap `Button`, a Tailwind-styled `<button>`, or anything
1517
- * else) wholesale. The library renders exactly what this returns, unwrapped, so the consumer's
1518
- * own hover/active/focus/ripple behavior and click handling are untouched.
1518
+ * Full-control case for `SidebarProps.headerAction`/`footerAction`: the consumer supplies their
1519
+ * own markup (a Material UI `IconButton`, a Bootstrap `Button`, a Tailwind-styled `<button>`, or
1520
+ * anything else) wholesale. The library renders exactly what this returns, unwrapped, so the
1521
+ * consumer's own hover/active/focus/ripple behavior and click handling are untouched.
1519
1522
  */
1520
1523
  interface SidebarHeaderActionCustom {
1524
+ /** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
1525
+ id?: string;
1521
1526
  render: () => React$1.ReactNode;
1522
1527
  }
1523
1528
  /**
@@ -1527,17 +1532,34 @@ interface SidebarHeaderActionCustom {
1527
1532
  * is entirely up to the consumer.
1528
1533
  */
1529
1534
  type SidebarHeaderAction = SidebarHeaderActionButton | SidebarHeaderActionCustom;
1535
+ /**
1536
+ * A single entry inside `SidebarProps.headerAction`/`footerAction` when used as an array: either
1537
+ * a non-toggling action button/custom render (see `SidebarHeaderAction`), or a real `SidebarTab`
1538
+ * that behaves exactly like a main-list tab — it mounts, activates, and closes through the same
1539
+ * lifecycle, so e.g. a "Settings" entry pinned to the footer can expand like any other tab.
1540
+ */
1541
+ type SidebarRailEntry = SidebarTab | SidebarHeaderActionButton | SidebarHeaderActionCustom;
1530
1542
  interface SidebarProps {
1531
1543
  /** Which side the activity bar and drawer appear on. Default: 'right' */
1532
1544
  position?: 'left' | 'right';
1533
1545
  tabs: SidebarTab[];
1534
1546
  /**
1535
- * A single non-toggling action button (e.g. a hamburger menu) shown above the tabs, in its
1536
- * own `.rdd-sidebar-header-area` — independent of the tabs' own inter-item gap. Override
1547
+ * One or more non-toggling action buttons and/or real tabs shown above the tabs, in their
1548
+ * own `.rdd-sidebar-header-area` — independent of the tabs' own inter-item gap. Pass a single
1549
+ * `{ icon, label, onClick }`/`{ render }` object (the common case), or an array mixing action
1550
+ * buttons, custom renders, and `SidebarTab` entries — a tab entry here behaves exactly like a
1551
+ * main-list tab (mounts, activates, closes through the same lifecycle). Override
1537
1552
  * `--rdd-sidebar-header-area-padding-top`/`--rdd-sidebar-header-area-padding-bottom`
1538
1553
  * (both default `8px`) to control its spacing/effective height.
1539
1554
  */
1540
- headerAction?: SidebarHeaderAction;
1555
+ headerAction?: SidebarRailEntry | SidebarRailEntry[];
1556
+ /**
1557
+ * Mirror of `headerAction`, pinned to the bottom of the tab strip via its own
1558
+ * `.rdd-sidebar-footer-area` — e.g. a "Settings" tab that should always sit at the bottom
1559
+ * regardless of tab count. Override `--rdd-sidebar-footer-area-padding-top`/
1560
+ * `--rdd-sidebar-footer-area-padding-bottom` (both default `8px`) to control its spacing.
1561
+ */
1562
+ footerAction?: SidebarRailEntry | SidebarRailEntry[];
1541
1563
  /** Initial drawer width in pixels. Default: 280 */
1542
1564
  defaultWidth?: number;
1543
1565
  /** Minimum drawer width in pixels during drag-resize. Default: 150 */
@@ -1558,6 +1580,11 @@ interface SidebarProps {
1558
1580
  stripVisible?: boolean;
1559
1581
  /** Called when showStrip/hideStrip is invoked on the imperative handle. */
1560
1582
  onStripVisibilityChange?: (visible: boolean) => void;
1583
+ /**
1584
+ * 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
1586
+ */
1587
+ showCloseButton?: boolean;
1561
1588
  /** Main workspace content rendered alongside the sidebar. */
1562
1589
  children?: React$1.ReactNode;
1563
1590
  }
package/dist/index.d.ts CHANGED
@@ -1501,10 +1501,13 @@ interface SidebarTab {
1501
1501
  renderContent: (tabId: string, onClose: () => void, onOpen: () => void) => React$1.ReactNode;
1502
1502
  }
1503
1503
  /**
1504
- * Simple case for `SidebarProps.headerAction`: the library renders a default-styled icon
1505
- * button (visually consistent with the regular tab buttons) and forwards the click.
1504
+ * Simple case for `SidebarProps.headerAction`/`footerAction`: the library renders a
1505
+ * default-styled icon button (visually consistent with the regular tab buttons) and forwards
1506
+ * the click.
1506
1507
  */
1507
1508
  interface SidebarHeaderActionButton {
1509
+ /** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
1510
+ id?: string;
1508
1511
  icon: React$1.ReactNode;
1509
1512
  /** Tooltip and aria-label — same convention as `SidebarTab.label`. */
1510
1513
  label: string;
@@ -1512,12 +1515,14 @@ interface SidebarHeaderActionButton {
1512
1515
  disabled?: boolean;
1513
1516
  }
1514
1517
  /**
1515
- * Full-control case for `SidebarProps.headerAction`: the consumer supplies their own markup
1516
- * (a Material UI `IconButton`, a Bootstrap `Button`, a Tailwind-styled `<button>`, or anything
1517
- * else) wholesale. The library renders exactly what this returns, unwrapped, so the consumer's
1518
- * own hover/active/focus/ripple behavior and click handling are untouched.
1518
+ * Full-control case for `SidebarProps.headerAction`/`footerAction`: the consumer supplies their
1519
+ * own markup (a Material UI `IconButton`, a Bootstrap `Button`, a Tailwind-styled `<button>`, or
1520
+ * anything else) wholesale. The library renders exactly what this returns, unwrapped, so the
1521
+ * consumer's own hover/active/focus/ripple behavior and click handling are untouched.
1519
1522
  */
1520
1523
  interface SidebarHeaderActionCustom {
1524
+ /** Only needed when used inside a `SidebarRailEntry[]` array, for the React key. */
1525
+ id?: string;
1521
1526
  render: () => React$1.ReactNode;
1522
1527
  }
1523
1528
  /**
@@ -1527,17 +1532,34 @@ interface SidebarHeaderActionCustom {
1527
1532
  * is entirely up to the consumer.
1528
1533
  */
1529
1534
  type SidebarHeaderAction = SidebarHeaderActionButton | SidebarHeaderActionCustom;
1535
+ /**
1536
+ * A single entry inside `SidebarProps.headerAction`/`footerAction` when used as an array: either
1537
+ * a non-toggling action button/custom render (see `SidebarHeaderAction`), or a real `SidebarTab`
1538
+ * that behaves exactly like a main-list tab — it mounts, activates, and closes through the same
1539
+ * lifecycle, so e.g. a "Settings" entry pinned to the footer can expand like any other tab.
1540
+ */
1541
+ type SidebarRailEntry = SidebarTab | SidebarHeaderActionButton | SidebarHeaderActionCustom;
1530
1542
  interface SidebarProps {
1531
1543
  /** Which side the activity bar and drawer appear on. Default: 'right' */
1532
1544
  position?: 'left' | 'right';
1533
1545
  tabs: SidebarTab[];
1534
1546
  /**
1535
- * A single non-toggling action button (e.g. a hamburger menu) shown above the tabs, in its
1536
- * own `.rdd-sidebar-header-area` — independent of the tabs' own inter-item gap. Override
1547
+ * One or more non-toggling action buttons and/or real tabs shown above the tabs, in their
1548
+ * own `.rdd-sidebar-header-area` — independent of the tabs' own inter-item gap. Pass a single
1549
+ * `{ icon, label, onClick }`/`{ render }` object (the common case), or an array mixing action
1550
+ * buttons, custom renders, and `SidebarTab` entries — a tab entry here behaves exactly like a
1551
+ * main-list tab (mounts, activates, closes through the same lifecycle). Override
1537
1552
  * `--rdd-sidebar-header-area-padding-top`/`--rdd-sidebar-header-area-padding-bottom`
1538
1553
  * (both default `8px`) to control its spacing/effective height.
1539
1554
  */
1540
- headerAction?: SidebarHeaderAction;
1555
+ headerAction?: SidebarRailEntry | SidebarRailEntry[];
1556
+ /**
1557
+ * Mirror of `headerAction`, pinned to the bottom of the tab strip via its own
1558
+ * `.rdd-sidebar-footer-area` — e.g. a "Settings" tab that should always sit at the bottom
1559
+ * regardless of tab count. Override `--rdd-sidebar-footer-area-padding-top`/
1560
+ * `--rdd-sidebar-footer-area-padding-bottom` (both default `8px`) to control its spacing.
1561
+ */
1562
+ footerAction?: SidebarRailEntry | SidebarRailEntry[];
1541
1563
  /** Initial drawer width in pixels. Default: 280 */
1542
1564
  defaultWidth?: number;
1543
1565
  /** Minimum drawer width in pixels during drag-resize. Default: 150 */
@@ -1558,6 +1580,11 @@ interface SidebarProps {
1558
1580
  stripVisible?: boolean;
1559
1581
  /** Called when showStrip/hideStrip is invoked on the imperative handle. */
1560
1582
  onStripVisibilityChange?: (visible: boolean) => void;
1583
+ /**
1584
+ * 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
1586
+ */
1587
+ showCloseButton?: boolean;
1561
1588
  /** Main workspace content rendered alongside the sidebar. */
1562
1589
  children?: React$1.ReactNode;
1563
1590
  }