@gaulatti/bleecker 0.1.20 → 0.1.22

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.
@@ -1,4 +1,16 @@
1
1
  import React from 'react';
2
+ export interface PanelColumnProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ /** When true, the column expands to fill available horizontal space. */
6
+ grow?: boolean;
7
+ }
8
+ /**
9
+ * Stacks two or more Panels vertically within a single PanelLayout column.
10
+ * Add `grow` to a Panel child to make it fill all remaining vertical space.
11
+ * Panels without `grow` size to their content / fixed height.
12
+ */
13
+ export declare function PanelColumn({ children, className }: PanelColumnProps): import("react/jsx-runtime").JSX.Element;
2
14
  export interface PanelLayoutProps {
3
15
  children: React.ReactNode;
4
16
  className?: string;
@@ -2,12 +2,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { Panel } from '../components/panel.js';
4
4
  import { cn } from '../utils/cn.js';
5
+ /**
6
+ * Stacks two or more Panels vertically within a single PanelLayout column.
7
+ * Add `grow` to a Panel child to make it fill all remaining vertical space.
8
+ * Panels without `grow` size to their content / fixed height.
9
+ */
10
+ export function PanelColumn({ children, className }) {
11
+ return (_jsx("div", { className: cn('flex flex-col flex-1 h-full min-h-0 overflow-hidden', className), children: React.Children.map(children, (child) => {
12
+ if (!React.isValidElement(child))
13
+ return child;
14
+ const shouldFill = Boolean(child.props.grow);
15
+ const childProps = child.type === Panel ? { variant: 'monitor' } : {};
16
+ return (_jsx("div", { className: cn('flex flex-col min-h-0 overflow-hidden', shouldFill ? 'flex-1' : 'shrink-0'), children: React.cloneElement(child, childProps) }));
17
+ }) }));
18
+ }
5
19
  export function PanelLayout({ children, className, padding }) {
6
20
  const resolvedPadding = padding ?? 'p-0';
7
- return (_jsx("div", { className: cn('flex flex-1 h-full min-h-0 overflow-x-auto', resolvedPadding, className), children: _jsx("div", { className: 'flex flex-1 h-full min-h-0 gap-0 flex-nowrap', children: React.Children.map(children, (child) => {
21
+ return (_jsx("div", { className: cn('flex flex-1 min-h-0 overflow-x-auto overflow-y-hidden', resolvedPadding, className), children: _jsx("div", { className: 'flex flex-1 h-full min-h-0 gap-0 flex-nowrap', children: React.Children.map(children, (child) => {
8
22
  if (!React.isValidElement(child))
9
23
  return child;
10
24
  const shouldFill = Boolean(child.props.grow);
25
+ // PanelColumn already handles its own layout — render it directly.
26
+ if (child.type === PanelColumn) {
27
+ return _jsx("div", { className: cn('flex h-full min-h-0 flex-col', shouldFill ? 'flex-1 min-w-0' : 'shrink-0'), children: child });
28
+ }
11
29
  // Auto-inject monitor panel styling for Panel children.
12
30
  const childProps = child.type === Panel ? { variant: 'monitor' } : {};
13
31
  return (_jsx("div", { className: cn('flex h-full min-h-0 flex-col', shouldFill ? 'flex-1 min-w-0' : 'shrink-0'), children: React.cloneElement(child, childProps) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaulatti/bleecker",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/gaulatti/bleecker"